Bug#726783: Add support for systemd

2013-10-22 Thread Samuel Thibault
Jason White, le Sat 19 Oct 2013 19:05:54 +1100, a écrit :
 Here is a patch. Review and improvements are most welcome.

Thanks!  I have commited it.

Samuel


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#726783: Add support for systemd

2013-10-19 Thread Jason White
Package: brltty
Version: 4.5-3+b1
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

BRLTTY includes a systemd service file, which is currently not installed by
the Debian package. Furthermore, the upstream version of this file has
improvements over the version included in the BRLTTY 4.5 source, and
additional changes were necessary for the Debian environment (the path and
command line options of the executable, most notably).

I have included a revised version as debian/brltty.service.

Here is a patch. Review and improvements are most welcome.


From ca26011b0b4a7eef89e48c5d68f7bbab7f1c54c3 Mon Sep 17 00:00:00 2001
From: Jason White ja...@jasonjgw.net
Date: Sat, 19 Oct 2013 18:03:31 +1100
Subject: [PATCH] Add systemd service.

---
 debian/brltty.service | 30 ++
 debian/changelog  |  8 ++--
 debian/control|  2 +-
 debian/rules  |  3 +++
 4 files changed, 40 insertions(+), 3 deletions(-)
 create mode 100644 debian/brltty.service

diff --git a/debian/brltty.service b/debian/brltty.service
new file mode 100644
index 000..a856712
--- /dev/null
+++ b/debian/brltty.service
@@ -0,0 +1,30 @@
+[Unit]
+
+Description=Braille Device Support
+Documentation=man:brltty(1)
+Documentation=http://mielke.cc/brltty/
+
+DefaultDependencies=no
+Before=sysinit.target
+
+
+[Service]
+
+Type=forking
+PIDFile=/run/brltty.pid
+ExecStart=/sbin/brltty -q -P /run/brltty.pid
+
+TimeoutStartSec=5
+TimeoutStopSec=10
+
+Restart=always
+RestartSec=30
+
+Nice=-10
+OOMScoreAdjust=-900
+
+
+[Install]
+WantedBy=sysinit.target
+
+
diff --git a/debian/changelog b/debian/changelog
index c145a5b..8c31e1a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,14 @@
 
+  [ Samuel Thibault ]
   * control:
 - Make python*-brlapi description more explict.
 - Bump Standards-Version to 3.9.4 (no changes).
 
- -- Samuel Thibault sthiba...@debian.org  Sun, 23 Jun 2013 21:07:45 +0200
+  [ Jason White ]
+  * Add support for systemd (based on upstream service file).
+
+ -- Jason White ja...@jasonjgw.net  Sat, 19 Oct 2013 17:15:54 +1100
 
 brltty (4.5-3) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index 1401a8b..83e26e3 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Mario Lang ml...@debian.org, Samuel Thibault 
sthiba...@debian.org
 Vcs-Browser: http://git.debian.org/?p=pkg-a11y/brltty.git;a=summary
 Vcs-Git: git://git.debian.org/git/pkg-a11y/brltty.git
 Homepage: http://mielke.cc/brltty/
-Build-Depends: debhelper (= 7), dh-lisp,
+Build-Depends: debhelper (= 7), dh-lisp, dh-systemd (= 1.5),
autotools-dev, autoconf, tcl (= 8.5~),
libasound2-dev [linux-any],
python-all-dev (= 2.7~0),
diff --git a/debian/rules b/debian/rules
index 953d619..767fbca 100755
--- a/debian/rules
+++ b/debian/rules
@@ -143,8 +143,11 @@ brltty: build-brltty build-python
for file in Drivers/Braille/*/README*; \
do cp $$file 
`pwd`/debian/$(PACKAGE)/usr/share/doc/brltty/`basename $$(dirname 
$$file)`.`basename $$file`; \
done
+   dh_systemd_enable -p$@
# -r because we don't want to lose the console on an upgrade
dh_installinit -p$@ -r -- start 25 S .
+   # and likewise for systemd
+   dh_systemd_start -p$@ --restart-after-upgrade
dh_installchangelogs Documents/ChangeLog
dh_installman
dh_lintian
-- 
1.8.4.rc3


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org