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