Copied over mapping and filtering schemas.
[shibboleth/cpp-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         shibd \
12         apache.config \
13         apache2.config \
14         apache22.config
15
16 # The config files are installed "special".  Unlike the entries in
17 # pkgsysconf_DATA, these files are installed as "foo.dist" and only
18 # installed as "foo" if "foo" does not already exist.  In other words,
19 # the config files will not overwrite existing versions.
20 BUILTCONFIGFILES = \
21         shibboleth.xml \
22         native.logger \
23         shibd.logger \
24         attribute-map.xml \
25         example-metadata.xml
26
27 # While BUILTCONFIGFILES are processed, these are not; so we should pull
28 # them from SRCDIR.
29 CONFIGFILES = \
30         console.logger \
31         syslog.logger \
32         accessError.html \
33         rmError.html \
34         sessionError.html \
35         metadataError.html \
36         bindingTemplate.html \
37         sslError.html \
38         sp-example.key \
39         sp-example.crt
40
41 #
42 # Some of these need building
43 #
44 do-build-file:
45         rm -f ${FILE}.tmp
46         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
47             -e 's:@-PREFIX-@:${prefix}:' \
48             -e 's:@-LIBEXECDIR-@:${libexecdir}:' \
49             -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:' \
50             -e 's:@-PKGXMLDIR-@:${pkgxmldir}:' \
51             -e 's:@-PKGLOGDIR-@:${pkglogdir}:' \
52             -e 's:@-SHIRELOGDIR-@:${shirelogdir}:' \
53             -e 's:@-VARRUNDIR-@:${varrundir}:'
54         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
55         rm -f ${FILE}.tmp
56
57 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
58         $(MAKE) do-build-file FILE=$@
59
60 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
61         $(MAKE) do-build-file FILE=$@
62
63 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
64         $(MAKE) do-build-file FILE=$@
65
66 shibd: ${srcdir}/shibd.in Makefile ${top_builddir}/config.status
67         $(MAKE) do-build-file FILE=$@
68
69 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
70         $(MAKE) do-build-file FILE=$@
71
72 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
73         $(MAKE) do-build-file FILE=$@
74
75 shibboleth.xml: ${srcdir}/shibboleth.xml.in Makefile ${top_builddir}/config.status
76         $(MAKE) do-build-file FILE=$@
77
78 attribute-map.xml: ${srcdir}/attribute-map.xml.in Makefile ${top_builddir}/config.status
79         $(MAKE) do-build-file FILE=$@
80
81 example-metadata.xml: ${srcdir}/example-metadata.xml.in Makefile ${top_builddir}/config.status
82         $(MAKE) do-build-file FILE=$@
83
84 all-data-local: $(BUILTCONFIGFILES)
85
86 install-data-local:     all-data-local
87         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
88         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
89         $(mkinstalldirs) $(DESTDIR)$(varrundir)
90         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
91         $(mkinstalldirs) $(DESTDIR)$(prefix)/data
92         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
93         for f in $(BUILTCONFIGFILES); do \
94                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
95                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
96                 fi; \
97                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
98         done
99         for f in $(CONFIGFILES); do \
100                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
101                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
102                 fi; \
103                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
104         done
105
106 CLEANFILES = \
107         apache.config \
108         apache2.config \
109         apache22.config \
110         shibd \
111         shibd.logger \
112         native.logger \
113         shibboleth.xml \
114         attribute-map.xml \
115         example-metadata.xml
116
117 EXTRA_DIST =
118         shibboleth.xml.in \
119         attribute-map.xml.in \
120         example-metadata.xml.in \
121         native.logger.in \
122         shibd.logger.in \
123         apache.config.in \
124         apache2.config.in \
125         apache22.config.in \
126         shibd.in \
127         console.logger \
128         syslog.logger \
129         accessError.html \
130         rmError.html \
131         sessionError.html \
132         metadataError.html \
133         sslError.html \
134         sp-example.key \
135         sp-example.crt