From d72e91e08e0cc24224d9685cf8978e2f3697b59e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 22 Aug 2007 13:25:55 +0000 Subject: [PATCH] Create a symlink rather than a file in /etc/apache2/conf.d --- debian/changelog | 6 ++++++ debian/pazpar2-apache2.dirs | 2 +- debian/pazpar2-apache2.postinst | 8 ++++++++ debian/pazpar2-apache2.postrm | 32 ++++++++++++++++++++++++++++++++ debian/rules | 5 +++-- 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 debian/pazpar2-apache2.postrm diff --git a/debian/changelog b/debian/changelog index e281c58..71be647 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pazpar2 (1.0.2-5) unstable; urgency=low + + * Create a symlink rather than a file in /etc/apache2/conf.d . + + -- Adam Dickmeiss Wed, 22 Aug 2007 15:24:54 +0200 + pazpar2 (1.0.2-4) unstable; urgency=low * Upstream. diff --git a/debian/pazpar2-apache2.dirs b/debian/pazpar2-apache2.dirs index 338e535..2d84145 100644 --- a/debian/pazpar2-apache2.dirs +++ b/debian/pazpar2-apache2.dirs @@ -1 +1 @@ -etc/apache2/conf.d +etc/pazpar2 diff --git a/debian/pazpar2-apache2.postinst b/debian/pazpar2-apache2.postinst index 62d861e..6c4f18b 100644 --- a/debian/pazpar2-apache2.postinst +++ b/debian/pazpar2-apache2.postinst @@ -18,6 +18,14 @@ if [ -e /etc/apache2/apache2.conf ]; then if [ ! -f /etc/apache2/mods-enabled/proxy_http.load ]; then a2enmod proxy_http || true fi + + if [ -d /etc/apache2/conf.d ]; then + ln -sf /etc/pazpar2/ap2pazpar2.cfg /etc/apache2/conf.d/pazpar2 + + if [ -f /etc/apache2/conf.d/ap2pazpar2.cfg ]; then + rm /etc/apache2/conf.d/ap2pazpar2.cfg + fi + fi reload_apache fi diff --git a/debian/pazpar2-apache2.postrm b/debian/pazpar2-apache2.postrm new file mode 100644 index 0000000..9b8456e --- /dev/null +++ b/debian/pazpar2-apache2.postrm @@ -0,0 +1,32 @@ +#!/bin/sh -e + +case "$1" in + purge|remove) + WEBSERVERS="apache2" + for apache in $WEBSERVERS; do + if [ -f "/etc/$apache/conf.d/pazpar2" ]; then + echo "Removing pazpar2 configuration file for $apache.." + rm -f /etc/$apache/conf.d/pazpar2 + if [ -f "/var/run/$apache.pid" ]; then + invoke-rc.d $apache reload + fi + fi + done + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 +esac + + + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + diff --git a/debian/rules b/debian/rules index 576b531..32fb674 100755 --- a/debian/rules +++ b/debian/rules @@ -77,13 +77,14 @@ binary-arch: build install dh_installchangelogs NEWS # pazpar2-doc package mv $(CURDIR)/debian/pazpar2/usr/share/doc/pazpar2/* $(CURDIR)/debian/pazpar2-doc/usr/share/doc/pazpar2-doc - # pazpar2-apache2 package + # pazpar2 package cp $(CURDIR)/etc/pazpar2.cfg.dist $(CURDIR)/debian/pazpar2/etc/pazpar2/pazpar2.cfg patch $(CURDIR)/debian/pazpar2/etc/pazpar2/pazpar2.cfg $(CURDIR)/debian/cfg.patch cp etc/settings/*.xml $(CURDIR)/debian/pazpar2/etc/pazpar2/settings/ cp etc/*.xml $(CURDIR)/debian/pazpar2/etc/pazpar2/settings/ cp etc/*.xsl $(CURDIR)/debian/pazpar2/etc/pazpar2/ - cp $(CURDIR)/debian/ap2pazpar2.cfg $(CURDIR)/debian/pazpar2-apache2/etc/apache2/conf.d + # pazpar2-apache2 package + cp $(CURDIR)/debian/ap2pazpar2.cfg $(CURDIR)/debian/pazpar2-apache2/etc/pazpar2 # pazpar2-test1 package cp www/test1/index.html $(CURDIR)/debian/pazpar2-test1/usr/share/pazpar2/test1/ cp www/test1/search.js $(CURDIR)/debian/pazpar2-test1/usr/share/pazpar2/test1/ -- 1.7.10.4