Initial draft of protocol bootstrapper, reworked ACS lookup (again).
[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@-@PACKAGE_VERSION@
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-suse \
15         shibd-debian \
16         shibd-osx.plist \
17         apache.config \
18         apache2.config \
19         apache22.config \
20         keygen.sh \
21         metagen.sh \
22         upgrade.xsl
23
24 # The config files are installed "special".  Unlike the entries in
25 # pkgsysconf_DATA, these files are installed as "foo.dist" and only
26 # installed as "foo" if "foo" does not already exist.  In other words,
27 # the config files will not overwrite existing versions.
28 BUILTCONFIGFILES = \
29         native.logger \
30         shibd.logger
31
32 # While BUILTCONFIGFILES are processed, these are not; so we should pull
33 # them from SRCDIR.
34 CONFIGFILES = \
35         shibboleth2.xml \
36         attribute-map.xml \
37         attribute-policy.xml \
38         protocols.xml \
39         security-policy.xml \
40         example-metadata.xml \
41         example-shibboleth2.xml \
42         console.logger \
43         syslog.logger \
44         accessError.html \
45         sessionError.html \
46         metadataError.html \
47         bindingTemplate.html \
48         discoveryTemplate.html \
49     postTemplate.html \
50         localLogout.html \
51         globalLogout.html \
52         partialLogout.html \
53         sslError.html
54
55 #
56 # Some of these need building
57 #
58 do-build-file:
59         rm -f ${FILE}.tmp
60         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
61         -e 's:@-PREFIX-@:${prefix}:g' \
62         -e 's:@-PKGLIBDIR-@:${pkglibdir}:g' \
63         -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
64         -e 's:@-PKGDOCDIR-@:${pkgdocdir}:g' \
65         -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
66         -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \
67         -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \
68         -e 's:@-PKGRUNDIR-@:${pkgrundir}:g'
69         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
70         rm -f ${FILE}.tmp
71
72 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
73         $(MAKE) do-build-file FILE=$@
74
75 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
76         $(MAKE) do-build-file FILE=$@
77
78 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
79         $(MAKE) do-build-file FILE=$@
80
81 shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status
82         $(MAKE) do-build-file FILE=$@
83
84 shibd-suse: ${srcdir}/shibd-suse.in Makefile ${top_builddir}/config.status
85         $(MAKE) do-build-file FILE=$@
86
87 shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status
88         $(MAKE) do-build-file FILE=$@
89
90 shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status
91         $(MAKE) do-build-file FILE=$@
92
93 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
94         $(MAKE) do-build-file FILE=$@
95
96 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
97         $(MAKE) do-build-file FILE=$@
98
99 all-data-local: $(BUILTCONFIGFILES)
100
101 install-data-local:     all-data-local
102         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
103         $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
104         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
105         $(mkinstalldirs) $(DESTDIR)$(pkgrundir)
106         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
107         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
108         for f in $(BUILTCONFIGFILES); do \
109                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
110                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
111                 fi; \
112                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
113         done
114         for f in $(CONFIGFILES); do \
115                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
116                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
117                 fi; \
118                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
119         done
120
121 install-data-hook:
122         chmod +x $(DESTDIR)$(pkgsysconfdir)/keygen.sh
123         chmod +x $(DESTDIR)$(pkgsysconfdir)/metagen.sh
124         if test -z "$(NOKEYGEN)"; then \
125                 cd $(DESTDIR)$(pkgsysconfdir); \
126                 sh ./keygen.sh -b ; \
127         fi
128
129 CLEANFILES = \
130         apache.config \
131         apache2.config \
132         apache22.config \
133         shibd-redhat \
134         shibd-suse \
135         shibd-debian \
136         shibd-osx.plist \
137         shibd.logger \
138         native.logger
139
140 EXTRA_DIST = \
141         native.logger.in \
142         shibd.logger.in \
143         apache.config.in \
144         apache2.config.in \
145         apache22.config.in \
146         shibd-redhat.in \
147         shibd-suse.in \
148         shibd-debian.in \
149         shibd-osx.plist.in \
150         keygen.bat \
151         keygen.sh \
152         metagen.sh \
153         upgrade.xsl \
154         xsltproc.js \
155         $(CONFIGFILES)