Port fastcgi code to trunk.
[shibboleth/cpp-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 xmldir = $(datadir)/xml
10 pkgxmldir = $(datadir)/xml/@PACKAGE@
11 pkgrundir = $(localstatedir)/run/@PACKAGE@
12 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
13 pkgsysconf_DATA = \
14         shibd-redhat \
15         shibd-debian \
16         shibd-osx.plist \
17         apache.config \
18         apache2.config \
19         apache22.config
20
21 # The config files are installed "special".  Unlike the entries in
22 # pkgsysconf_DATA, these files are installed as "foo.dist" and only
23 # installed as "foo" if "foo" does not already exist.  In other words,
24 # the config files will not overwrite existing versions.
25 BUILTCONFIGFILES = \
26         shibboleth2.xml \
27         native.logger \
28         shibd.logger \
29         attribute-map.xml \
30         attribute-policy.xml \
31         example-metadata.xml
32
33 # While BUILTCONFIGFILES are processed, these are not; so we should pull
34 # them from SRCDIR.
35 CONFIGFILES = \
36         console.logger \
37         syslog.logger \
38         accessError.html \
39         sessionError.html \
40         metadataError.html \
41         bindingTemplate.html \
42         localLogout.html \
43         globalLogout.html \
44         sslError.html \
45         sp-example.key \
46         sp-example.crt
47
48 #
49 # Some of these need building
50 #
51 do-build-file:
52         rm -f ${FILE}.tmp
53         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
54         -e 's:@-PREFIX-@:${prefix}:g' \
55         -e 's:@-PKGLIBDIR-@:${pkglibdir}:g' \
56         -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
57         -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
58         -e 's:@-PKGDOCDIR-@:${pkgdocdir}:g' \
59         -e 's:@-XMLDIR-@:${xmldir}: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 shibboleth2.xml: ${srcdir}/shibboleth2.xml.in Makefile ${top_builddir}/config.status
91         $(MAKE) do-build-file FILE=$@
92
93 attribute-map.xml: ${srcdir}/attribute-map.xml.in Makefile ${top_builddir}/config.status
94         $(MAKE) do-build-file FILE=$@
95
96 attribute-policy.xml: ${srcdir}/attribute-policy.xml.in Makefile ${top_builddir}/config.status
97         $(MAKE) do-build-file FILE=$@
98
99 example-metadata.xml: ${srcdir}/example-metadata.xml.in Makefile ${top_builddir}/config.status
100         $(MAKE) do-build-file FILE=$@
101
102 all-data-local: $(BUILTCONFIGFILES)
103
104 install-data-local:     all-data-local
105         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
106         $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
107         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
108         $(mkinstalldirs) $(DESTDIR)$(pkgrundir)
109         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
110         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
111         for f in $(BUILTCONFIGFILES); do \
112                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
113                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
114                 fi; \
115                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
116         done
117         for f in $(CONFIGFILES); do \
118                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
119                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
120                 fi; \
121                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
122         done
123
124 CLEANFILES = \
125         apache.config \
126         apache2.config \
127         apache22.config \
128         shibd-redhat \
129         shibd-debian \
130         shibd-osx.plist \
131         shibd.logger \
132         native.logger \
133         shibboleth2.xml \
134         attribute-map.xml \
135         attribute-policy.xml \
136         example-metadata.xml
137
138 EXTRA_DIST = \
139         shibboleth2.xml.in \
140         attribute-map.xml.in \
141         attribute-policy.xml.in \
142         example-metadata.xml.in \
143         native.logger.in \
144         shibd.logger.in \
145         apache.config.in \
146         apache2.config.in \
147         apache22.config.in \
148         shibd-redhat.in \
149         shibd-debian.in \
150         shibd-osx.plist.in \
151         $(CONFIGFILES)