Port up spoof checking
[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         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         attribute-policy.xml \
26         example-metadata.xml
27
28 # While BUILTCONFIGFILES are processed, these are not; so we should pull
29 # them from SRCDIR.
30 CONFIGFILES = \
31         console.logger \
32         syslog.logger \
33         accessError.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}:g' \
48             -e 's:@-LIBEXECDIR-@:${libexecdir}:g' \
49             -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
50             -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
51             -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \
52             -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \
53             -e 's:@-VARRUNDIR-@:${varrundir}:g'
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 attribute-policy.xml: ${srcdir}/attribute-policy.xml.in Makefile ${top_builddir}/config.status
82         $(MAKE) do-build-file FILE=$@
83
84 example-metadata.xml: ${srcdir}/example-metadata.xml.in Makefile ${top_builddir}/config.status
85         $(MAKE) do-build-file FILE=$@
86
87 all-data-local: $(BUILTCONFIGFILES)
88
89 install-data-local:     all-data-local
90         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
91         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
92         $(mkinstalldirs) $(DESTDIR)$(varrundir)
93         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
94         $(mkinstalldirs) $(DESTDIR)$(prefix)/data
95         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
96         for f in $(BUILTCONFIGFILES); do \
97                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
98                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
99                 fi; \
100                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
101         done
102         for f in $(CONFIGFILES); do \
103                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
104                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
105                 fi; \
106                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
107         done
108
109 CLEANFILES = \
110         apache.config \
111         apache2.config \
112         apache22.config \
113         shibd \
114         shibd.logger \
115         native.logger \
116         shibboleth.xml \
117         attribute-map.xml \
118         attribute-policy.xml \
119         example-metadata.xml
120
121 EXTRA_DIST = \
122         shibboleth.xml.in \
123         attribute-map.xml.in \
124         attribute-policy.xml.in \
125         example-metadata.xml.in \
126         native.logger.in \
127         shibd.logger.in \
128         apache.config.in \
129         apache2.config.in \
130         apache22.config.in \
131         shibd.in \
132         console.logger \
133         syslog.logger \
134         accessError.html \
135         sessionError.html \
136         metadataError.html \
137         sslError.html \
138         sp-example.key \
139         sp-example.crt