]> git.decadent.org.uk Git - memories.git/commitdiff
Enabled integration with Apache 2, conditional on mod_apreq and mod_perl being enabled.
authorBen Hutchings <ben@decadent.org.uk>
Sun, 16 Sep 2007 23:47:37 +0000 (23:47 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 4 Nov 2008 04:14:15 +0000 (04:14 +0000)
Disabled integration with Apache 1.x.

debian/memories.postinst

index 1d9ef95c2d1852065ace17d2eb2e45b7df8c52e8..1d32509e0884da70265d866630020cfa466884af 100755 (executable)
@@ -4,22 +4,26 @@
 
 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
+    # If mod_perl and mod_apreq are installed, ensure our configuration
+    # fragment is installed and make Apache (re)load the configuration
+    # and application.
+    if [ -e /etc/apache2/mods-enabled/perl.load -a \
+        -e /etc/apache2/mods-enabled/apreq.load -a \
+         -f /usr/share/perl5/Apache2/Upload.pm ]; then
+       if [ \! -e /etc/apache2/conf.d/memories ]; then
+            ln -s ../../memories/apache.conf /etc/apache2/conf.d/memories
         fi
-    done
-
-    # Disable currently broken integration with Apache 2
-    if [ -L /etc/apache2/conf.d/memories ]; then
-        rm /etc/apache2/conf.d/memories
         invoke-rc.d apache2 force-reload
     fi
 
+    # Disable integration with now-unsupported Apache 1.x.
+    for server in apache apache-perl apache-ssl; do
+        if [ -L /etc/$server/conf.d/memories ]; then
+            rm /etc/$server/conf.d/memories
+            if [ -f /etc/init.d/$server ]; then
+                 invoke-rc.d $server force-reload
+            fi
+        fi
+    done
+
 fi