Add OS-X launchd info.
[shibboleth/sp.git] / configs / Makefile.am
1 ## $Id$ 
2
3 AUTOMAKE_OPTIONS = foreign
4
5 pkglogdir = ${localstatedir}/log/@PACKAGE@
6 shirelogdir = ${localstatedir}/log/httpd
7 xmldir = $(datadir)/xml
8 pkgxmldir = $(datadir)/xml/@PACKAGE@
9 varrundir = $(localstatedir)/run
10 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
11 pkgsysconf_DATA = \
12         shibd-redhat \
13         shibd-debian \
14         shibd-osx.plist \
15         apache.config \
16         apache2.config \
17         apache22.config
18
19 # The config files are installed "special".  Unlike the entries in
20 # pkgsysconf_DATA, these files are installed as "foo.dist" and only
21 # installed as "foo" if "foo" does not already exist.  In other words,
22 # the config files will not overwrite existing versions.
23 BUILTCONFIGFILES = \
24         shibboleth2.xml \
25         native.logger \
26         shibd.logger \
27         attribute-map.xml \
28         attribute-policy.xml \
29         example-metadata.xml
30
31 # While BUILTCONFIGFILES are processed, these are not; so we should pull
32 # them from SRCDIR.
33 CONFIGFILES = \
34         console.logger \
35         syslog.logger \
36         accessError.html \
37         sessionError.html \
38         metadataError.html \
39         bindingTemplate.html \
40         localLogout.html \
41         globalLogout.html \
42         sslError.html \
43         sp-example.key \
44         sp-example.crt
45
46 #
47 # Some of these need building
48 #
49 do-build-file:
50         rm -f ${FILE}.tmp
51         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
52             -e 's:@-PREFIX-@:${prefix}:g' \
53             -e 's:@-LIBEXECDIR-@:${libexecdir}:g' \
54             -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
55             -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
56             -e 's:@-XMLDIR-@:${xmldir}:g' \
57             -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \
58             -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \
59             -e 's:@-VARRUNDIR-@:${varrundir}:g'
60         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
61         rm -f ${FILE}.tmp
62
63 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
64         $(MAKE) do-build-file FILE=$@
65
66 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
67         $(MAKE) do-build-file FILE=$@
68
69 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
70         $(MAKE) do-build-file FILE=$@
71
72 shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status
73         $(MAKE) do-build-file FILE=$@
74
75 shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status
76         $(MAKE) do-build-file FILE=$@
77
78 shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status
79         $(MAKE) do-build-file FILE=$@
80
81 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
82         $(MAKE) do-build-file FILE=$@
83
84 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
85         $(MAKE) do-build-file FILE=$@
86
87 shibboleth2.xml: ${srcdir}/shibboleth2.xml.in Makefile ${top_builddir}/config.status
88         $(MAKE) do-build-file FILE=$@
89
90 attribute-map.xml: ${srcdir}/attribute-map.xml.in Makefile ${top_builddir}/config.status
91         $(MAKE) do-build-file FILE=$@
92
93 attribute-policy.xml: ${srcdir}/attribute-policy.xml.in Makefile ${top_builddir}/config.status
94         $(MAKE) do-build-file FILE=$@
95
96 example-metadata.xml: ${srcdir}/example-metadata.xml.in Makefile ${top_builddir}/config.status
97         $(MAKE) do-build-file FILE=$@
98
99 all-data-local: $(BUILTCONFIGFILES)
100
101 install-data-local:     all-data-local
102         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
103         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
104         $(mkinstalldirs) $(DESTDIR)$(varrundir)
105         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
106         $(mkinstalldirs) $(DESTDIR)$(prefix)/data
107         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
108         for f in $(BUILTCONFIGFILES); do \
109                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
110                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
111                 fi; \
112                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
113         done
114         for f in $(CONFIGFILES); do \
115                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
116                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
117                 fi; \
118                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
119         done
120
121 CLEANFILES = \
122         apache.config \
123         apache2.config \
124         apache22.config \
125         shibd-redhat \
126         shibd-debian \
127         shibd-osx.plist \
128         shibd.logger \
129         native.logger \
130         shibboleth2.xml \
131         attribute-map.xml \
132         attribute-policy.xml \
133         example-metadata.xml
134
135 EXTRA_DIST = \
136         shibboleth2.xml.in \
137         attribute-map.xml.in \
138         attribute-policy.xml.in \
139         example-metadata.xml.in \
140         native.logger.in \
141         shibd.logger.in \
142         apache.config.in \
143         apache2.config.in \
144         apache22.config.in \
145         shibd-redhat.in \
146         shibd-debian.in \
147         shibd-osx.plist.in \
148         $(CONFIGFILES)