summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3c385f)
raw | patch | inline | side by side (parent: f3c385f)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 6 Oct 2007 19:29:24 +0000 (21:29 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 6 Oct 2007 19:29:24 +0000 (21:29 +0200) |
The script gen_plugin_deps.pl generates a list of dependencies for each
plugin requiring anything besides libc6. README.Debian.plugins.in and this
list are then used to create README.Debian.plugins which is included in
the collectd binary package.
plugin requiring anything besides libc6. README.Debian.plugins.in and this
list are then used to create README.Debian.plugins which is included in
the collectd binary package.
debian/README.Debian | patch | blob | history | |
debian/README.Debian.plugins.in | [new file with mode: 0644] | patch | blob |
debian/gen_plugin_deps.pl | [new file with mode: 0755] | patch | blob |
debian/rules | patch | blob | history |
diff --git a/debian/README.Debian b/debian/README.Debian
index c3e7c13861ac6e3fd213c4f4f4f500588f929275..053592b200e1e3b4fca1e7ff397ffc9b67e74bb5 100644 (file)
--- a/debian/README.Debian
+++ b/debian/README.Debian
General notes:
--------------
-- This package is split up into several packages to prevent you from having to
- install dependencies that you don't actually need. Any plugin that has
- dependencies other than libc gets its own package.
+- Some plugins require additional libraries. To prevent you from having to
+ install dependencies that you don't actually need those libraries are
+ recommendations rather than dependencies. See README.Debian.plugins in the
+ "collectd" package for details.
Configuring collectd:
---------------------
diff --git a/debian/README.Debian.plugins.in b/debian/README.Debian.plugins.in
--- /dev/null
@@ -0,0 +1,17 @@
+collectd plugins on Debian
+==========================
+
+Some plugins require additional libraries. To prevent you from having to
+install dependencies that you don't actually need those libraries are
+recommendations rather than dependencies.
+
+apt-get(8) and aptitude(8) will install recommended packages automatically by
+default. If you did not disable this feature you will have everything in place
+to operate all plugins. Else you have to install missing dependencies manually
+(see the section "Plugin dependencies" below).
+
+Plugin dependencies:
+--------------------
+
+@PLUGIN_DEPS@
+
diff --git a/debian/gen_plugin_deps.pl b/debian/gen_plugin_deps.pl
--- /dev/null
@@ -0,0 +1,95 @@
+#!/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;
+
+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/collectd/usr/lib/collectd/";
+
+ 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$/) {
+ 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 "$name:\n";
+ foreach my $dep (@deps) {
+ print $fh " * $dep\n";
+ }
+ }
+ }
+}
+
+# vim: set tw=78 sw=4 ts=4 noexpandtab :
+
diff --git a/debian/rules b/debian/rules
index 8c5c9cce255d2e66289c1f79ddc564b8920837c5..071908a8054ceaba641236d620b35c4e13a9a528 100755 (executable)
--- a/debian/rules
+++ b/debian/rules
-$(MAKE) distclean
+ rm -f debian/README.Debian.plugins
+
dh_clean
debconf-updatepo
for UTIL in extractDS.px migrate-3-4.px; do \
cp contrib/$$UTIL debian/collectd/usr/lib/collectd/utils/; \
done
+
+ perl ./debian/gen_plugin_deps.pl
binary-indep: install-indep
dh_testdir
dh_testroot
dh_installchangelogs -a ChangeLog
dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
- dh_installdocs -a debian/NEWS.Debian
+ dh_installdocs -a debian/NEWS.Debian debian/README.Debian.plugins
dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi \
contrib/PerlLib/ contrib/SpamAssassin/ contrib/iptables/
dh_installdebconf -a