Didn't mean to map this to an unscoped attribute id.
[shibboleth/sp.git] / configs / Makefile.am
1 ## $Id$ 
2
3 AUTOMAKE_OPTIONS = foreign
4
5 pkglogdir = ${localstatedir}/log/@PACKAGE@
6 pkgdocdir = ${datadir}/doc/@PACKAGE@
7 shirelogdir = ${localstatedir}/log/httpd
8 xmldir = $(datadir)/xml
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         shibboleth2.xml \
26         native.logger \
27         shibd.logger \
28         attribute-map.xml \
29         attribute-policy.xml \
30         example-metadata.xml
31
32 # While BUILTCONFIGFILES are processed, these are not; so we should pull
33 # them from SRCDIR.
34 CONFIGFILES = \
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:@-LIBEXECDIR-@:${libexecdir}:g' \
55         -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
56         -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
57         -e 's:@-PKGDOCDIR-@:${pkgdocdir}:g' \
58         -e 's:@-XMLDIR-@:${xmldir}:g' \
59         -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \
60         -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \
61         -e 's:@-PKGRUNDIR-@:${pkgrundir}:g'
62         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
63         rm -f ${FILE}.tmp
64
65 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
66         $(MAKE) do-build-file FILE=$@
67
68 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
69         $(MAKE) do-build-file FILE=$@
70
71 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
72         $(MAKE) do-build-file FILE=$@
73
74 shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status
75         $(MAKE) do-build-file FILE=$@
76
77 shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status
78         $(MAKE) do-build-file FILE=$@
79
80 shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status
81         $(MAKE) do-build-file FILE=$@
82
83 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
84         $(MAKE) do-build-file FILE=$@
85
86 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
87         $(MAKE) do-build-file FILE=$@
88
89 shibboleth2.xml: ${srcdir}/shibboleth2.xml.in Makefile ${top_builddir}/config.status
90         $(MAKE) do-build-file FILE=$@
91
92 attribute-map.xml: ${srcdir}/attribute-map.xml.in Makefile ${top_builddir}/config.status
93         $(MAKE) do-build-file FILE=$@
94
95 attribute-policy.xml: ${srcdir}/attribute-policy.xml.in Makefile ${top_builddir}/config.status
96         $(MAKE) do-build-file FILE=$@
97
98 example-metadata.xml: ${srcdir}/example-metadata.xml.in Makefile ${top_builddir}/config.status
99         $(MAKE) do-build-file FILE=$@
100
101 all-data-local: $(BUILTCONFIGFILES)
102
103 install-data-local:     all-data-local
104         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
105         $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
106         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
107         $(mkinstalldirs) $(DESTDIR)$(pkgrundir)
108         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
109         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
110         for f in $(BUILTCONFIGFILES); do \
111                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
112                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
113                 fi; \
114                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
115         done
116         for f in $(CONFIGFILES); do \
117                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
118                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
119                 fi; \
120                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
121         done
122
123 CLEANFILES = \
124         apache.config \
125         apache2.config \
126         apache22.config \
127         shibd-redhat \
128         shibd-debian \
129         shibd-osx.plist \
130         shibd.logger \
131         native.logger \
132         shibboleth2.xml \
133         attribute-map.xml \
134         attribute-policy.xml \
135         example-metadata.xml
136
137 EXTRA_DIST = \
138         shibboleth2.xml.in \
139         attribute-map.xml.in \
140         attribute-policy.xml.in \
141         example-metadata.xml.in \
142         native.logger.in \
143         shibd.logger.in \
144         apache.config.in \
145         apache2.config.in \
146         apache22.config.in \
147         shibd-redhat.in \
148         shibd-debian.in \
149         shibd-osx.plist.in \
150         $(CONFIGFILES)