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