Package: gpsd
Version: 3.9-1
Severity: normal
Tags: patch
User: pkg-systemd-maintain...@lists.alioth.debian.org
Usertags: systemd-units
X-Debbugs-CC: pkg-systemd-maintain...@lists.alioth.debian.org


Hi,

Thanks for shipping a systemd service file with gpsd.

By applying the attached patch, systemd users will enjoy a fully working
gpsd on their machines: it will get enabled and started properly
(even if installed on sysvinit and later switching to systemd).

Therefore, please apply the patch for your next upload. Thanks!

I also added a diff between the old (3.9-1) and new (3.9-1 with systemd
patch) control.tar.gz contents.

-- 
Best regards,
Michael
>From 67d1615835559dbbb5f7ce8c2c2cc4d1e15cba0d Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <stapelb...@debian.org>
Date: Wed, 26 Jun 2013 20:19:37 +0200
Subject: [PATCH] switch to dh-systemd for proper systemd maintscripts

---
 debian/control |    3 ++-
 debian/rules   |    2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index cf44796..1098724 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,8 @@ Build-Depends: debhelper (>= 8.1.3~), po-debconf,
  scons (>= 2.0.1), chrpath,
  dh-buildinfo,
  hardening-includes,
- pps-tools (>= 0.20120406+g0deb9c7e-2~) [linux-any]
+ pps-tools (>= 0.20120406+g0deb9c7e-2~) [linux-any],
+ dh-systemd (>= 1.3)
 Standards-Version: 3.9.2
 Homepage: http://www.catb.org/gpsd/
 Vcs-Browser: http://git.recluse.de/?p=debian/pkg-gpsd.git
diff --git a/debian/rules b/debian/rules
index 25e44ab..750a959 100755
--- a/debian/rules
+++ b/debian/rules
@@ -185,7 +185,9 @@ binary: install-stamp
 	dh_installman 
 	dh_installmenu 
 	dh_installdebconf 
+	dh_systemd_enable
 	dh_installinit  -- start 26 2 3 4 5 . stop 73 0 1 6 .
+	dh_systemd_start
 	dh_installexamples 
 	chmod 755 debian/$(PACKAGE_PY)/usr/lib/python*/*-packages/gps/gps.py
 	dh_python2  -Ngpsd
-- 
1.7.10.4

diff -ur OLD/control NEW/control
--- OLD/control	2013-05-19 22:39:07.000000000 +0200
+++ NEW/control	2013-06-26 20:25:07.000000000 +0200
@@ -2,8 +2,8 @@
 Version: 3.9-1
 Architecture: amd64
 Maintainer: Bernd Zeimetz <b...@debian.org>
-Installed-Size: 228
-Depends: netbase | systemd-sysv, lsb-base (>= 3.2-13), libbluetooth3 (>= 4.91), libc6 (>= 2.15), libdbus-1-3 (>= 1.0.2), libgps20 (>= 3.3), libusb-1.0-0 (>= 2:1.0.8), debconf (>= 0.5) | debconf-2.0
+Installed-Size: 169
+Depends: netbase | systemd-sysv, lsb-base (>= 3.2-13), libbluetooth3 (>= 4.91), libc6 (>= 2.15), libdbus-1-3 (>= 1.0.2), libgps20 (>= 3.3), libusb-1.0-0 (>= 2:1.0.8), debconf (>= 0.5) | debconf-2.0, init-system-helpers (>= 1.3)
 Recommends: udev, python
 Suggests: gpsd-clients, dbus
 Conflicts: fso-gpsd
diff -ur OLD/postinst NEW/postinst
--- OLD/postinst	2013-05-19 22:39:09.000000000 +0200
+++ NEW/postinst	2013-06-26 20:25:08.000000000 +0200
@@ -56,6 +56,11 @@
 db_stop;
 
 
+# Automatically added by dh_systemd_enable
+if [ -x "/usr/bin/deb-systemd-helper" ]; then
+	deb-systemd-helper enable gpsd.socket gpsd.service >/dev/null || true
+fi
+# End automatically added section
 # Automatically added by dh_installinit
 if [ -x "/etc/init.d/gpsd" ]; then
 	update-rc.d gpsd start 26 2 3 4 5 . stop 73 0 1 6 . >/dev/null
diff -ur OLD/postrm NEW/postrm
--- OLD/postrm	2013-05-19 22:39:09.000000000 +0200
+++ NEW/postrm	2013-06-26 20:25:08.000000000 +0200
@@ -29,6 +29,19 @@
 	systemctl --system daemon-reload >/dev/null || true
 fi
 # End automatically added section
+# Automatically added by dh_systemd_enable
+if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
+	if [ -x "/usr/bin/deb-systemd-helper" ]; then
+		if [ "$1" = "purge" ]; then
+			export _DEB_SYSTEMD_HELPER_PURGE=1
+		else
+			# To explicitly clean the environment.
+			export _DEB_SYSTEMD_HELPER_PURGE=0
+		fi
+		deb-systemd-helper disable gpsd.socket gpsd.service >/dev/null
+	fi
+fi
+# End automatically added section
 # Automatically added by dh_installdebconf
 if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
 	. /usr/share/debconf/confmodule

Reply via email to