3d3fc910659ee897edfa94f91d036d9314aabbe4
[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         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         native.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 native.logger: ${srcdir}/native.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)$(shirelogdir)
83         $(mkinstalldirs) $(DESTDIR)$(varrundir)
84         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
85         $(mkinstalldirs) $(DESTDIR)$(prefix)/data
86         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
87         for f in $(BUILTCONFIGFILES); do \
88                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
89                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
90                 fi; \
91                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
92         done
93         for f in $(CONFIGFILES); do \
94                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
95                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
96                 fi; \
97                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
98         done
99
100 CLEANFILES = \
101         apache.config \
102         apache2.config \
103         shibd.logger \
104         native.logger \
105         shibboleth.xml \
106         AAP.xml \
107         IQ-sites.xml \
108         IQ-trust.xml
109
110 EXTRA_DIST = .cvsignore \
111         shibboleth.xml.in \
112         native.logger.in \
113         shibd.logger.in \
114         apache.config.in \
115         apache2.config.in \
116         shibboleth.logger \
117         accessError.html \
118         rmError.html \
119         sessionError.html \
120         metadataError.html \
121         AAP.xml.in \
122         IQ-sites.xml.in \
123         IQ-trust.xml.in \
124         inqueue.pem \
125         example.key \
126         example.crt