Create a symlink rather than a file in /etc/apache2/conf.d
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 22 Aug 2007 13:25:55 +0000 (13:25 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 22 Aug 2007 13:25:55 +0000 (13:25 +0000)
debian/changelog
debian/pazpar2-apache2.dirs
debian/pazpar2-apache2.postinst
debian/pazpar2-apache2.postrm [new file with mode: 0644]
debian/rules

index e281c58..71be647 100644 (file)
@@ -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 <adam@indexdata.dk>  Wed, 22 Aug 2007 15:24:54 +0200
+
 pazpar2 (1.0.2-4) unstable; urgency=low
 
   * Upstream.
index 338e535..2d84145 100644 (file)
@@ -1 +1 @@
-etc/apache2/conf.d
+etc/pazpar2
index 62d861e..6c4f18b 100644 (file)
@@ -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 (file)
index 0000000..9b8456e
--- /dev/null
@@ -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
+
index 576b531..32fb674 100755 (executable)
@@ -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/