[Pkg-nagios-changes] [SCM] Debian packaging of icinga-web branch, master, updated. debian/1.9.0+dfsg1-1-8-g4d8b05d
Markus Frosch
markus at lazyfrosch.de
Mon Jun 24 09:55:21 UTC 2013
The following commit has been merged in the master branch:
commit d3bd7105d353f8caeaad82e77e22e7a0897984ab
Author: Markus Frosch <markus at lazyfrosch.de>
Date: Mon Jun 24 11:19:44 2013 +0200
Added support for Apache 2.4 config integration
diff --git a/debian/icinga-web.links b/debian/icinga-web.links
index 746fc27..fd0c9eb 100644
--- a/debian/icinga-web.links
+++ b/debian/icinga-web.links
@@ -1 +1,2 @@
usr/share/doc/icinga-web/CHANGELOG-1.9 usr/share/doc/icinga-web/changelog
+etc/icinga-web/apache2.conf etc/apache2/conf-available/icinga-web.conf
diff --git a/debian/icinga-web.postinst b/debian/icinga-web.postinst
index 530244f..6c66ead 100644
--- a/debian/icinga-web.postinst
+++ b/debian/icinga-web.postinst
@@ -73,19 +73,35 @@ generate_dbxml /etc/icinga-web/conf.d/database-ido.xml \
# Apache2
###
-if [ "$1" = "configure" ] && [ -x "/usr/sbin/apache2" ]; then
+if [ "$1" = "configure" ]; then
echo "enabling Apache2 config..."
- # enable mod rewrite
- [ -f /etc/apache2/mods-enabled/rewrite.load ] || a2enmod rewrite
+ COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
- # create symlink if not existing
- [ -f /etc/apache2/conf.d/icinga-web.conf ] || ln -vs ../../icinga-web/apache2.conf /etc/apache2/conf.d/icinga-web.conf
+ # NEW method for Apache >= 2.4
+ if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
+ . /usr/share/apache2/apache2-maintscript-helper
- # reload webserver
- [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload
+ apache2_invoke enmod rewrite
+ apache2_invoke enconf icinga-web
+
+ # remove OLD Apache 2.2 link
+ [ -L /etc/apache2/conf.d/icinga-web.conf ] && rm /etc/apache2/conf.d/icinga-web.conf
+
+ # OLD methods for Apache < 2.4
+ elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
+ # enable mod rewrite
+ [ -f /etc/apache2/mods-enabled/rewrite.load ] || a2enmod rewrite
+
+ # create symlink if not existing
+ [ -f /etc/apache2/conf.d/icinga-web.conf ] || ln -vs ../../icinga-web/apache2.conf /etc/apache2/conf.d/icinga-web.conf
+
+ # reload webserver
+ [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload
+ fi
fi
+
###
# Set root password in database
###
diff --git a/debian/icinga-web.postrm b/debian/icinga-web.postrm
index 0b83990..cd146fc 100644
--- a/debian/icinga-web.postrm
+++ b/debian/icinga-web.postrm
@@ -18,6 +18,11 @@ fi
###
# Apache2
+if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
+ echo "disabling Apache2 configuration ..."
+ . /usr/share/apache2/apache2-maintscript-helper
+ apache2_invoke disconf icinga-web
+fi
if [ -L /etc/apache2/conf.d/icinga-web.conf ]; then
echo "removing link /etc/apache2/conf.d/icinga-web.conf ..."
# remove link to config
--
Debian packaging of icinga-web
More information about the Pkg-nagios-changes
mailing list