Package: calypso
Version: 1.4
Severity: wishlist
Tags: patch

Hi,
upstream ships an init script and it would be nice to have it installed
and enabled by default. Attached patch does this. Note that this needs
the init script changes needed to run as user calypso recently posted
upstream.
Cheers,
 -- Guido


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-updates'), (500, 'unstable'), 
(1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.14.0-rc1+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages calypso depends on:
ii  git             1:1.9.0-1
ii  python          2.7.5-5
ii  python-daemon   1.5.5-1
ii  python-vobject  0.8.1c-4

calypso recommends no packages.

calypso suggests no packages.
>From 9321693cabe189dddccbed5594bdae2467893723 Mon Sep 17 00:00:00 2001
Message-Id: <9321693cabe189dddccbed5594bdae2467893723.1396337109.git....@sigxcpu.org>
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org>
Date: Tue, 1 Apr 2014 08:54:13 +0200
Subject: [PATCH] Use upstream init script
To: caly...@keithp.com

---
 debian/calypso.postinst | 59 +++++++++++++++++++++++++++++++++++++++++++++++++
 debian/calypso.postrm   | 46 ++++++++++++++++++++++++++++++++++++++
 debian/rules            |  4 ++++
 3 files changed, 109 insertions(+)
 create mode 100644 debian/calypso.postinst
 create mode 100644 debian/calypso.postrm

diff --git a/debian/calypso.postinst b/debian/calypso.postinst
new file mode 100644
index 0000000..b1cd9f0
--- /dev/null
+++ b/debian/calypso.postinst
@@ -0,0 +1,59 @@
+#!/bin/sh
+# postinst script for libvirt-bin
+#
+# 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
+
+add_user()
+{
+    if ! getent group calypso >/dev/null; then
+        addgroup --quiet --system calypso
+    fi
+
+    if ! getent passwd calypso >/dev/null; then
+        adduser --quiet \
+            --system \
+            --ingroup calypso \
+            --quiet \
+            --disabled-login \
+            --disabled-password \
+            --home /var/lib/calypso \
+            -gecos "Calypso CalDAV/CardDAV server" \
+            calypso
+    fi
+}
+
+
+case "$1" in
+    configure)
+        add_user
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/calypso.postrm b/debian/calypso.postrm
new file mode 100644
index 0000000..3230515
--- /dev/null
+++ b/debian/calypso.postrm
@@ -0,0 +1,46 @@
+#!/bin/sh
+# postrm script for #PACKAGE#
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+        if getent passwd calypso >/dev/null; then
+            deluser calypso || true
+    fi
+
+        if getent group calypso >/dev/null; then
+            delgroup calypso || true
+    fi
+    ;;
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
index 100bf6c..d791ebb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,4 +7,8 @@ export DH_VERBOSE=1
 override_dh_auto_clean:
 	dh_auto_clean
 	rm -rf build .*egg-info
+	rm -f debian/calypso-init
 
+override_dh_installinit:
+	cp calypso-init debian/calypso.init
+	dh_installinit
-- 
1.9.0

Reply via email to