]> git.decadent.org.uk Git - memories.git/blobdiff - debian/memories.postinst
Remove installation of Apache config fragment from rules.
[memories.git] / debian / memories.postinst
diff --git a/debian/memories.postinst b/debian/memories.postinst
new file mode 100755 (executable)
index 0000000..5393e1b
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+if [ "x$1" = xconfigure ]; then
+
+    # Install our configuration fragment and make Apache load it
+    # (and unload any code from a previous version of Memories).
+    # Check whether mod_perl is enabled first.
+    for server in apache apache-perl apache-ssl; do
+        if [ "$(apache-modconf $server query mod_perl 2>/dev/null)" \
+                 = "mod_perl" -a \
+             \! -e /etc/$server/conf.d/memories ]; then
+            ln -s ../../memories/apache.conf /etc/$server/conf.d/memories
+            invoke-rc.d $server force-reload
+        fi
+    done
+    # Module configuration is different in the apache2 package.
+    if [ -e /etc/apache2/mods-enabled/perl.load -a \
+         \! -e /etc/apache2/conf.d/memories ]; then
+        ln -s ../../memories/apache.conf /etc/apache2/conf.d/memories
+        invoke-rc.d apache2 force-reload
+    fi
+
+fi