Hi,

I updated the patch once again. The most recent version does not patch
the upstream service file at all. Instead, it uses a symlink, which is
the preferred way of doing aliases, as we figured out in #719695.

Please merge this patch for your next upload.

Thanks.

-- 
Best regards,
Michael
>From 919691a148323c14461b1a16a74109d7ebf7600e Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <stapelb...@debian.org>
Date: Wed, 25 Dec 2013 09:20:14 +0100
Subject: [PATCH] enable systemd support, ship symlink to handle different
 names

The sysvinit script is called smartmontools, whereas the service file is
called smartd. The new symlink addresses this, such that users can use
both names and only the native unit is started by systemd.
---
 debian/control             | 2 +-
 debian/rules               | 7 ++++++-
 debian/smartmontools.links | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 debian/smartmontools.links

diff --git a/debian/control b/debian/control
index 626a3ca..5f37e27 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: Giuseppe Iuculano <iucul...@debian.org>
 Uploaders: Florian Maier <cont...@marsmenschen.com>
-Build-Depends: debhelper (>= 7), libcam-dev [kfreebsd-i386 kfreebsd-amd64], automake1.10, autoconf, libcap-ng-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386 !sparc !avr32], libselinux1-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libusb2-dev [kfreebsd-i386 kfreebsd-amd64], hardening-wrapper
+Build-Depends: debhelper (>= 7), dh-systemd (>= 1.13), libcam-dev [kfreebsd-i386 kfreebsd-amd64], automake1.10, autoconf, libcap-ng-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386 !sparc !avr32], libselinux1-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libusb2-dev [kfreebsd-i386 kfreebsd-amd64], hardening-wrapper
 Standards-Version: 3.9.4
 Vcs-Git: git://anonscm.debian.org/collab-maint/smartmontools.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/smartmontools.git
diff --git a/debian/rules b/debian/rules
index fa0dc7f..61cba5c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -56,6 +56,7 @@ configure-stamp:
 				--with-attributelog=/var/lib/smartmontools/attrlog. \
 				--with-exampledir=/usr/share/doc/smartmontools/examples/ \
 				--with-drivedbdir=/var/lib/smartmontools/drivedb \
+				--with-systemdsystemunitdir=/lib/systemd/system \
 				${CONFIGURE_ARGS}
 	touch configure-stamp
 
@@ -100,13 +101,17 @@ binary-arch: build install
 	dh_installmenu
 	dh_installlogrotate
 	dh_install
+	# dh_link needs to run before dh_systemd_start so that the
+	# smartmontools.service -> smartd.service symlink is present.
+	dh_link
+	dh_systemd_enable
 	dh_installinit -- start 20 2 3 4 5 . stop 20 1 .
+	dh_systemd_start
 	dh_installcron
 	dh_installman debian/update-smart-drivedb.8
 	dh_installinfo
 	dh_lintian
 	dh_installchangelogs ChangeLog
-	dh_link
 	dh_strip
 	dh_compress
 	dh_fixperms
diff --git a/debian/smartmontools.links b/debian/smartmontools.links
new file mode 100644
index 0000000..31a0a80
--- /dev/null
+++ b/debian/smartmontools.links
@@ -0,0 +1 @@
+/lib/systemd/system/smartd.service /lib/systemd/system/smartmontools.service
-- 
1.8.5.1

Reply via email to