From: warlord Date: Mon, 1 Nov 2004 16:18:50 +0000 (+0000) Subject: Don't overwrite config-files on install. X-Git-Tag: 2.4~1724 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fsp.git;a=commitdiff_plain;h=9d7b551b5a669e0919b2b86253660ff1754af736 Don't overwrite config-files on install. 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 --- diff --git a/configs/Makefile.am b/configs/Makefile.am index e5acfd0..27f6c21 100644 --- a/configs/Makefile.am +++ b/configs/Makefile.am @@ -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 \ diff --git a/shibboleth.spec.in b/shibboleth.spec.in index 3f685bd..ee8e4af 100644 --- a/shibboleth.spec.in +++ b/shibboleth.spec.in @@ -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