From 3ea4bad5df55eeaf1df19ffccf63466f94df0717 Mon Sep 17 00:00:00 2001 From: tolimar Date: Mon, 26 Sep 2011 13:24:35 +0000 Subject: [PATCH] Rework package configuration git-svn-id: svn://svn.debian.org/svn/pkg-nagios/nagvis/trunk@1968 98d490a6-b407-0410-aaaa-fdee166ba3f5 --- debian/changelog | 3 ++- debian/config | 16 ++-------------- debian/postinst | 10 +++------- debian/postrm | 50 ++++++++++-------------------------------------- debian/templates | 13 +++++++++++++ 5 files changed, 30 insertions(+), 62 deletions(-) create mode 100644 debian/templates diff --git a/debian/changelog b/debian/changelog index 747a247..a58a856 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,9 @@ nagvis (1:1.5.10-1) UNRELEASED; urgency=low * Update package description: Now also works with Icinga * Change Package dependencies: Drop all ndo and mysql related stuff, we want to use mk livestatus * Update debian/copyright + * Rework post{inst,rm} to not configure database - -- Alexander Reichle-Schmehl Wed, 07 Sep 2011 16:59:51 +0200 + -- Alexander Reichle-Schmehl Mon, 26 Sep 2011 15:23:50 +0200 nagvis (1:1.4.6-2) unstable; urgency=medium diff --git a/debian/config b/debian/config index d405a8b..d3d7ea7 100644 --- a/debian/config +++ b/debian/config @@ -3,19 +3,7 @@ set -e . /usr/share/debconf/confmodule -tmp=`mktemp` +db_input high nagvis/monitoring_system || true +db_go || true -if [ -f /etc/dbconfig-common/ndoutils-mysql.conf ] ; then - dbconfig-load-include -f sh \ - -udbc_dbuser -pdbc_dbpass -ddbc_dbname -sdbc_dbserver -Pdbc_dbport \ - /etc/dbconfig-common/ndoutils-mysql.conf > $tmp - . $tmp - if [ -f /usr/share/dbconfig-common/dpkg/frontend.config.mysql ]; then - . /usr/share/dbconfig-common/dpkg/frontend.config.mysql - dbc_go nagvis $@ - fi - db_stop -fi - -rm -f $tmp diff --git a/debian/postinst b/debian/postinst index 925277a..0a2093c 100644 --- a/debian/postinst +++ b/debian/postinst @@ -6,13 +6,6 @@ set -e . /usr/share/debconf/confmodule -if [ -f /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql ]; then - . /usr/share/dbconfig-common/dpkg/frontend.postinst.mysql - dbc_generate_include='template:/etc/nagvis/nagvis.ini.php' - dbc_generate_include_owner='www-data:www-data' - dbc_generate_include_args='--ucf -C\; -o template_infile=/usr/share/nagvis/debian/nagvis.ini.php-sample' - dbc_go nagvis $@ -fi # summary of how this script can be called: # * `configure' @@ -58,6 +51,9 @@ case "$1" in # ln -s /etc/nagvis/apache.conf /etc/apache2/conf.d/nagvis.conf #fi + monitoring=$(db_get nagvis/monitoring_system) + echo "Will configure nagvis to use $monitoring" + ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/postrm b/debian/postrm index 1615814..f1a1079 100644 --- a/debian/postrm +++ b/debian/postrm @@ -5,54 +5,24 @@ set -e -if [ -f /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule -fi - -if [ -f /usr/share/dbconfig-common/dpkg/postrm.mysql ]; then - . /usr/share/dbconfig-common/dpkg/frontend.postrm.mysql - dbc_go nagvis $@ -fi - -# summary of how this script can be called: -# * `remove' -# * `purge' -# * `upgrade' -# * `failed-upgrade' -# * `abort-install' -# * `abort-install' -# * `abort-upgrade' -# * `disappear' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -if [ "$1" = "purge" ]; then + purge) for file in apache.conf nagvis.ini.php; do rm -f /etc/nagvis/$file if [ -x /usr/bin/ucf ] ; then ucf --debconf-ok --purge /etc/nagvis/$file fi done - - #if [ -e /etc/apache2/conf.d/nagvis.conf ]; then - # rm -f /etc/apache2/conf.d/nagvis.conf - #fi - rm -rf /var/cache/nagvis -fi - + ;; + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..13c4d6e --- /dev/null +++ b/debian/templates @@ -0,0 +1,13 @@ +Template: nagvis/monitoring_system +Type: select +Default: icinga +Choices: icinga, nagios, other +Description: For which monitoring suite should NagVis be configured? + This NagVis package supports the monitoring suites Icinga as well as + well as Nagios out of the box. Choose them, if you have them locally + installed and would like to use check-mk-livestatus. + . + If you would like to use NagVis with a different backend or a different + monitoring suite, please choose "other". You'll have to configure it + manually. + -- 2.30.2