[SCM] Debian packaging of AllKnowingDNS CPAN distribution branch, master, updated. 76f5c4d6006d1c962d6318325fb39d348c5ac121

Michael Stapelberg michael at stapelberg.de
Mon Mar 12 09:56:45 UTC 2012


The following commit has been merged in the master branch:
commit 76f5c4d6006d1c962d6318325fb39d348c5ac121
Author: Michael Stapelberg <michael at stapelberg.de>
Date:   Mon Mar 12 10:31:04 2012 +0100

    add systemd service file

diff --git a/debian/all-knowing-dns.postinst b/debian/all-knowing-dns.postinst
new file mode 100644
index 0000000..dce2776
--- /dev/null
+++ b/debian/all-knowing-dns.postinst
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+	configure)
+		# systemd: enable the service file so that it will be started
+		# when booting. The server will be started later in this script
+		# via the sysvinit compatibility layer.
+		which systemctl >/dev/null 2>&1 && {
+			systemctl enable all-knowing-dns.service >/dev/null 2>&1 || true
+		} || true
+		;;
+	
+	abort-upgrade|abort-remove|abort-deconfigure)
+		;;
+
+	*)
+		echo "postinst called with unknown argument \`$1'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/all-knowing-dns.postrm b/debian/all-knowing-dns.postrm
new file mode 100644
index 0000000..917d361
--- /dev/null
+++ b/debian/all-knowing-dns.postrm
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -e
+
+# systemd: reload the daemon
+which systemctl >/dev/null 2>&1 && {
+	systemctl daemon-reload >/dev/null 2>&1 || true
+} || true
+
+case "$1" in
+	upgrade)
+		# systemd: start the new version of all-knowing-dns
+		which systemctl >/dev/null 2>&1 && {
+			systemctl restart all-knowing-dns.service
+		} || true
+		;;
+	
+	purge|remove|failed-upgrade|abort-install|abort-upgrade|disappear)
+		;;
+
+	*)
+		echo "postrm called with unknown argument \`$1'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/all-knowing-dns.prerm b/debian/all-knowing-dns.prerm
new file mode 100644
index 0000000..36e1a19
--- /dev/null
+++ b/debian/all-knowing-dns.prerm
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+	remove|upgrade|deconfigure)
+		# systemd: On uninstall (not upgrade), disable and stop the unit
+		which systemctl >/dev/null 2>&1 && {
+			systemctl --no-reload disable all-knowing-dns.service >/dev/null 2>&1 || true
+			systemctl stop all-knowing-dns.service >/dev/null 2>&1 || true
+		} || true
+		;;
+	
+	failed-upgrade)
+		;;
+
+	*)
+		echo "prerm called with unknown argument \`$1'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/all-knowing-dns.service b/debian/all-knowing-dns.service
new file mode 100644
index 0000000..5841211
--- /dev/null
+++ b/debian/all-knowing-dns.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Tiny DNS server for IPv6 Reverse DNS
+After=network.target syslog.target
+
+[Service]
+ExecStart=/usr/bin/all-knowing-dns
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/rules b/debian/rules
index 2d33f6a..b2fb981 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,9 @@
 #!/usr/bin/make -f
 
+override_dh_install:
+	dh_install
+	mkdir -p debian/all-knowing-dns/lib/systemd/system
+	cp debian/all-knowing-dns.service debian/all-knowing-dns/lib/systemd/system/
+
 %:
 	dh $@

-- 
Debian packaging of AllKnowingDNS CPAN distribution



More information about the Pkg-perl-cvs-commits mailing list