diff --git a/packaging/debian/rules b/packaging/debian/rules index d09f6cc6d..5c6729d6f 100755 --- a/packaging/debian/rules +++ b/packaging/debian/rules @@ -80,7 +80,7 @@ install-arch: build-arch install -D -m 644 Scripts/sogo-default debian/tmp/etc/default/sogo install -D -m 644 debian/sogo.overrides debian/tmp/usr/share/lintian/overrides/sogo - install -D -m 644 Apache/SOGo.conf debian/tmp/etc/apache2/conf.d/SOGo.conf + install -D -m 644 Apache/SOGo.conf debian/tmp/etc/apache2/conf-available/SOGo.conf install -D -m 644 Scripts/sogo.cron debian/tmp/etc/cron.d/sogo install -D -m 644 Scripts/logrotate debian/tmp/etc/logrotate.d/sogo install -d -m 750 debian/tmp/etc/sogo diff --git a/packaging/debian/sogo.install b/packaging/debian/sogo.install index ba044b824..e6de0eda6 100644 --- a/packaging/debian/sogo.install +++ b/packaging/debian/sogo.install @@ -1,4 +1,4 @@ -etc/apache2/conf.d/SOGo.conf +etc/apache2/conf-available/SOGo.conf etc/cron.d/sogo etc/default/sogo etc/logrotate.d/sogo diff --git a/packaging/debian/sogo.postinst b/packaging/debian/sogo.postinst index 82cfa7d4e..cb988a921 100644 --- a/packaging/debian/sogo.postinst +++ b/packaging/debian/sogo.postinst @@ -26,6 +26,18 @@ case "$1" in chown root:sogo /etc/sogo chmod 640 /etc/sogo/sogo.conf chown root:sogo /etc/sogo/sogo.conf + + # Apache 2.2 / 2.4 kungfu + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke enconf SOGo || exit $? + elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + if [ -d /etc/apache2/conf.d/ -a ! -L /etc/apache2/conf.d/SOGo.conf ]; then + ln -s ../conf-available/SOGo.conf /etc/apache2/conf.d/SOGo.conf + fi + fi ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/packaging/debian/sogo.prerm b/packaging/debian/sogo.prerm index 914a28b5e..7d304833a 100644 --- a/packaging/debian/sogo.prerm +++ b/packaging/debian/sogo.prerm @@ -13,5 +13,14 @@ set -e # for details, see /usr/share/doc/packaging-manual/ #DEBHELPER# +if [ "$1" = "deconfigure" ] ; then + # Apache 2.2 / 2.4 kungfu + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + + if [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + [ ! -L /etc/apache2/conf.d/SOGo.conf ] || rm /etc/apache2/conf.d/SOGo.conf + fi + +fi exit 0