2f40bde329610fe1f31229f40f2bd83d59f5dd53
[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 \
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         sslError.html \
39         sp-example.key \
40         sp-example.crt
41
42 #
43 # Some of these need building
44 #
45 do-build-file:
46         rm -f ${FILE}.tmp
47         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
48             -e 's:@-PREFIX-@:${prefix}:g' \
49             -e 's:@-LIBEXECDIR-@:${libexecdir}:g' \
50             -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
51             -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
52             -e 's:@-XMLDIR-@:${xmldir}:g' \
53             -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \
54             -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \
55             -e 's:@-VARRUNDIR-@:${varrundir}:g'
56         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
57         rm -f ${FILE}.tmp
58
59 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
60         $(MAKE) do-build-file FILE=$@
61
62 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
63         $(MAKE) do-build-file FILE=$@
64
65 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
66         $(MAKE) do-build-file FILE=$@
67
68 shibd: ${srcdir}/shibd.in Makefile ${top_builddir}/config.status
69         $(MAKE) do-build-file FILE=$@
70
71 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
72         $(MAKE) do-build-file FILE=$@
73
74 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
75         $(MAKE) do-build-file FILE=$@
76
77 shibboleth2.xml: ${srcdir}/shibboleth2.xml.in Makefile ${top_builddir}/config.status
78         $(MAKE) do-build-file FILE=$@
79
80 attribute-map.xml: ${srcdir}/attribute-map.xml.in Makefile ${top_builddir}/config.status
81         $(MAKE) do-build-file FILE=$@
82
83 attribute-policy.xml: ${srcdir}/attribute-policy.xml.in Makefile ${top_builddir}/config.status
84         $(MAKE) do-build-file FILE=$@
85
86 example-metadata.xml: ${srcdir}/example-metadata.xml.in Makefile ${top_builddir}/config.status
87         $(MAKE) do-build-file FILE=$@
88
89 all-data-local: $(BUILTCONFIGFILES)
90
91 install-data-local:     all-data-local
92         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
93         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
94         $(mkinstalldirs) $(DESTDIR)$(varrundir)
95         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
96         $(mkinstalldirs) $(DESTDIR)$(prefix)/data
97         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
98         for f in $(BUILTCONFIGFILES); do \
99                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
100                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
101                 fi; \
102                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
103         done
104         for f in $(CONFIGFILES); do \
105                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
106                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
107                 fi; \
108                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
109         done
110
111 CLEANFILES = \
112         apache.config \
113         apache2.config \
114         apache22.config \
115         shibd \
116         shibd.logger \
117         native.logger \
118         shibboleth2.xml \
119         attribute-map.xml \
120         attribute-policy.xml \
121         example-metadata.xml
122
123 EXTRA_DIST = \
124         shibboleth2.xml.in \
125         attribute-map.xml.in \
126         attribute-policy.xml.in \
127         example-metadata.xml.in \
128         native.logger.in \
129         shibd.logger.in \
130         apache.config.in \
131         apache2.config.in \
132         apache22.config.in \
133         shibd.in \
134         console.logger \
135         syslog.logger \
136         accessError.html \
137         sessionError.html \
138         metadataError.html \
139         sslError.html \
140         sp-example.key \
141         sp-example.crt