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