[Pkg-nagios-changes] [pkg-nagios-plugins] 270/413: move dependend libraries to recommanded once

Jan Wagner waja at moszumanska.debian.org
Tue Nov 26 23:13:31 UTC 2013


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository pkg-nagios-plugins.

commit 526aade2282da8834e8677160675d362575b2393
Author: Jan Wagner <waja at cyconet.org>
Date:   Sun Feb 13 22:20:06 2011 +0000

    move dependend libraries to recommanded once
---
 debian/NEWS.Debian                                 |   8 ++
 ...DME.Debian.plugins => README.Debian.plugins.in} |   2 +
 debian/bin/gen_plugin_deps.pl                      | 106 +++++++++++++++++++++
 debian/changelog                                   |  10 ++
 debian/control                                     |   4 +-
 debian/rules                                       |  13 ++-
 6 files changed, 139 insertions(+), 4 deletions(-)

diff --git a/debian/NEWS.Debian b/debian/NEWS.Debian
index bad2c7b..c01d540 100644
--- a/debian/NEWS.Debian
+++ b/debian/NEWS.Debian
@@ -1,3 +1,11 @@
+nagios-plugins (1.4.15-4) unstable; urgency=low
+
+  Moved linked libraries against nagios-plugins-standard from Depends to
+  Recommends and mention them in
+  /usr/share/doc/nagios-plugins-standard/README.Debian.plugins.
+
+ -- Jan Wagner <waja at cyconet.org>  Sun, 13 Feb 2011 22:51:54 +0100
+
 nagios-plugins (1.4.14-2) unstable; urgency=low
 
   Moved check_mailq to nagios-plugins-standard, because it requires the mailq
diff --git a/debian/README.Debian.plugins b/debian/README.Debian.plugins.in
similarity index 98%
rename from debian/README.Debian.plugins
rename to debian/README.Debian.plugins.in
index 3d1a3fa..482c1cb 100644
--- a/debian/README.Debian.plugins
+++ b/debian/README.Debian.plugins.in
@@ -53,3 +53,5 @@ check_oracle:
 
 check_wave:
   * snmp
+
+ at PLUGIN_DEPS@
diff --git a/debian/bin/gen_plugin_deps.pl b/debian/bin/gen_plugin_deps.pl
new file mode 100644
index 0000000..8771870
--- /dev/null
+++ b/debian/bin/gen_plugin_deps.pl
@@ -0,0 +1,106 @@
+#! /usr/bin/perl
+#
+# collectd - gen_plugin_deps.pl
+# Copyright (C) 2007 Sebastian Harl
+#
+# This program 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; only version 2 of the License is applicable.
+#
+# This program 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, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+#
+# Author:
+#   Sebastian Harl <sh at tokkee.org>
+
+use strict;
+use warnings;
+
+# actual not needed
+#my $extra_deps = {
+#	sensors => [ 'lm-sensors' ],
+#};
+
+my $infile  = "debian/README.Debian.plugins.in";
+my $outfile = "debian/README.Debian.plugins";
+
+my ($ifile, $ofile);
+
+if (! open($ifile, "<", $infile)) {
+	print STDERR "Could not open file '$infile': $!\n";
+	exit 1;
+}
+
+if (! open($ofile, ">", $outfile)) {
+	print STDERR "Could not open file '$outfile': $!\n";
+	exit 1;
+}
+
+while (my $line = <$ifile>) {
+	if ($line !~ m/^\@PLUGIN_DEPS\@\n$/) {
+		print $ofile $line;
+	}
+	else {
+		print_plugin_deps($ofile);
+	}
+}
+
+close($ofile);
+close($ifile);
+
+sub print_plugin_deps
+{
+	my $fh   = shift;
+	my $pdir = undef;
+	my $i    = 0;
+
+	my $plugindir = "debian/nagios-plugins-standard/usr/lib/nagios/plugins/";
+
+	if (! opendir($pdir, $plugindir)) {
+		print STDERR "Could not open directory '$plugindir': $!\n";
+		exit 1;
+	}
+
+	foreach my $dirent (sort readdir($pdir)) {
+#		if ($dirent !~ m/^(\w+).so$/) {
+		if ($dirent !~ m/^check_(\w+)$/) {
+			next;
+		}
+
+		my $name = $1;
+		my $deps = `dpkg-shlibdeps -O $plugindir/$dirent`;
+
+		chomp $deps;
+
+		$deps =~ s/^shlibs:Depends=//;
+
+		my @deps = grep !m/^libc6\b/, split m/, /, $deps;
+
+		if (scalar @deps) {
+			if (0 < $i) {
+				print $fh "\n";
+			}
+
+			++$i;
+
+			print $fh "check_$name:\n";
+
+			if (defined $extra_deps->{$name}) {
+				unshift @deps, @{$extra_deps->{$name}};
+			}
+
+			foreach my $dep (@deps) {
+				print $fh "  * $dep\n";
+			}
+		}
+	}
+}
+
+# vim: set tw=78 sw=4 ts=4 noexpandtab :
+
diff --git a/debian/changelog b/debian/changelog
index cf96643..262d67c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,16 @@ nagios-plugins (1.4.15-4) UNRELEASED; urgency=low
     - Abort immediately if we don't receive a server greeting or if the
       greeting doesn't contain the "--expect"ed string (by default: "220")
       instead of blindly sending the EHLO/HELO line.
+  * Move libraries linked at compile time against checks of
+    nagios-plugins-standard from Depends to Recommends (Closes: #569028)
+    - Add slightly modified bin/gen_plugin_deps.pl from collectd source package
+    - Add linked libraries via bin/gen_plugin_deps.pl into
+      /usr/share/doc/nagios-plugins-standard/README.Debian.plugins
+    - Build-Depend on perl
+    - Create customized substvars for nagios-plugins-standard via
+      dpkg-shlibdeps in debian/rules
+    - Remove temporary files via clean target in debian/rules
+    - Add hint to NEWS.DebianAdd hint to NEWS.Debia
 
  -- Jan Wagner <waja at cyconet.org>  Mon, 27 Dec 2010 22:13:48 +0100
 
diff --git a/debian/control b/debian/control
index 69d873f..762e015 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: net
 Priority: extra
 Maintainer: Debian Nagios Maintainer Group <pkg-nagios-devel at lists.alioth.debian.org>
 Uploaders: Jan Wagner <waja at cyconet.org>, Alexander Wirt <formorer at debian.org>
-Build-Depends: debhelper (>= 5), dpatch (>= 2.0.9), autotools-dev, libldap2-dev, libpq-dev, libmysqlclient-dev | libmysqlclient16-dev | libmysqlclient15-dev, libradiusclient-ng-dev, libkrb5-dev, libnet-snmp-perl, procps, mawk | awk
+Build-Depends: debhelper (>= 5), dpatch (>= 2.0.9), perl, autotools-dev, libldap2-dev, libpq-dev, libmysqlclient-dev | libmysqlclient16-dev | libmysqlclient15-dev, libradiusclient-ng-dev, libkrb5-dev, libnet-snmp-perl, procps, mawk | awk
 Homepage: http://nagiosplug.sourceforge.net
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-nagios/nagios-plugins/
 Vcs-Svn: svn://svn.debian.org/pkg-nagios/nagios-plugins/trunk/
@@ -60,7 +60,7 @@ Architecture: any
 Conflicts: nagios-plugins (<= 1.4.2-3)
 Replaces: nagios-plugins
 Depends: ${shlibs:Depends}, ${misc:Depends}, ucf, nagios-plugins-basic (>= 1.4.5-2)
-Recommends: fping, snmp, libnet-snmp-perl, dnsutils, bind9-host | host, smbclient, whois, qstat
+Recommends: ${shlibs:Recommends}, fping, snmp, libnet-snmp-perl, dnsutils, bind9-host | host, smbclient, whois, qstat
 Suggests: nagios3, postfix | sendmail-bin | exim4-daemon-heavy | exim4-daemon-light
 Description: Plugins for the nagios network monitoring and management system
  Nagios is a host/service/network monitoring and management system. It has
diff --git a/debian/rules b/debian/rules
index a3d2c46..e73c074 100755
--- a/debian/rules
+++ b/debian/rules
@@ -121,7 +121,7 @@ clean: really-clean unpatch
 really-clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp
+	rm -f build-stamp debian/README.Debian.plugins debian/nagios-plugins-standard.substvars.in
 
 	# Add here commands to clean up after the build process.
 	[ ! -f Makefile ] || $(MAKE) distclean
@@ -169,6 +169,8 @@ install: build
 	mkdir -p ${NP_BASIC_DIR}/usr/share/nagios-plugins/dpkg
 	install -t ${NP_BASIC_DIR}/usr/share/nagios-plugins/dpkg \
 		$(DEBIANDIR)/functions
+	# generate debian/README.Debian.plugins
+	perl ./debian/bin/gen_plugin_deps.pl
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -200,7 +202,14 @@ binary-arch: build install
 	dh_compress -s
 	dh_fixperms -s -X utils.pm
 	dh_installdeb -s
-	dh_shlibdeps -s
+	dh_shlibdeps -s -Nnagios-plugins-standard
+	dpkg-shlibdeps -Tdebian/nagios-plugins-standard.substvars \
+		${NP_STD_DIR}/${NP_LIBEXEC}/check_dns
+	dpkg-shlibdeps -Tdebian/nagios-plugins-standard.substvars.in \
+		-dSuggests ${NP_STD_DIR}/${NP_LIBEXEC}/check_*
+	grep shlibs:Suggests debian/nagios-plugins-standard.substvars.in \
+		| sed -e 's/shlibs:Suggests/shlibs:Recommends/' \
+		>> debian/nagios-plugins-standard.substvars
 	dh_gencontrol -s
 	dh_md5sums -s
 	dh_builddeb -s

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git



More information about the Pkg-nagios-changes mailing list