From d94d5bd812f0fe1ceb0ed6cae2fdaff96627d273 Mon Sep 17 00:00:00 2001 From: jenkins-debian-glue Autobuilder Date: Fri, 20 May 2016 13:31:33 +0200 Subject: [PATCH] Imported Debian patch 0.9.6-1~netways70+1~preview+1+0~20160520113129.3+wheezy~1.gbp4d7db0 --- debian/README.Debian | 19 +++++++ debian/TODO | 8 +++ debian/bp-addon.conf | 16 ++++++ debian/changelog | 13 +++++ debian/compat | 1 + debian/control | 32 ++++++++++++ debian/copyright | 28 +++++++++++ debian/docs | 3 ++ debian/install | 1 + debian/lintian-overrides | 6 +++ debian/patches/00_destdir_fixes | 87 +++++++++++++++++++++++++++++++++ debian/patches/series | 1 + debian/postinst | 72 +++++++++++++++++++++++++++ debian/postrm | 38 ++++++++++++++ debian/rules | 60 +++++++++++++++++++++++ debian/source/format | 1 + debian/watch | 2 + 17 files changed, 388 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/TODO create mode 100644 debian/bp-addon.conf create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100644 debian/install create mode 100644 debian/lintian-overrides create mode 100644 debian/patches/00_destdir_fixes create mode 100644 debian/patches/series create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..fe5525b --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,19 @@ +nagios-business-process-addon for Debian +---------------------------------------- + +This package currently does not handle any auto configuration or integration. + +It is configured to use Icinga by default, use --no-install-recommends to use +it with another monitoring system. + +See following files to change paths or permissions: + * /etc/nagios-plugins/bp-addon/settings.cfg + * /etc/apache2/conf(.d|-available)/bp-addon.conf + +The check_bp_status plugin can be found here: + /usr/lib/nagios/plugins/check_bp_status.pl + +You still need to configure the NDO adapter: + /etc/nagios-plugins/bp-addon/ndo.cfg + + -- Markus Frosch Tue, 05 Aug 2014 13:58:04 +0200 diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..50830b1 --- /dev/null +++ b/debian/TODO @@ -0,0 +1,8 @@ +TODOs for Debian packaging +-------------------------- + +* currently only Icinga is supported + (can be changed by the user manually) +* auto configure ndo.cfg ? + + -- Markus Frosch Tue, 05 Aug 2014 13:45:55 +0200 diff --git a/debian/bp-addon.conf b/debian/bp-addon.conf new file mode 100644 index 0000000..9a5152e --- /dev/null +++ b/debian/bp-addon.conf @@ -0,0 +1,16 @@ +ScriptAlias /cgi-bin/bp-addon /usr/lib/cgi-bin/bp-addon + +Alias /bp-addon/stylesheets /etc/nagios-plugins/bp-addon/stylesheets +Alias /bp-addon /usr/share/bp-addon/htdocs + +RedirectMatch ^/bp-addon/?$ /cgi-bin/bp-addon/nagios-bp.cgi + + + AuthName "Icinga Access" + #AuthName "Nagios Access" + AuthType Basic + AuthUserFile /etc/icinga/htpasswd.users + #AuthUserFile /etc/nagios3/htpasswd.users + + Require valid-user + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..09a1e35 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,13 @@ +nagios-business-process-addon (0.9.6-1~netways70+1~preview+1+0~20160520113129.3+wheezy~1.gbp4d7db0) netways-wheezy; urgency=medium + + ** SNAPSHOT build @4d7db033303d3c28aa534ea3b611dc2de553c95a ** + + * UNRELEASED + + -- jenkins-debian-glue Autobuilder Fri, 20 May 2016 13:31:33 +0200 + +nagios-business-process-addon (0.9.6-1~netways70+1~preview+1) netways-wheezy; urgency=low + + * Initial release for NETWAYS Debian repository + + -- Markus Frosch Tue, 05 Aug 2014 14:09:32 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f009233 --- /dev/null +++ b/debian/control @@ -0,0 +1,32 @@ +Source: nagios-business-process-addon +Section: net +Priority: extra +Maintainer: Markus Frosch +Build-Depends: + debhelper (>= 9), + dh-autoreconf, + autotools-dev +Standards-Version: 3.9.5 +Homepage: http://bp-addon.monitoringexchange.org +Vcs-Git: git://git.netways.org/debian/nagios-business-process-addon.git +Vcs-Browser: https://git.netways.org/debian/nagios-business-process-addon + +Package: monitoring-plugin-business-process +Architecture: all +Depends: + adduser, + libcgi-simple-perl, + libjson-xs-perl, + libwww-perl, + monitoring-plugins-common | nagios-plugins-common, + perl, + ${misc:Depends}, + ${perl:Depends} +Recommends: icinga, apache2 | httpd +Description: Business Process monitoring for Icinga or Nagios + The Business Process AddOn takes results of individual Icinga or Nagios checks + and builds aggregated states from them. + . + How they are associated is described in one or more config files. + . + There is the possibility to make "and" conjuctions, "or" conjunction and more. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..791ef9c --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Nagios Business Process AddOn +Source: + +Files: * +Copyright: 2007-2010 Bernd Stroessenreuther +License: GPL-2+ + +Files: debian/* +Copyright: 2014 Markus Frosch +License: GPL-2+ + +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e942b15 --- /dev/null +++ b/debian/docs @@ -0,0 +1,3 @@ +AUTHORS +API-DOC +README diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..3673084 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +debian/bp-addon.conf etc/apache2/conf-available/ diff --git a/debian/lintian-overrides b/debian/lintian-overrides new file mode 100644 index 0000000..1ee87f7 --- /dev/null +++ b/debian/lintian-overrides @@ -0,0 +1,6 @@ +# 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-invoke-rc.d postinst + +non-standard-apache2-configuration-name diff --git a/debian/patches/00_destdir_fixes b/debian/patches/00_destdir_fixes new file mode 100644 index 0000000..ff9a2a2 --- /dev/null +++ b/debian/patches/00_destdir_fixes @@ -0,0 +1,87 @@ +Description: Fix missing DESTDIR in Makefiles +Author: Markus Frosch +Last-Update: 2014-08-01 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/share/lang/Makefile.in ++++ b/share/lang/Makefile.in +@@ -22,6 +22,6 @@ + devclean: distclean + + install: +- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DATADIR)/lang ++ $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(DATADIR)/lang + for file in ./*.txt; \ +- do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DATADIR)/lang; done ++ do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(DATADIR)/lang; done +--- a/libexec/Makefile.in ++++ b/libexec/Makefile.in +@@ -23,6 +23,6 @@ + devclean: distclean + + install: +- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(LIBEXECDIR) +- $(INSTALL) -m 755 $(INSTALL_OPTS) check_bp_status.pl $(LIBEXECDIR) ++ $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBEXECDIR) ++ $(INSTALL) -m 755 $(INSTALL_OPTS) check_bp_status.pl $(DESTDIR)$(LIBEXECDIR) + +--- a/bin/Makefile.in ++++ b/bin/Makefile.in +@@ -24,7 +24,7 @@ + devclean: distclean + + install: +- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(BINDIR) +- $(INSTALL) -m 755 $(INSTALL_OPTS) *.pl $(BINDIR) +- $(INSTALL) -m 755 $(INSTALL_OPTS) nagios_bp_session_timeout $(BINDIR) ++ $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR) ++ $(INSTALL) -m 755 $(INSTALL_OPTS) *.pl $(DESTDIR)$(BINDIR) ++ $(INSTALL) -m 755 $(INSTALL_OPTS) nagios_bp_session_timeout $(DESTDIR)$(BINDIR) + +--- a/share/Makefile.in ++++ b/share/Makefile.in +@@ -22,7 +22,7 @@ + devclean: distclean + + install: +- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DATADIR) ++ $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(DATADIR) + for file in ./*.gif; \ +- do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DATADIR); done ++ do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(DATADIR); done + +--- a/share/stylesheets/Makefile.in ++++ b/share/stylesheets/Makefile.in +@@ -23,7 +23,7 @@ + devclean: distclean + + install: +- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DATADIR)/stylesheets ++ $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(DATADIR)/stylesheets + for file in ./*.css; \ +- do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DATADIR)/stylesheets; done +- ${TOUCH} $(DATADIR)/stylesheets/user.css ++ do $(INSTALL) -m 664 $(INSTALL_OPTS) $$file $(DESTDIR)$(DATADIR)/stylesheets; done ++ ${TOUCH} $(DESTDIR)$(DATADIR)/stylesheets/user.css +--- a/var/cache/Makefile.in ++++ b/var/cache/Makefile.in +@@ -22,6 +22,6 @@ + devclean: distclean + + install: +- $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(LOGDIR)/cache +- $(INSTALL) -m 666 $(INSTALL_OPTS) ndo_backend_cache $(LOGDIR)/cache/ ++ $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LOGDIR)/cache ++ $(INSTALL) -m 666 $(INSTALL_OPTS) ndo_backend_cache $(DESTDIR)$(LOGDIR)/cache/ + +--- a/var/nagios_bp.sessions/Makefile.in ++++ b/var/nagios_bp.sessions/Makefile.in +@@ -22,6 +22,6 @@ + devclean: distclean + + install: +- $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(LOGDIR) +- $(INSTALL) -m 1777 $(INSTALL_OPTS) -d $(LOGDIR)/nagios_bp.sessions ++ $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LOGDIR) ++ $(INSTALL) -m 1777 $(INSTALL_OPTS) -d $(DESTDIR)$(LOGDIR)/nagios_bp.sessions + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..8f5703c --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +00_destdir_fixes diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..f3ab0a4 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,72 @@ +#!/bin/sh + +set -e + +setperm() { + user="$1" + group="$2" + mode="$3" + file="$4" + shift 4 + # only do something when no setting exists + if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then + chown "$user":"$group" "$file" + chmod "$mode" "$file" + fi +} + +case "$1" in + configure) + # Make sure user nagios exists + if ! getent passwd nagios > /dev/null ; then + echo 'Adding system-user for nagios' 1>&2 + adduser --system --group --home /var/lib/nagios \ + --disabled-login --force-badname nagios > /dev/null + fi + + # Apache2 handling + COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + + # NEW method for Apache >= 2.4 + if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then + . /usr/share/apache2/apache2-maintscript-helper + + apache2_invoke enmod cgi + apache2_invoke enconf bp-addon + + # remove OLD Apache 2.2 link + [ -L /etc/apache2/conf.d/bp-addon.conf ] && rm /etc/apache2/conf.d/bp-addon.conf + + # OLD methods for Apache < 2.4 + elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then + + # create symlink if not existing + [ -f /etc/apache2/conf.d/bp-addon.conf ] || \ + ln -vs /etc/apache2/conf-available/bp-addon.conf /etc/apache2/conf.d/bp-addon.conf + + if [ -f /etc/init.d/apache2 ] ; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d apache2 reload 3>/dev/null || true + else + /etc/init.d/apache2 reload 3>/dev/null || true + fi + fi + fi + + # setting cache permissions + setperm nagios nagios 0750 /var/cache/bp-addon + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..f164e6f --- /dev/null +++ b/debian/postrm @@ -0,0 +1,38 @@ +#!/bin/sh + +set -e + +case "$1" in + purge|remove) + + # Apache2 + if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then + echo "disabling Apache2 configuration ..." + . /usr/share/apache2/apache2-maintscript-helper + apache2_invoke disconf bp-addon ||true + fi + if [ -L /etc/apache2/conf.d/bp-addon.conf ]; then + echo "removing link /etc/apache2/conf.d/bp-addon.conf ..." + # remove link to config + rm -f /etc/apache2/conf.d/bp-addon.conf + # reload webserver + [ -x $(which invoke-rc.d) ] && invoke-rc.d apache2 reload || true + fi + + ;; + + 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. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..ca1c0fa --- /dev/null +++ b/debian/rules @@ -0,0 +1,60 @@ +#!/usr/bin/make -f + +#DH_VERBOSE = 1 + +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + +%: + dh $@ --with autotools-dev --with autoreconf + +B = debian/monitoring-plugin-business-process + +override_dh_auto_configure: + dh_auto_configure -- \ + --sysconfdir='/etc/nagios-plugins/bp-addon' \ + --bindir='/usr/lib/bp-addon/bin' \ + --sbindir='/usr/lib/cgi-bin/bp-addon' \ + --libdir='/usr/lib/bp-addon' \ + --libexecdir='/usr/lib/nagios/plugins' \ + --datadir='/usr/share/bp-addon/htdocs' \ + --datarootdir='/usr/share/bp-addon' \ + --localstatedir='/var/cache/bp-addon' \ + --with-cron-d-dir=/etc/cron.d \ + --with-cgiurl=/cgi-bin/bp-addon \ + --with-htmurl=/bp-addon \ + --with-apache-user=www-data \ + --with-httpd-conf=/etc/apache2/conf-available \ + --with-naghtmurl=/icinga \ + --with-nagcgiurl=/cgi-bin/icinga \ + --with-nagetc=/etc/icinga + +override_dh_auto_install: + dh_auto_install + # clean weird files in PREFIX + rm $B/usr/[A-Z]* + # move stylesheets to etc + mv $B/usr/share/bp-addon/htdocs/stylesheets $B/etc/nagios-plugins/bp-addon/ + # rename configs + mv $B/etc/nagios-plugins/bp-addon/nagios-bp.conf-sample \ + $B/etc/nagios-plugins/bp-addon/nagios-bp.conf + mv $B/etc/nagios-plugins/bp-addon/ndo.cfg-sample \ + $B/etc/nagios-plugins/bp-addon/ndo.cfg + # rename cron + mv $B/etc/cron.d/nagiosbp $B/etc/cron.d/bp-addon + # remove upstream apache config + rm $B/etc/apache2/conf-available/nagiosbp.conf + # clean trash in cache + rm -r $B/var/cache/bp-addon/* + +override_dh_auto_clean: + dh_auto_clean + rm -f \ + bin/nagios-bp-check-ndo-connection.pl \ + bin/nagios_bp_session_timeout \ + etc/apache-conf.d/nagiosbp.conf \ + etc/cron.d/nagiosbp \ + etc/ndo.cfg-sample \ + etc/settings.cfg + +# vi: noexpandtab : diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..5ec48c5 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://bp-addon.monitoringexchange.org/download.shtml .*/nagios-business-process-addon-(.*)\.tar\.gz