summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e567c85)
raw | patch | inline | side by side (parent: e567c85)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 29 Apr 2007 13:57:03 +0000 (15:57 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 29 Apr 2007 13:57:03 +0000 (15:57 +0200) |
A debconf question has been added to ask the user weather he wishes to let
collectd try to automatically migrate old RRD files using migrate-3-4.px. A
backup of /var/lib/collectd/ will be created in this case.
collectd try to automatically migrate old RRD files using migrate-3-4.px. A
backup of /var/lib/collectd/ will be created in this case.
debian/collectd.config | [new file with mode: 0755] | patch | blob |
debian/collectd.postinst | [new file with mode: 0755] | patch | blob |
debian/collectd.templates | [new file with mode: 0644] | patch | blob |
debian/control | patch | blob | history | |
debian/rules | patch | blob | history |
diff --git a/debian/collectd.config b/debian/collectd.config
--- /dev/null
+++ b/debian/collectd.config
@@ -0,0 +1,38 @@
+#!/bin/sh
+# config script for collectd
+#
+# see: dh_installdebconf(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <preconfigure> `configure' <installed-version>
+# * <postinst> `configure' <old-version>
+# * <reconfigure> `reconfigure' <installed-version>
+
+. /usr/share/debconf/confmodule
+
+case "$1" in
+ configure)
+ db_set collectd/auto-migrate-3-4 false
+
+ if dpkg --compare-versions "$2" lt "4.0.0~"; then
+ db_input high collectd/auto-migrate-3-4 || true
+ db_go || true
+ fi
+ ;;
+
+ reconfigure)
+ ;;
+
+ *)
+ echo "config called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+db_stop
+
+exit 0
+
+
diff --git a/debian/collectd.postinst b/debian/collectd.postinst
--- /dev/null
+++ b/debian/collectd.postinst
@@ -0,0 +1,49 @@
+#!/bin/sh
+# postinst script for collectd
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+. /usr/share/debconf/confmodule
+
+case "$1" in
+ configure)
+ db_get collectd/auto-migrate-3-4
+ if [ "$RET" = "true" ]; then
+ cp -a /var/lib/collectd/ /var/backups/collectd-"$2"
+ /usr/lib/collectd/utils/migrate-3-4.px | bash
+ fi
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+db_stop
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/collectd.templates b/debian/collectd.templates
--- /dev/null
@@ -0,0 +1,14 @@
+Template: collectd/auto-migrate-3-4
+Type: boolean
+Default: false
+Description: Automatically try to migrate your RRD files?
+ The layout of the RRD files created by collectd has changed significantly
+ since version 3.x. In order to keep your old data you have to migrate it.
+ This can be done by using /usr/lib/collectd/utils/migrate-3-4.px. This step
+ can be done automatically. In this case a backup of /var/lib/collectd/ is
+ made in /var/backups/.
+ .
+ See /usr/share/doc/collectd/README.Debian for details.
+ .
+ This script is still experimental. Do not expect it to work in all cases.
+
diff --git a/debian/control b/debian/control
index 423f3faa218c25031ecd183524c56cd26b24a877..0bf2179abf800f22e102ca4c32d76f168b06bd65 100644 (file)
--- a/debian/control
+++ b/debian/control
Package: collectd
Architecture: any
-Depends: ${shlibs:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: collectd-apache, collectd-mysql, collectd-sensors, collectd-dev,
collectd-ping, collectd-dns, collectd-perl,librrds-perl, hddtemp, mbmon
Provides: collectd-hddtemp
diff --git a/debian/rules b/debian/rules
index bfe05920116795fe0aa73b5271edc254c6f3f27b..9d7a0fb930c20b87aceebb04c2fada2cb3a44c47 100755 (executable)
--- a/debian/rules
+++ b/debian/rules
dh_installdocs -A -a debian/README.Debian AUTHORS README TODO
dh_installexamples -a contrib/collectd2html.pl contrib/collection.cgi \
contrib/PerlLib/ contrib/SpamAssassin/ contrib/iptables/
+ dh_installdebconf -a
dh_installinit -a -- defaults 95
dh_installman -a src/collectd.1 src/collectd.conf.5
dh_link -a