Merging config protection changes.
authorScott Cantor <cantor.2@osu.edu>
Tue, 2 Nov 2004 20:10:57 +0000 (20:10 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 2 Nov 2004 20:10:57 +0000 (20:10 +0000)
configs/Makefile.am
shibboleth.spec.in

index e5acfd0..abd9e40 100644 (file)
@@ -5,21 +5,27 @@ AUTOMAKE_OPTIONS = foreign
 logdir=${localstatedir}/log/shibboleth
 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
 pkgsysconf_DATA = \
+       apache.config \
+       apache2.config \
+       inqueue.pem
+
+# The config files are installed "special".  Unlike the entries in
+# pkgsysconf_DATA, these files are installed as "foo.dist" and only
+# installed as "foo" if "foo" does not already exist.  In other words,
+# the config files will not overwrite existing versions.
+CONFIGFILES = \
        shibboleth.xml \
        shibboleth.logger \
        shire.logger \
        shar.logger \
-       shar.key \
-       shar.crt \
-       apache.config \
-       apache2.config \
        accessError.html \
        rmError.html \
        shireError.html \
        AAP.xml \
        IQ-sites.xml \
        IQ-trust.xml \
-       inqueue.pem
+       shar.key \
+       shar.crt
 
 #
 # Some of these need building
@@ -49,9 +55,18 @@ shire.logger: ${srcdir}/shire.logger.in Makefile ${top_builddir}/config.status
 shibboleth.xml: ${srcdir}/shibboleth.xml.in Makefile ${top_builddir}/config.status
        $(MAKE) do-build-file FILE=$@
 
+all-data-local: $(CONFIGFILES)
+
 install-data-local:
        $(mkinstalldirs) $(DESTDIR)$(logdir)
        $(mkinstalldirs) $(DESTDIR)$(prefix)/data
+       $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
+       for f in $(CONFIGFILES); do \
+               if test ! -f $(DESTDIR)${pkgsysconfdir}/$$f; then \
+                       $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}; \
+               fi; \
+               $(INSTALL_DATA) $$f $(DESTDIR)${pkgsysconfdir}/$$f.dist; \
+        done
 
 CLEANFILES = \
        apache.config \
index 3f685bd..ee8e4af 100644 (file)
@@ -86,6 +86,7 @@ make check
 %config %{_sysconfdir}/shibboleth/inqueue.pem
 %config %{_sysconfdir}/shibboleth/shar.crt
 %config %{_sysconfdir}/shibboleth/shar.key
+%{_sysconfdir}/shibboleth/*.dist
 %{_sysconfdir}/shibboleth/apache*.config
 
 %exclude %{_bindir}/shibtest