Move some file locations around.
[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         shire.logger \
22         shar.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         shar.key \
35         shar.crt
36
37 #
38 # Some of these need building
39 #
40 do-build-file:
41         rm -f ${FILE}.tmp
42         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
43             -e 's:@-PREFIX-@:${prefix}:' \
44             -e 's:@-LIBEXECDIR-@:${libexecdir}:' \
45             -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:' \
46             -e 's:@-PKGXMLDIR-@:${pkgxmldir}:' \
47             -e 's:@-PKGLOGDIR-@:${pkglogdir}:' \
48             -e 's:@-SHIRELOGDIR-@:${shirelogdir}:' \
49             -e 's:@-VARRUNDIR-@:${varrundir}:'
50         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
51         rm -f ${FILE}.tmp
52
53 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
54         $(MAKE) do-build-file FILE=$@
55
56 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
57         $(MAKE) do-build-file FILE=$@
58
59 shar.logger: ${srcdir}/shar.logger.in Makefile ${top_builddir}/config.status
60         $(MAKE) do-build-file FILE=$@
61
62 shire.logger: ${srcdir}/shire.logger.in Makefile ${top_builddir}/config.status
63         $(MAKE) do-build-file FILE=$@
64
65 shibboleth.xml: ${srcdir}/shibboleth.xml.in Makefile ${top_builddir}/config.status
66         $(MAKE) do-build-file FILE=$@
67
68 AAP.xml: ${srcdir}/AAP.xml.in Makefile ${top_builddir}/config.status
69         $(MAKE) do-build-file FILE=$@
70
71 IQ-sites.xml: ${srcdir}/IQ-sites.xml.in Makefile ${top_builddir}/config.status
72         $(MAKE) do-build-file FILE=$@
73
74 IQ-trust.xml: ${srcdir}/IQ-trust.xml.in Makefile ${top_builddir}/config.status
75         $(MAKE) do-build-file FILE=$@
76
77 all-data-local: $(BUILTCONFIGFILES)
78
79 install-data-local:     all-data-local
80         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
81         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
82         $(mkinstalldirs) $(DESTDIR)$(prefix)/data
83         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
84         for f in $(BUILTCONFIGFILES); do \
85                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
86                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
87                 fi; \
88                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
89         done
90         for f in $(CONFIGFILES); do \
91                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
92                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
93                 fi; \
94                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
95         done
96
97 CLEANFILES = \
98         apache.config \
99         apache2.config \
100         shar.logger \
101         shire.logger \
102         shibboleth.xml \
103         AAP.xml \
104         IQ-sites.xml \
105         IQ-trust.xml
106
107 EXTRA_DIST = .cvsignore \
108         shibboleth.xml.in \
109         shire.logger.in \
110         shar.logger.in \
111         apache.config.in \
112         apache2.config.in \
113         shibboleth.logger \
114         accessError.html \
115         rmError.html \
116         sessionError.html \
117         AAP.xml.in \
118         IQ-sites.xml.in \
119         IQ-trust.xml.in \
120         inqueue.pem \
121         shar.key \
122         shar.crt