[Pkg-cli-apps-commits] [smuxi] 01/01: Add smuxi-server-upstart package

Christopher Halse Rogers raof-guest at alioth.debian.org
Tue Oct 29 01:43:30 UTC 2013


This is an automated email from the git hooks/post-receive script.

raof-guest pushed a commit to branch smuxi-server-upstart
in repository smuxi.

commit 45e65483b5f091355449ce7a0e6a6e98d7d3e0bc
Author: Christopher James Halse Rogers <raof at ubuntu.com>
Date:   Tue Oct 29 12:43:14 2013 +1100

    Add smuxi-server-upstart package
---
 debian/control                       |   22 ++++++++++++++++++++++
 debian/rules                         |    4 ++++
 debian/smuxi-server-upstart.install  |    1 +
 debian/smuxi-server-upstart.postinst |   33 +++++++++++++++++++++++++++++++++
 debian/smuxi-server-upstart.postrm   |   17 +++++++++++++++++
 debian/smuxi-server-upstart.prerm    |   13 +++++++++++++
 debian/smuxi-server.conf             |   15 +++++++++++++++
 7 files changed, 105 insertions(+)

diff --git a/debian/control b/debian/control
index ca46441..7853b96 100644
--- a/debian/control
+++ b/debian/control
@@ -103,6 +103,28 @@ Description: Engine libraries for Smuxi (IRC, Twitter, XMPP, Campfire, JabbR)
  * Campfire engine
  * JabbR engine
 
+Package: smuxi-server-upstart
+Architecture: all
+Depends: smuxi-engine,
+	 adduser,
+         ${misc:Depends},
+Description: Upstart integration for Smuxi server
+ Smuxi is an irssi-inspired, flexible, user-friendly and cross-platform IRC
+ client for sophisticated users, targeting the GNOME desktop.
+ .
+ Smuxi is based on the client-server model: The core application (engine) can
+ be placed onto a server which is connected to the Internet around-the-clock;
+ one or more frontends then connect to the core. This way, the connection to
+ IRC can be kept up even when all frontends have been closed. The combination
+ of screen and irssi served as example for this architecture.
+ .
+ Smuxi also supports the regular single application mode. This behaves like a
+ typical IRC client; it doesn't need separate core management and utilizes a
+ local engine that is used by the local frontend client.
+ .
+ This package contains integration with the Upstart init daemon to run a
+ system-wide smuxi-server instance on startup.
+
 Package: smuxi-frontend-gnome
 Architecture: all
 Replaces: smuxi (<< 0.5.25),
diff --git a/debian/rules b/debian/rules
index 0492f74..6b07ff5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -45,6 +45,10 @@ override_dh_install:
 	# optional system libs
 	-install /usr/lib/gio-sharp/gio-sharp.dll* debian/smuxi-frontend-gnome/usr/lib/smuxi/
 
+#override_dh_installinit:
+#	dh_installinit --package=smuxi-server-upstart --name=smuxi-server
+#	dh_installinit --remaining-packages
+
 override_dh_autoreconf:
 	ln -sf debian/autogen.sh
 	NOCONFIGURE=1 NOGIT=1 dh_autoreconf ./autogen.sh
diff --git a/debian/smuxi-server-upstart.install b/debian/smuxi-server-upstart.install
new file mode 100644
index 0000000..d6a80ba
--- /dev/null
+++ b/debian/smuxi-server-upstart.install
@@ -0,0 +1 @@
+debian/smuxi-server.conf	/etc/init/
\ No newline at end of file
diff --git a/debian/smuxi-server-upstart.postinst b/debian/smuxi-server-upstart.postinst
new file mode 100644
index 0000000..d4045c8
--- /dev/null
+++ b/debian/smuxi-server-upstart.postinst
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+    
+# ensure /var/lib/smuxi-server exists...
+	mkdir -p /var/lib/smuxi-server
+
+# ...create smuxi-server user if it isn't already there...
+        adduser --system --group --home /var/lib/smuxi-server \
+	    debian-smuxi-server --quiet --gecos "Smuxi IRC server daemon"
+
+# ...finally, ensure /var/lib/smuxi-server has the right permissions
+	chown -R debian-smuxi-server:debian-smuxi-server /var/lib/smuxi-server
+# Restore selinux context
+        if which restorecon >/dev/null 2>&1; then
+            restorecon /var/lib/smuxi-server
+        fi
+
+	;;
+esac	
+
+# dh_installinit does not support installing only an upstart job config, so
+# do this manually.
+
+# Use invoke-rc.d rather than initctl so that daemon policy is respected
+invoke-rc.d smuxi-server start || exit $?
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/smuxi-server-upstart.postrm b/debian/smuxi-server-upstart.postrm
new file mode 100644
index 0000000..4b44bb3
--- /dev/null
+++ b/debian/smuxi-server-upstart.postrm
@@ -0,0 +1,17 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    purge)
+# We don't remove the smuxi-server user on purge.
+# This should change once bug #621833 is resolved.
+
+# Remove colord's state directory
+	rm -rf /var/lib/smuxi-server
+	;;
+esac	
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/smuxi-server-upstart.prerm b/debian/smuxi-server-upstart.prerm
new file mode 100644
index 0000000..c65e3b4
--- /dev/null
+++ b/debian/smuxi-server-upstart.prerm
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+# dh_installinit does not support installing only an upstart job config, so
+# do this manually.
+
+# Use invoke-rc.d rather than initctl so that daemon policy is respected
+invoke-rc.d smuxi-server stop || exit $?
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/smuxi-server.conf b/debian/smuxi-server.conf
new file mode 100644
index 0000000..48dd0f1
--- /dev/null
+++ b/debian/smuxi-server.conf
@@ -0,0 +1,15 @@
+description "Start smuxi-server instance"
+author "Christopher James Halse Rogers <raof at ubuntu.com>"
+
+console log
+
+start on started ssh
+stop on stopped ssh
+
+respawn
+respawn limit 10 5
+
+chdir /var/lib/smuxi-server
+setuid smuxi-server
+
+exec smuxi-server

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cli-apps/packages/smuxi.git



More information about the Pkg-cli-apps-commits mailing list