From 941224cb685ca7fac3ef5c13d45795e0c67503f2 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Fri, 8 Nov 2013 13:07:20 +0100 Subject: [PATCH] Updated Debian packaging for 0.0.4 refs #4988 refs #4975 --- debian/changelog | 4 +-- debian/control | 24 +++++++++++--- debian/icinga2-classicui.config | 4 ++- debian/icinga2-classicui.lintian-overrides | 5 +++ debian/icinga2-common.icinga2.init | 37 ++++++++++++++++++---- debian/icinga2-ido-pgsql.install | 5 +++ debian/po/POTFILES.in | 1 + debian/rules | 28 +++++++--------- debian/source/options | 2 ++ 9 files changed, 79 insertions(+), 31 deletions(-) create mode 100644 debian/icinga2-classicui.lintian-overrides create mode 100644 debian/icinga2-ido-pgsql.install create mode 100644 debian/po/POTFILES.in create mode 100644 debian/source/options diff --git a/debian/changelog b/debian/changelog index 82064020f..e539ef217 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -icinga2 (0.0.3-0) UNRELEASED; urgency=low +icinga2 (0.0.3) UNRELEASED; urgency=low * Icinga2 Debian packaging for snapshots @@ -7,4 +7,4 @@ icinga2 (0.0.3-0) UNRELEASED; urgency=low *** is merely a technology preview and if you're planning to set up *** a production environment for Icinga you should use Icinga 1.x instead. - -- Markus Frosch Wed, 23 Oct 2013 17:41:03 +0200 + -- Markus Frosch Fri, 08 Nov 2013 13:39:03 +0100 diff --git a/debian/control b/debian/control index 2dd1a88e8..9b2509b4d 100644 --- a/debian/control +++ b/debian/control @@ -3,23 +3,22 @@ Section: admin Priority: extra Maintainer: Debian Nagios Maintainer Group Uploaders: Alexander Wirt , Markus Frosch -Build-Depends: automake, - autoconf, - autotools-dev, +Build-Depends: cmake (>= 2.8.9), + make (>= 3.81), bison, debhelper (>= 9), - dh-autoreconf, doxygen, flex, g++ (>= 1.96), libboost-dev, libboost-program-options-dev, - libboost-signals-dev, libboost-system-dev, libboost-test-dev, libboost-thread-dev, + libboost-regex-dev, libltdl-dev, libmysqlclient-dev, + libpq-dev, libssl-dev, libtool, po-debconf, @@ -101,3 +100,18 @@ Description: host and network monitoring system - IDO for MySQL . This package provides the IDO module for the MySQL database. +Package: icinga2-ido-pgsql +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: icinga2-common (= ${source:Version}), + icinga2-bin (= ${binary:Version}), + ${shlibs:Depends}, ${misc:Depends} +Recommends: postgresql-client +Suggests: postgresql +Description: host and network monitoring system - IDO for PostgreSQL + Icinga 2 is still in development and not ready for production use! + . + Better description to come. + . + This package provides the IDO module for the PostgreSQL database. + diff --git a/debian/icinga2-classicui.config b/debian/icinga2-classicui.config index 1931e0442..cc1f21d4a 100644 --- a/debian/icinga2-classicui.config +++ b/debian/icinga2-classicui.config @@ -1,4 +1,6 @@ -#!/bin/sh -e +#!/bin/sh + +set -e . /usr/share/debconf/confmodule diff --git a/debian/icinga2-classicui.lintian-overrides b/debian/icinga2-classicui.lintian-overrides new file mode 100644 index 000000000..a69ec2118 --- /dev/null +++ b/debian/icinga2-classicui.lintian-overrides @@ -0,0 +1,5 @@ +# ignoring apache2 warning +# this is actually not a problem, because the handling is backwards compatible +apache2-reverse-dependency-calls-invoke-rc.d postrm +apache2-reverse-dependency-calls-wrapper-script postinst a2enmod +apache2-reverse-dependency-calls-invoke-rc.d postinst diff --git a/debian/icinga2-common.icinga2.init b/debian/icinga2-common.icinga2.init index eca2ff278..e646b421c 100644 --- a/debian/icinga2-common.icinga2.init +++ b/debian/icinga2-common.icinga2.init @@ -37,14 +37,21 @@ SCRIPTNAME=/etc/init.d/$NAME # check run directory check_run () { - if [ ! -d '/var/run/icinga2' ]; - then - mkdir /var/run/icinga2 - chown nagios:nagios /var/run/icinga2 - chmod 0750 /var/run/icinga2 - fi + test -d '/var/run/icinga2' || mkdir /var/run/icinga2 + test -d '/var/run/icinga2/cmd' || mkdir /var/run/icinga2/cmd + + chown nagios:nagios /var/run/icinga2 + chmod 0755 /var/run/icinga2 + + chown nagios:www-data /var/run/icinga2/cmd + chmod 2710 /var/run/icinga2/cmd } +check_config () { + $DAEMON -C $DAEMON_ARGS +} + + # # Function that starts the daemon/service # @@ -107,6 +114,12 @@ check_run case "$1" in start) + log_action_msg "checking Icinga2 configuration" + if ! check_config; then + log_failure_msg "config test failed!" + log_end_msg 1 + fi + log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in @@ -126,11 +139,23 @@ case "$1" in status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; reload|force-reload) + log_action_msg "checking Icinga2 configuration" + if ! check_config; then + log_failure_msg "config test failed!" + log_end_msg 1 + fi + log_daemon_msg "Reloading $DESC" "$NAME" do_reload log_end_msg $? ;; restart) + log_action_msg "checking Icinga2 configuration" + if ! check_config; then + log_failure_msg "config test failed!" + log_end_msg 1 + fi + log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in diff --git a/debian/icinga2-ido-pgsql.install b/debian/icinga2-ido-pgsql.install new file mode 100644 index 000000000..e6c1a67f7 --- /dev/null +++ b/debian/icinga2-ido-pgsql.install @@ -0,0 +1,5 @@ +debian/tmp/etc/icinga2/features-available/ido-pgsql.conf +usr/lib/*/icinga2/libdb_ido_pgsql* +components/db_ido_pgsql/schema/*.sql usr/share/icinga2-ido-pgsql/schema +# for later +#components/db_ido_pgsql/schema/upgrades/*.sql usr/share/icinga2-ido-pgsql/schema/upgrades diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in new file mode 100644 index 000000000..9bcb83291 --- /dev/null +++ b/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] icinga2-classicui.templates diff --git a/debian/rules b/debian/rules index 3cc750393..6ddab95e8 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,9 @@ #!/usr/bin/make -f -#export DH_VERBOSE=1 - -export NOCONFIGURE=1 +export DH_VERBOSE=1 %: - dh $@ --with autotools-dev + dh $@ override_dh_auto_clean: dh_auto_clean @@ -13,23 +11,19 @@ override_dh_auto_clean: rm -f config.status override_dh_auto_configure: - ./autogen.sh - dh_auto_configure -- --enable-python \ - --with-icinga-user=root \ - --with-icinga-group=bin \ - --with-icingacmd-user=root \ - --with-icingacmd-group=bin - -override_dh_auto_install: - dh_auto_install - # cleanup dependencies in .la files - sed -i "/dependency_libs/ s/'.*'/''/" `find debian/tmp/ -name '*.la'` + dh_auto_configure -- \ + -DCMAKE_INSTALL_LOCALSTATEDIR=/var \ + -DCMAKE_INSTALL_SYSCONFDIR=/etc \ + -DICINGA2_USER=nagios \ + -DICINGA2_GROUP=nagios \ + -DICINGA2_COMMAND_USER=nagios \ + -DICINGA2_COMMAND_GROUP=www-data override_dh_install: dh_install # remove ido files from other packages - if [ -d debian/icinga2-common/ ]; then rm debian/icinga2-common/etc/icinga2/features-available/ido-mysql*; fi - rm debian/icinga2-bin/usr/lib/*/icinga2/libdb_ido_mysql* + if [ -d debian/icinga2-common/ ]; then rm debian/icinga2-common/etc/icinga2/features-available/ido-*; fi + rm debian/icinga2-bin/usr/lib/*/icinga2/libdb_ido_* override_dh_installinit: dh_installinit --name=icinga2 diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 000000000..411f04723 --- /dev/null +++ b/debian/source/options @@ -0,0 +1,2 @@ +tar-ignore = "obj-*-*" +tar-ignore = ".git"