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