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