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