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