[pkg-dspam-commits] r46 - trunk/debian

Matthijs Mohlmann active2-guest at costa.debian.org
Sun Nov 6 10:05:25 UTC 2005


Author: active2-guest
Date: Sun Nov  6 10:05:24 2005
New Revision: 46

Added:
   trunk/debian/dspam.default
   trunk/debian/dspam.init
Modified:
   trunk/debian/control
   trunk/debian/rules
Log:
 * Added initscript for dspam. Based on the initscript of pdns-recursor
 * Moved to debhelper compatibility level 5, no changes needed.


Modified: trunk/debian/control
==============================================================================
--- trunk/debian/control	(original)
+++ trunk/debian/control	Sun Nov  6 10:05:24 2005
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian DSPAM Maintainers <pkg-dspam-misc at lists.alioth.debian.org>
 Uploaders: Matthijs Mohlmann <matthijs at cacholong.nl>, Christoph Haas <haas at debian.org>, Kurt B. Kaiser <kbk at shore.net>, Jesus Climent <mooch at debian.org>
-Build-Depends: debhelper (>= 4.1.16), libpq-dev | postgresql-dev, dpatch (>= 2.0.0), automake1.9, autotools-dev, libmysqlclient14-dev, libdb4.2-dev, libsqlite3-dev, libldap2-dev
+Build-Depends: debhelper (>= 5.0.2), libpq-dev | postgresql-dev, dpatch (>= 2.0.0), automake1.9, autotools-dev, libmysqlclient14-dev, libdb4.2-dev, libsqlite3-dev, libldap2-dev
 Standards-Version: 3.6.2.1
 
 Package: dspam

Added: trunk/debian/dspam.default
==============================================================================
--- (empty file)
+++ trunk/debian/dspam.default	Sun Nov  6 10:05:24 2005
@@ -0,0 +1,8 @@
+# Variables for dspam.
+#
+# Do not start dspam.
+START=no
+
+# Options for dspam.
+#OPTIONS="--debug"
+

Added: trunk/debian/dspam.init
==============================================================================
--- (empty file)
+++ trunk/debian/dspam.init	Sun Nov  6 10:05:24 2005
@@ -0,0 +1,141 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          skeleton
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      S 0 1 6
+# Short-Description: initscript for dspam
+# Description:       dspam is a scalable, fast and statistical anti-spam filter
+### END INIT INFO
+#
+# Author:	Matthijs Mohlmann <matthijs at cacholong.nl>.
+#
+# Based on the init script of pdns-recursor
+#
+
+set -e
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC="DSPAM Statistical anti-spam filter"
+NAME=dspam
+DAEMON=/usr/sbin/$NAME
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+# Read config file if it is present.
+if [ -r /etc/default/$NAME ]; then
+	. /etc/default/$NAME
+fi
+
+OPTIONS="--daemon $OPTIONS"
+
+# Start the daemon
+d_start() {
+# Return
+#  0 if daemon has been started
+#  1 if daemon was already running
+#  2 if daemon could not be started
+  start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
+  start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $OPTIONS || return 2
+}
+
+# Stop the daemon
+d_stop() {
+# Return
+#  0 if daemon has been stopped
+#  1 if daemon was already stopped
+#  2 if daemon could not be stopped
+#  other if a failure occured
+  start-stop-daemon --stop --quiet --retry=HUP/30/TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME
+  RETVAL="$?"
+  [ "$RETVAL" = 2 ] && return 2
+  start-stop-daemon --stop --quiet --oknodo --retry=HUP/30/KILL/5 --exec $DAEMON
+  [ "$?" = 2 ] && return 2
+  rm -f $PIDFILE
+  return "$RETVAL"
+}
+
+case "$1" in
+  start)
+    if [ "$START" != "yes" ]; then
+      echo "Not starting $DESC -- disabled."
+      exit 0
+    fi
+    echo -n "Starting $DESC: $NAME"
+    d_start
+    case "$?" in
+      0)
+        echo "."
+        exit 0
+        ;;
+      1)
+        echo " (already running)."
+        exit 0
+        ;;
+      *)
+        echo " (failed)."
+        exit 1
+        ;;
+    esac
+    ;;
+  stop)
+    # Always try to stop the daemon.
+    echo -n "Stopping $DESC: $NAME"
+    d_stop
+    case "$?" in
+      0)
+        echo "."
+        exit 0
+        ;;
+      1)
+        echo " (not running)."
+        exit 0
+        ;;
+      *)
+        echo " (failed)."
+        exit 1
+    esac
+    ;;
+  restart|force-reload)
+    if [ "$START" != "yes" ]; then
+      $0 stop
+      exit 0
+    fi
+    echo -n "Restarting $DESC: $NAME"
+    d_stop
+    case "$?" in
+      0|1)
+        d_start
+        case "$?" in
+          0)
+            echo "."
+            exit 0
+            ;;
+          1)
+            echo " (failed -- old process still running)."
+            exit 1
+            ;;
+          *)
+            echo " (failed to start)."
+            exit 1
+            ;;
+        esac
+        ;;
+      *)
+        echo " (failed to stop)."
+        exit 1
+        ;;
+    esac
+    ;;
+  *)
+    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+    exit 1
+    ;;
+esac
+
+exit 0
+

Modified: trunk/debian/rules
==============================================================================
--- trunk/debian/rules	(original)
+++ trunk/debian/rules	Sun Nov  6 10:05:24 2005
@@ -4,7 +4,7 @@
 # Debian DSPAM maintainers team.
 
 # Uncomment this to turn on verbose mode.
-export DH_COMPAT=4
+export DH_COMPAT=5
 #export DH_VERBOSE=1
 
 # This has to be exported to make some magic below work.
@@ -142,6 +142,7 @@
 	dh_installcron -a
 	dh_installlogrotate -a
 	dh_installman -a
+	dh_installinit -a
 	dh_makeshlibs -a -Nlibdspam7-drv-pgsql -Nlibdspam7-drv-mysql -Nlibdspam7-drv-db4 -Nlibdspam7-drv-sqlite3 -Nlibdspam7-drv-hash
 	dh_link -a
 	dh_strip -a



More information about the Pkg-dspam-commits mailing list