From 460641370114eb380c10d9b6bed34ed2c9b4735e Mon Sep 17 00:00:00 2001 From: ficus Date: Mon, 24 Sep 2012 17:06:24 +0200 Subject: proper debian packaging and init.d script --- debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 12 ++++++++++++ debian/rules | 9 +++++++++ debian/torouterui.init | 45 +++++++++++++++++++++++++++++++++++++++++++++ debian/torouterui.postinst | 9 +++++++++ debian/torouterui.postrm | 3 +++ debian/torouterui.prerm | 12 ++++++++++++ 8 files changed, 96 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100755 debian/rules create mode 100644 debian/torouterui.init create mode 100644 debian/torouterui.postinst create mode 100644 debian/torouterui.postrm create mode 100644 debian/torouterui.prerm (limited to 'debian') diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8e5bda8 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +torouterui (0.0-1) unstable; urgency=low + + * source package automatically created by stdeb 0.6.0+git + + -- unknown Mon, 24 Sep 2012 16:32:34 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..e91acfb --- /dev/null +++ b/debian/control @@ -0,0 +1,12 @@ +Source: torouterui +Maintainer: unknown +Section: python +Priority: optional +Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7.4.3) +Standards-Version: 3.9.1 + +Package: torouterui +Architecture: all +Depends: ${misc:Depends}, ${python:Depends}, python-setuptools, uaputl, python-flask, python-augeas, hostname, ifupdown, iw +Description: torouter configuration web interface + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..2503da9 --- /dev/null +++ b/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f + +# This file was automatically generated by stdeb 0.6.0+git at +# Mon, 24 Sep 2012 16:32:34 +0200 + +%: + dh $@ --with python2 --buildsystem=python_distutils + + diff --git a/debian/torouterui.init b/debian/torouterui.init new file mode 100644 index 0000000..26ff519 --- /dev/null +++ b/debian/torouterui.init @@ -0,0 +1,45 @@ +#!/bin/sh -e + +### BEGIN INIT INFO +# Provides: torouterui +# Required-Start: $local_fs $remote_fs $network +# Required-Stop: $local_fs $remote_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: torouter configuration web interface +### END INIT INFO + +PATH="/sbin:/bin:/usr/sbin:/usr/bin" +DAEMON=/usr/bin/torouterui +PIDFILE=/var/run/torouterui.pid + +[ -x "$DAEMON" ] || exit 0 + +. /lib/lsb/init-functions + +case "$1" in + start) + log_daemon_msg "Starting torouter Web Configuration Interface" "torouterui" + start-stop-daemon --start -b -m --pidfile $PIDFILE --exec $DAEMON + log_end_msg 0 + ;; + restart|force-reload) + $0 stop + $0 start + ;; + stop) + log_daemon_msg "Stopping torouter Web Configuration Interface" "torouterui" + start-stop-daemon --stop --pidfile $PIDFILE --oknodo + log_end_msg 0 + ;; + status) + status_of_proc $DAEMON torouterui + ;; + *) + echo "Usage: /etc/init.d/torouterui {start|stop|status}" + exit 2 + ;; + +esac + +exit 0 diff --git a/debian/torouterui.postinst b/debian/torouterui.postinst new file mode 100644 index 0000000..e61d07a --- /dev/null +++ b/debian/torouterui.postinst @@ -0,0 +1,9 @@ + +if which pycompile >/dev/null 2>&1; then + pycompile -p torouterui + echo "Not starting just now; do so with '/etc/init.d/torouterui start' as root" +fi + +if [ -x "/etc/init.d/torouterui" ]; then + update-rc.d torouterui defaults >/dev/null +fi diff --git a/debian/torouterui.postrm b/debian/torouterui.postrm new file mode 100644 index 0000000..c758975 --- /dev/null +++ b/debian/torouterui.postrm @@ -0,0 +1,3 @@ +if [ "$1" = "purge" ] ; then + update-rc.d torouterui remove >/dev/null +fi diff --git a/debian/torouterui.prerm b/debian/torouterui.prerm new file mode 100644 index 0000000..f8e1600 --- /dev/null +++ b/debian/torouterui.prerm @@ -0,0 +1,12 @@ +if [ -x "/etc/init.d/torouterui" ]; then + invoke-rc.d torouterui stop || exit $? +fi + +if which pyclean >/dev/null 2>&1; then + pyclean -p torouterui +else + dpkg -L torouterui | grep \.py$ | while read file + do + rm -f "${file}"[co] >/dev/null + done +fi -- cgit v1.2.3