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