X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=squirrelmail-cn.git;a=blobdiff_plain;f=debian%2Fpostrm;h=0ff797d92218ee45cb88732da42c234bef7a5e99;hp=f86734080e2201209743cecbcf233c708cbf45b3;hb=HEAD;hpb=c27a02a6e5d0d09c40d14b6ed808d44fc5d25954 diff --git a/debian/postrm b/debian/postrm old mode 100644 new mode 100755 index f867340..0ff797d --- a/debian/postrm +++ b/debian/postrm @@ -2,21 +2,41 @@ set -e -case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - dpkg-divert --package squirrelmail-cn --remove --rename \ - --divert /usr/share/squirrelmail/functions/strings.php.squirrelmail \ +# Debconf +. /usr/share/debconf/confmodule + +PKG=squirrelmail-cn + +if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then + . /usr/share/apache2/apache2-maintscript-helper + + squirrelmail_enable() { + echo "CN: Purging $PKG configuration for Apache2." + return 0 + } +else + echo "CN: Could not load Apache 2.4 maintainer script helper." + + squirrelmail_enable() { + return 1 + } +fi + +if [ "$1" = "remove" -o "$1" = "abort-install" -o "$1" = "disappear" ]; then + dpkg-divert --package $PKG --remove --rename \ + --divert /usr/share/squirrelmail/functions/strings.php.squirrelmail \ /usr/share/squirrelmail/functions/strings.php - ;; +fi - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac +if [ "$1" = "purge" ] ; then + if squirrelmail_enable; then + apache2_invoke disconf $PKG + fi -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. + if [ "`readlink -q -m /etc/apache2/conf-available/$PKG.conf`" = /etc/squirrelmail/apache.conf ]; then + rm -f /etc/apache2/conf-available/$PKG.conf + fi +fi #DEBHELPER#