Don't overwrite config-files on install.
authorwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 1 Nov 2004 16:18:50 +0000 (16:18 +0000)
committerwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Mon, 1 Nov 2004 16:18:50 +0000 (16:18 +0000)
Fix spec to handle new ".dist" config files.
Note: some files are overwritten, some are not.  We can choose which in
configs/Makefile.

git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@1252 cb58f699-b61c-0410-a6fe-9272a202ed29

configs/Makefile.am
shibboleth.spec.in

index e5acfd0..27f6c21 100644 (file)
@@ -5,22 +5,28 @@ AUTOMAKE_OPTIONS = foreign
 logdir=${localstatedir}/log/shibboleth
 pkgsysconfdir = $(sysconfdir)/@PACKAGE@
 pkgsysconf_DATA = \
-       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
 
+# 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 \
+       accessError.html \
+       rmError.html \
+       shireError.html
+
 #
 # 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