Enable more modules, clean up postinst
authorClinton Ebadi <clinton@unknownlamer.org>
Sat, 8 Sep 2012 05:58:11 +0000 (01:58 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sat, 8 Sep 2012 05:58:11 +0000 (01:58 -0400)
* Quick factoring of postinst/preinst now that we have more than two
  modules
* Depend on suphp/suexec
* Enable more required apache modules

debian/control
debian/hcoop-apache2-config.postinst
debian/hcoop-apache2-config.postrm

index 2c6822a..b4826f9 100644 (file)
@@ -10,7 +10,8 @@ Homepage: http://hcoop.net
 
 Package: hcoop-apache2-config
 Architecture: all
 
 Package: hcoop-apache2-config
 Architecture: all
-Depends: libapache2-mod-waklog, apache2-mpm-prefork, apache2.2-common, ${misc:Depends}
+Depends: libapache2-mod-waklog, apache2-mpm-prefork, apache2.2-common,
+ apache2-suexec-custom, libapache2-mod-suphp, ${misc:Depends}
 Description: Configuration for HCoop/Domtool Apache
  Configuration bits required for apache to operate as a user web node
  controlled by domtool.
 Description: Configuration for HCoop/Domtool Apache
  Configuration bits required for apache to operate as a user web node
  controlled by domtool.
index 9c51bc3..d402d47 100644 (file)
@@ -18,19 +18,25 @@ set -e
 # the debian-policy package
 
 
 # the debian-policy package
 
 
+HCOOP_APACHE_MODULES="dav dav_fs dav_lock rewrite suexec suphp waklog"
+
 case "$1" in
     configure)
 case "$1" in
     configure)
+
        # Redundantly enable on upgrades in case some new modules were
        # enabled
        # Redundantly enable on upgrades in case some new modules were
        # enabled
-       a2enmod -q waklog
-       a2enmod -q dav
-       a2enmod -q dav_fs
-       a2enmod -q dav_lock
-
-       if [ -e "/etc/apache2/mods-enabled/waklog.load" ] && \
-          [ -e "/etc/apache2/mods-enabled/dav.load" ] && \
-          [ -e "/etc/apache2/mods-enabled/dav_fs.load" ] && \
-          [ -e "/etc/apache2/mods-enabled/dav_lock.load" ]; then
+       for mod in $HCOOP_APACHE_MODULES; do
+           a2enmod -q $mod
+       done
+       
+       HCOOP_ENABLE_FAILED=0
+       for mod in $HCOOP_APACHE_MODULES; do
+           if [ ! -e "/etc/apache2/modules-enabled/${mod}.conf" ]; then
+               HCOOP_ENABLED_FAILED=1
+           fi
+       done
+
+       if [ ! $HCOOP_ENABLE_FAILED ]; then
            invoke-rc.d apache2 restart
        fi
     ;;
            invoke-rc.d apache2 restart
        fi
     ;;
index 2c2c923..ee024b9 100644 (file)
@@ -17,12 +17,14 @@ set -e
 # the debian-policy package
 
 
 # the debian-policy package
 
 
+HCOOP_APACHE_MODULES="dav dav_fs dav_lock rewrite suexec suphp waklog"
+
 case "$1" in
     remove|purge)
 case "$1" in
     remove|purge)
-       a2dismod -q -f waklog || true
-       a2dismod -q -f dav || true
-       a2dismod -q -f dav_fs || true
-       a2dismod -q -f dav_lock || true
+       for mod in $HCOOP_APACHE_MODULES; do
+           a2dismod -q -f $mod || true
+       done
+
 #      invoke-rc.d apache2 restart
     ;;
 
 #      invoke-rc.d apache2 restart
     ;;