fb6cd711216c024a1cddde6cb5c7d07f106e8d8f
[shibboleth/sp.git] / configs / Makefile.am
1 ## $Id$ 
2
3 AUTOMAKE_OPTIONS = foreign
4
5 pkglibdir = ${libdir}/@PACKAGE@
6 pkglogdir = ${localstatedir}/log/@PACKAGE@
7 pkgdocdir = ${datadir}/doc/@PACKAGE@
8 shirelogdir = ${localstatedir}/log/httpd
9 pkgxmldir = $(datadir)/xml/@PACKAGE@
10 pkgrundir = $(localstatedir)/run/@PACKAGE@
11 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
12 pkgsysconf_DATA = \
13         shibd-redhat \
14         shibd-debian \
15         shibd-osx.plist \
16         apache.config \
17         apache2.config \
18         apache22.config
19
20 # The config files are installed "special".  Unlike the entries in
21 # pkgsysconf_DATA, these files are installed as "foo.dist" and only
22 # installed as "foo" if "foo" does not already exist.  In other words,
23 # the config files will not overwrite existing versions.
24 BUILTCONFIGFILES = \
25         native.logger \
26         shibd.logger \
27         attribute-map.xml \
28         attribute-policy.xml
29
30 # While BUILTCONFIGFILES are processed, these are not; so we should pull
31 # them from SRCDIR.
32 CONFIGFILES = \
33     shibboleth2.xml \
34     example-metadata.xml \
35         console.logger \
36         syslog.logger \
37         accessError.html \
38         sessionError.html \
39         metadataError.html \
40         bindingTemplate.html \
41         localLogout.html \
42         globalLogout.html \
43         sslError.html \
44         sp-example.key \
45         sp-example.crt
46
47 #
48 # Some of these need building
49 #
50 do-build-file:
51         rm -f ${FILE}.tmp
52         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
53         -e 's:@-PREFIX-@:${prefix}:g' \
54         -e 's:@-PKGLIBDIR-@:${pkglibdir}:g' \
55         -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
56         -e 's:@-PKGDOCDIR-@:${pkgdocdir}:g' \
57         -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
58         -e 's:@-XMLTOOLINGXMLDIR-@:${XMLTOOLINGXMLDIR}:g' \
59         -e 's:@-OPENSAMLXMLDIR-@:${OPENSAMLXMLDIR}:g' \
60         -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \
61         -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \
62         -e 's:@-PKGRUNDIR-@:${pkgrundir}:g'
63         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
64         rm -f ${FILE}.tmp
65
66 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
67         $(MAKE) do-build-file FILE=$@
68
69 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
70         $(MAKE) do-build-file FILE=$@
71
72 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
73         $(MAKE) do-build-file FILE=$@
74
75 shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status
76         $(MAKE) do-build-file FILE=$@
77
78 shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status
79         $(MAKE) do-build-file FILE=$@
80
81 shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status
82         $(MAKE) do-build-file FILE=$@
83
84 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
85         $(MAKE) do-build-file FILE=$@
86
87 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
88         $(MAKE) do-build-file FILE=$@
89
90 attribute-map.xml: ${srcdir}/attribute-map.xml.in Makefile ${top_builddir}/config.status
91         $(MAKE) do-build-file FILE=$@
92
93 attribute-policy.xml: ${srcdir}/attribute-policy.xml.in Makefile ${top_builddir}/config.status
94         $(MAKE) do-build-file FILE=$@
95
96 all-data-local: $(BUILTCONFIGFILES)
97
98 install-data-local:     all-data-local
99         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
100         $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
101         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
102         $(mkinstalldirs) $(DESTDIR)$(pkgrundir)
103         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
104         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
105         for f in $(BUILTCONFIGFILES); do \
106                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
107                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
108                 fi; \
109                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
110         done
111         for f in $(CONFIGFILES); do \
112                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
113                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
114                 fi; \
115                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
116         done
117
118 CLEANFILES = \
119         apache.config \
120         apache2.config \
121         apache22.config \
122         shibd-redhat \
123         shibd-debian \
124         shibd-osx.plist \
125         shibd.logger \
126         native.logger \
127         attribute-map.xml \
128         attribute-policy.xml
129
130 EXTRA_DIST = \
131         attribute-map.xml.in \
132         attribute-policy.xml.in \
133         native.logger.in \
134         shibd.logger.in \
135         apache.config.in \
136         apache2.config.in \
137         apache22.config.in \
138         shibd-redhat.in \
139         shibd-debian.in \
140         shibd-osx.plist.in \
141         $(CONFIGFILES)