SSPCPP-412 - systemd integration changes
[shibboleth/cpp-sp.git] / configs / Makefile.am
1 ## $Id$ 
2
3 AUTOMAKE_OPTIONS = foreign
4
5 pkglibdir = ${libdir}/@PACKAGE_NAME@
6 pkglogdir = ${localstatedir}/log/@PACKAGE_NAME@
7 shirelogdir = ${localstatedir}/log/@PACKAGE_NAME@-www
8 pkgxmldir = $(datadir)/xml/@PACKAGE_NAME@
9 pkgwebdir = $(datadir)/@PACKAGE_NAME@
10 pkgrundir = $(localstatedir)/run/@PACKAGE_NAME@
11 pkgcachedir = $(localstatedir)/cache/@PACKAGE_NAME@
12 pkgsysconfdir = $(sysconfdir)/@PACKAGE_NAME@
13 pkgsysconf_DATA = \
14         shibd-systemd \
15         shibd-redhat \
16         shibd-amazon \
17         shibd-suse \
18         shibd-debian \
19         shibd-osx.plist \
20         apache.config \
21         apache2.config \
22         apache22.config \
23         apache24.config \
24         keygen.sh \
25         metagen.sh \
26         upgrade.xsl
27
28 # The config files are installed "special".  Unlike the entries in
29 # pkgsysconf_DATA, these files are installed as "foo.dist" and only
30 # installed as "foo" if "foo" does not already exist.  In other words,
31 # the config files will not overwrite existing versions.
32 BUILTCONFIGFILES = \
33         native.logger \
34         shibd.logger
35
36 # While BUILTCONFIGFILES are processed, these are not; so we should pull
37 # them from SRCDIR.
38 CONFIGFILES = \
39         shibboleth2.xml \
40         attribute-map.xml \
41         attribute-policy.xml \
42         protocols.xml \
43         security-policy.xml \
44         example-metadata.xml \
45         example-shibboleth2.xml \
46         console.logger \
47         syslog.logger \
48         accessError.html \
49         attrChecker.html \
50         sessionError.html \
51         metadataError.html \
52         bindingTemplate.html \
53         discoveryTemplate.html \
54         postTemplate.html \
55         localLogout.html \
56         globalLogout.html \
57         partialLogout.html \
58         sslError.html
59
60 #
61 # Some of these need building
62 #
63 do-build-file:
64         rm -f ${FILE}.tmp
65         sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
66                 -e 's:@-PREFIX-@:${prefix}:g' \
67                 -e 's:@-PKGLIBDIR-@:${pkglibdir}:g' \
68                 -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
69                 -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
70                 -e 's:@-PKGWEBDIR-@:${pkgwebdir}:g' \
71                 -e 's:@-PKGLOGDIR-@:${pkglogdir}:g' \
72                 -e 's:@-SHIRELOGDIR-@:${shirelogdir}:g' \
73                 -e 's:@-PKGRUNDIR-@:${pkgrundir}:g' \
74                 -e 's:@-PKGCACHEDIR-@:${pkgcachedir}:g'
75         cmp -s ${FILE} ${FILE}.tmp || mv ${FILE}.tmp ${FILE}
76         rm -f ${FILE}.tmp
77
78 apache.config: ${srcdir}/apache.config.in Makefile ${top_builddir}/config.status
79         $(MAKE) do-build-file FILE=$@
80
81 apache2.config: ${srcdir}/apache2.config.in Makefile ${top_builddir}/config.status
82         $(MAKE) do-build-file FILE=$@
83
84 apache22.config: ${srcdir}/apache22.config.in Makefile ${top_builddir}/config.status
85         $(MAKE) do-build-file FILE=$@
86
87 apache24.config: ${srcdir}/apache24.config.in Makefile ${top_builddir}/config.status
88         $(MAKE) do-build-file FILE=$@
89
90 shibd-systemd: ${srcdir}/shibd-systemd.in Makefile ${top_builddir}/config.status
91         $(MAKE) do-build-file FILE=$@
92
93 shibd-redhat: ${srcdir}/shibd-redhat.in Makefile ${top_builddir}/config.status
94         $(MAKE) do-build-file FILE=$@
95
96 shibd-amazon: ${srcdir}/shibd-amazon.in Makefile ${top_builddir}/config.status
97         $(MAKE) do-build-file FILE=$@
98
99 shibd-suse: ${srcdir}/shibd-suse.in Makefile ${top_builddir}/config.status
100         $(MAKE) do-build-file FILE=$@
101
102 shibd-debian: ${srcdir}/shibd-debian.in Makefile ${top_builddir}/config.status
103         $(MAKE) do-build-file FILE=$@
104
105 shibd-osx.plist: ${srcdir}/shibd-osx.plist.in Makefile ${top_builddir}/config.status
106         $(MAKE) do-build-file FILE=$@
107
108 shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status
109         $(MAKE) do-build-file FILE=$@
110
111 native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status
112         $(MAKE) do-build-file FILE=$@
113
114 all-data-local: $(BUILTCONFIGFILES)
115
116 install-data-local:     all-data-local
117         $(mkinstalldirs) $(DESTDIR)$(pkglogdir)
118         $(mkinstalldirs) $(DESTDIR)$(shirelogdir)
119         $(mkinstalldirs) $(DESTDIR)$(pkgrundir)
120         $(mkinstalldirs) $(DESTDIR)$(pkgcachedir)
121         $(mkinstalldirs) $(DESTDIR)$(pkgxmldir)
122         $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
123         for f in $(BUILTCONFIGFILES); do \
124                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
125                         $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
126                 fi; \
127                 $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
128         done
129         for f in $(CONFIGFILES); do \
130                 if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
131                         $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}; \
132                 fi; \
133                 $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
134         done
135
136 install-data-hook:
137         chmod +x $(DESTDIR)$(pkgsysconfdir)/keygen.sh
138         chmod +x $(DESTDIR)$(pkgsysconfdir)/metagen.sh
139         if test -z "$(NOKEYGEN)"; then \
140                 cd $(DESTDIR)$(pkgsysconfdir); \
141                 sh ./keygen.sh -b ; \
142         fi
143
144 CLEANFILES = \
145         apache.config \
146         apache2.config \
147         apache22.config \
148         apache24.config \
149         shibd-systemd \
150         shibd-redhat \
151         shibd-amazon \
152         shibd-suse \
153         shibd-debian \
154         shibd-osx.plist \
155         shibd.logger \
156         native.logger
157
158 EXTRA_DIST = \
159         native.logger.in \
160         shibd.logger.in \
161         apache.config.in \
162         apache2.config.in \
163         apache22.config.in \
164         apache24.config.in \
165         shibd-systemd.in \
166         shibd-redhat.in \
167         shibd-amazon.in \
168         shibd-suse.in \
169         shibd-debian.in \
170         shibd-osx.plist.in \
171         keygen.bat \
172         keygen.sh \
173         metagen.sh \
174         SetService32.bat \
175         SetService64.bat \
176         upgrade.xsl \
177         xsltproc.js \
178         $(CONFIGFILES)