https://issues.shibboleth.net/jira/browse/SSPCPP-119
[shibboleth/cpp-sp.git] / configs / Makefile.am
1 ## $Id$ 
2
3 AUTOMAKE_OPTIONS = foreign
4
5 pkglogdir = ${localstatedir}/log/@PACKAGE@
6 shirelogdir = ${localstatedir}/log/httpd
7 pkgxmldir = $(datadir)/xml/@PACKAGE@
8 pkgdocdir = $(datadir)/doc/@PACKAGE@
9 varrundir = $(localstatedir)/run
10 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
11 pkgsysconf_DATA = \
12         shibd-redhat \
13         shibd-debian \
14         shibd-osx.plist \
15         apache.config \
16         apache2.config \
17         apache22.config
18
19 # The config files are installed "special".  Unlike the entries in
20 # pkgsysconf_DATA, these files are installed as "foo.dist" and only
21 # installed as "foo" if "foo" does not already exist.  In other words,
22 # the config files will not overwrite existing versions.
23 BUILTCONFIGFILES = \
24         shibboleth.xml \
25         native.logger \
26         shibd.logger \
27         AAP.xml \
28         example-metadata.xml
29
30 # While BUILTCONFIGFILES are processed, these are not; so we should pull
31 # them from SRCDIR.
32 CONFIGFILES = \
33         shibboleth.logger \
34         accessError.html \
35         rmError.html \
36         sessionError.html \
37         metadataError.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}:' \
49             -e 's:@-LIBEXECDIR-@:${libexecdir}:' \
50             -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:' \
51             -e 's:@-PKGXMLDIR-@:${pkgxmldir}:' \
52             -e 's:@-PKGDOCDIR-@:${pkgdocdir}:' \
53             -e 's:@-PKGLOGDIR-@:${pkglogdir}:' \
54             -e 's:@-SHIRELOGDIR-@:${shirelogdir}:' \
55             -e 's:@-VARRUNDIR-@:${varrundir}:'
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-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status
69         $(MAKE) do-build-file FILE=$@
70
71 shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status
72         $(MAKE) do-build-file FILE=$@
73
74 shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status
75         $(MAKE) do-build-file FILE=$@
76
77 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
78         $(MAKE) do-build-file FILE=$@
79
80 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
81         $(MAKE) do-build-file FILE=$@
82
83 shibboleth.xml: ${srcdir}/shibboleth.xml.in Makefile ${top_builddir}/config.status
84         $(MAKE) do-build-file FILE=$@
85
86 AAP.xml: ${srcdir}/AAP.xml.in Makefile ${top_builddir}/config.status
87         $(MAKE) do-build-file FILE=$@
88
89 example-metadata.xml: ${srcdir}/example-metadata.xml.in Makefile ${top_builddir}/config.status
90         $(MAKE) do-build-file FILE=$@
91
92 all-data-local: $(BUILTCONFIGFILES)
93
94 install-data-local:     all-data-local
95         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
96         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
97         $(mkinstalldirs) $(DESTDIR)$(varrundir)
98         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
99         $(mkinstalldirs) $(DESTDIR)$(prefix)/data
100         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
101         for f in $(BUILTCONFIGFILES); do \
102                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
103                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
104                 fi; \
105                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
106         done
107         for f in $(CONFIGFILES); do \
108                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
109                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
110                 fi; \
111                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
112         done
113
114 CLEANFILES = \
115         apache.config \
116         apache2.config \
117         apache22.config \
118         shibd-redhat \
119         shibd-debian \
120         shibd-osx.plist \
121         shibd.logger \
122         native.logger \
123         shibboleth.xml \
124         AAP.xml \
125         example-metadata.xml
126
127 EXTRA_DIST = \
128         shibboleth.xml.in \
129         native.logger.in \
130         shibd.logger.in \
131         apache.config.in \
132         apache2.config.in \
133         apache22.config.in \
134         shibd-redhat.in \
135         shibd-debian.in \
136         shibd-osx.plist.in \
137         shibboleth.logger \
138         accessError.html \
139         rmError.html \
140         sessionError.html \
141         metadataError.html \
142         sslError.html \
143         AAP.xml.in \
144         example-metadata.xml.in \
145         sp-example.key \
146         sp-example.crt