Imported Debian patch 0.1.15.1-3 debian/0.1.15.1-3
authorJan Wagner <waja@cyconet.org>
Thu, 10 Feb 2011 09:38:35 +0000 (10:38 +0100)
committerChris Butler <chrisb@debian.org>
Fri, 11 Feb 2011 20:59:30 +0000 (20:59 +0000)
17 files changed:
debian/README.Debian [new file with mode: 0644]
debian/README.source [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/docs [new file with mode: 0644]
debian/init.d [new file with mode: 0644]
debian/patches/00list [new file with mode: 0644]
debian/patches/01_change_lockpath.dpatch [new file with mode: 0644]
debian/patches/02_enable_ipv6.dpatch [new file with mode: 0644]
debian/patches/03_cacherejectmsg.dpatch [new file with mode: 0644]
debian/postinst [new file with mode: 0644]
debian/postrm [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]
debian/watch [new file with mode: 0644]

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644 (file)
index 0000000..7312d05
--- /dev/null
@@ -0,0 +1,36 @@
+policyd-weight for Debian
+-------------------------
+
+You can create a file /etc/policyd-weight.conf with different setting from
+default (can be got with "/usr/sbin/policyd-weight defaults").
+
+Please keep track of the used Blocking Lists, default there are:
+
+    'pbl.spamhaus.org',       3.25,          0,        'DYN_PBL_SPAMHAUS',
+    'sbl-xbl.spamhaus.org',   4.35,       -1.5,        'SBL_XBL_SPAMHAUS',
+    'bl.spamcop.net',         3.75,       -1.5,        'SPAMCOP',
+    'dnsbl.njabl.org',        4.25,       -1.5,        'BL_NJABL',
+    'ix.dnsbl.manitu.net',    4.35,          0,        'IX_MANITU'
+
+and
+
+    'multi.surbl.org',             4,        0,        'SURBL',
+    'rhsbl.ahbl.org',              4,        0,        'AHBL',
+    'dsn.rfc-ignorant.org',        3.5,      0,        'DSN_RFCI',
+    'postmaster.rfc-ignorant.org', 0.1,      0,        'PM_RFCI',
+    'abuse.rfc-ignorant.org',      0.1,      0,        'ABUSE_RFCI'
+
+Some of them maybe disappear during the stable release, in this case you need
+to redefine @dnsbl_score and/or @rhsbl_score in /etc/policyd-weight.conf.
+
+If you stop/restart policyd-weight via init script, the cache instance will be
+terminated. The cache is NOT terminated with dstop/drestart.
+
+For instructions to setup policyd-weight please refer to
+/usr/share/doc/policyd-weight/documentation.txt.gz or to
+http://www.policyd-weight.org!
+
+Feel free to also contact the policyd-weight mailing list
+<policyd-weight-list@ek-muc.de> if you has questions/problems.
+
+ -- Jan Wagner <waja@cyconet.org>  Wed,  8 Nov 2006 22:44:24 +0100
diff --git a/debian/README.source b/debian/README.source
new file mode 100644 (file)
index 0000000..f0fe49a
--- /dev/null
@@ -0,0 +1,3 @@
+We use dpatch for patch handling inside our package(s).  Please see
+/usr/share/doc/dpatch/README.source.gz (if you have installed dpatch) for
+documentation about dpatch.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..b1cf0bd
--- /dev/null
@@ -0,0 +1,161 @@
+policyd-weight (0.1.15.1-3) unstable; urgency=low
+
+  * Orphan the package.
+  * Add 03_cacherejectmsg.dpatch, to have a more verbose reject message on
+    cache hit, thanks Martin F. Krafft (Closes: #598844)
+  * Updating standards version to 3.9.1
+    - use dh_prep instead of dh_clean -k
+  * Update to debhelper 7
+
+ -- Jan Wagner <waja@cyconet.org>  Thu, 10 Feb 2011 10:38:35 +0100
+
+policyd-weight (0.1.15.1-2) unstable; urgency=low
+
+  * Updating standards version to 3.8.4
+    - Add README.source
+  * Migrate Vcs-Fields over to scm.uncompleted.org
+  * Add 1.0 to debian/source/format
+  * Add ${misc:Depends} to dependencies
+
+ -- Jan Wagner <waja@cyconet.org>  Wed, 10 Mar 2010 12:21:52 +0100
+
+policyd-weight (0.1.15.1-1) experimental; urgency=low
+
+  * integrate the development script into our rebuild upstream tarball
+    - drop 02_remove_dsbl.dpatch and 03_0.1.15.1.dpatch
+  * add 02_enable_ipv6.dpatch to make use of the IPv6 code
+
+ -- Jan Wagner <waja@cyconet.org>  Mon, 29 Sep 2008 22:32:36 +0200
+
+policyd-weight (0.1.14.17+0.1.15.1-1) experimental; urgency=low
+
+  * new upstream release
+    - add 03_0.1.15.1.dpatch, since no tarball is available
+  * remove 03_ipv6_support.dpatch, cause integrated upstream
+
+ -- Jan Wagner <waja@cyconet.org>  Wed, 24 Sep 2008 12:21:07 +0200
+
+policyd-weight (0.1.14.17-10) experimental; urgency=low
+
+  * add support for IPv6 Helo and RBL checks (Closes: #483864).
+  * depend on libnet-ip-perl
+
+ -- Jan Wagner <waja@cyconet.org>  Wed, 24 Sep 2008 12:18:08 +0200
+
+policyd-weight (0.1.14.17-4) unstable; urgency=low
+
+  * Remove list.dsbl.org from default DNSBL list (Closes: #498037).
+  * Leave hint about blocking lists in README.Debian
+
+ -- Jan Wagner <waja@cyconet.org>  Sun, 07 Sep 2008 13:49:39 +0200
+
+policyd-weight (0.1.14.17-3) unstable; urgency=low
+
+  * Updating standards version to 3.8.0, no changes needed
+  * implement machine-interpretable copyright file
+
+ -- Jan Wagner <waja@cyconet.org>  Sun, 20 Jul 2008 13:34:54 +0200
+
+policyd-weight (0.1.14.17-2) unstable; urgency=low
+
+  * add conditional deluser and delgroup in postrm
+  * bump copyright of packaging to 2008 and remove trailing whitespaces
+  * add CVE into the changelog entries
+
+ -- Jan Wagner <waja@cyconet.org>  Mon, 14 Apr 2008 23:28:12 +0200
+
+policyd-weight (0.1.14.17-1) unstable; urgency=high
+
+  * new upstream release
+    - fixes insecure temporary file vulnerability, previous releases doesn't
+      really does (CVE-2008-1570)
+  * adjust initscript to return 0 on exit when using stop target and daemon
+    isn't running anymore (Closes: #473225).
+  * add dpatch infrastructure to package (depency to dpatch and adjusted
+    rules)
+  * add 01_change_lockpath.dpatch to use proper location for lockpath to
+    prevent security mess with permissions in unsecure directory
+
+ -- Jan Wagner <waja@cyconet.org>  Sun, 30 Mar 2008 01:10:45 +0100
+
+policyd-weight (0.1.14.15-1) unstable; urgency=high
+
+  * new upstream release
+    - fixes insecure temporary file vulnerability (CVE-2008-1569)
+
+ -- Jan Wagner <waja@cyconet.org>  Wed, 26 Mar 2008 01:58:34 +0100
+
+policyd-weight (0.1.14.14-2) unstable; urgency=medium
+
+  * remove c&p fault from postrm which causes accidently remove files not
+    related to this package
+
+ -- Jan Wagner <waja@cyconet.org>  Wed, 12 Mar 2008 00:37:24 +0100
+
+policyd-weight (0.1.14.14-1) unstable; urgency=low
+
+  * new upstream (Closes: #451358).
+  * remove patches, we are on upstream tarball again
+  * remove dpatch as builddep and from rules
+  * added Vcs- fields, moved Homepage into source header's field
+  * bump standards version to 3.7.3
+  * include cstop/crestart into init script for stoping cache instance
+    (Closes: #461124).
+
+ -- Jan Wagner <waja@cyconet.org>  Thu, 14 Feb 2008 20:01:13 +0100
+
+policyd-weight (0.1.14.5+0.1.14.12-1) experimental; urgency=low
+
+  * switch to recent development version to get more up to date checks
+  * include and depend on dpatch
+  * this version provides a workaround for #451358 (Closes: #451358).
+
+ -- Jan Wagner <waja@cyconet.org>  Mon, 16 Jul 2007 10:13:21 +0200
+
+policyd-weight (0.1.14.5-1) unstable; urgency=low
+
+  * switch to recent development version to get more up to date checks
+  * drop ordb patch, included into upstream
+
+ -- Jan Wagner <waja@cyconet.org>  Mon, 16 Jul 2007 10:13:21 +0200
+
+policyd-weight (0.1.14-beta-6) unstable; urgency=medium
+
+  * fix upgrade path for initscript
+  * changed init scripts to 19 21 to make shure postfix is not running when
+    polw not
+
+ -- Jan Wagner <waja@cyconet.org>  Wed, 20 Dec 2006 19:55:38 +0100
+
+policyd-weight (0.1.14-beta-5) unstable; urgency=medium
+
+  * add remove_ordb.diff to remove ORDB DNSBL from default config since they
+    got offline today
+
+ -- Jan Wagner <waja@cyconet.org>  Mon, 18 Dec 2006 00:05:29 +0100
+
+policyd-weight (0.1.14-beta-4) unstable; urgency=medium
+
+  * fix startup script S20, so make polw start before postfix
+  * provide update path via postinst
+
+ -- Jan Wagner <waja@cyconet.org>  Sun, 17 Dec 2006 14:19:46 +0100
+
+policyd-weight (0.1.14-beta-3) unstable; urgency=medium
+
+  * fixed attributes of system user (Closes: #402314).
+
+ -- Jan Wagner <waja@cyconet.org>  Fri, 24 Nov 2006 21:55:27 +0100
+
+policyd-weight (0.1.14-beta-2) unstable; urgency=medium
+
+  * removed libsys-syslog-perl from Depencies and add to Recommends
+  * fixed watch file
+
+ -- Jan Wagner <waja@cyconet.org>  Sun, 12 Nov 2006 22:17:36 +0100
+
+policyd-weight (0.1.14-beta-1) unstable; urgency=low
+
+  * Initial release (Closes: #397704).
+
+ -- Jan Wagner <waja@cyconet.org>  Wed,  8 Nov 2006 22:44:24 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..136cdad
--- /dev/null
@@ -0,0 +1,21 @@
+Source: policyd-weight
+Section: mail
+Priority: optional
+Maintainer: Debian QA Group <packages@qa.debian.org>
+Build-Depends: debhelper (>= 7), dpatch
+Homepage: http://www.policyd-weight.org/
+Vcs-Browser: https://scm.uncompleted.org/projects/debian/repository/show/policyd-weight
+Vcs-Svn: https://scm.uncompleted.org/svn/debian/policyd-weight/trunk
+Standards-Version: 3.9.1
+
+Package: policyd-weight
+Architecture: all
+Depends: ${perl:Depends}, ${misc:Depends}, adduser, libnet-dns-perl, libnet-ip-perl
+Recommends: libsys-syslog-perl
+Description: a Perl policy daemon for the Postfix MTA
+ Its intended to eliminate forged envelope senders and HELOs (i.e. in bogus
+ mails). It allows you to score DNSBLs (RBL/RHSBL), HELO, MAIL FROM and client
+ IP addresses before any queuing is done. It allows you to REJECT messages
+ which have a score higher than allowed, providing improved blocking of spam
+ and virus mails. policyd-weight caches the most frequent client/sender
+ combinations (SPAM as well as HAM) to reduce the number of DNS queries.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..b0776a4
--- /dev/null
@@ -0,0 +1,32 @@
+Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
+Packaged-By: Jan Wagner <waja@cyconet.org>
+Packaged-Date: Wed,  8 Nov 2006 22:44:24 +0100
+Upstream-Name: policyd-weight
+Upstream-Maintainer: Robert Felber <r.felber@ek-muc.de>
+Upstream-Source: http://www.policyd-weight.org
+
+Files: *
+Copyright: (C) 2005-2006 Robert Felber
+License: GPL-2+
+
+Files: debian/*
+Copyright: (C) 2006, 2008 Jan Wagner <waja@cyconet.org>
+License: GPL-2+
+
+License: GPL-2+
+        This program is free software; you can redistribute it and/or modify
+        it under the terms of the GNU General Public License as published by
+        the Free Software Foundation; either version 2 of the License, or
+        (at your option) any later version.
+
+        This program is distributed in the hope that it will be useful,
+        but WITHOUT ANY WARRANTY; without even the implied warranty of
+        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+        GNU General Public License for more details.
+
+        You should have received a copy of the GNU General Public License
+        along with this program; if not, write to the Free Software
+        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ On Debian systems, the complete text of the GNU General Public License can be
+ found in /usr/share/common-licenses/GPL-2 file.
diff --git a/debian/docs b/debian/docs
new file mode 100644 (file)
index 0000000..c4affed
--- /dev/null
@@ -0,0 +1,2 @@
+documentation.txt
+todo.txt
diff --git a/debian/init.d b/debian/init.d
new file mode 100644 (file)
index 0000000..d90834c
--- /dev/null
@@ -0,0 +1,71 @@
+#! /bin/sh
+#              Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+#              Modified for Debian
+#              by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+#
+# Version:     @(#)skeleton  1.9  26-Feb-2001  miquels@cistron.nl
+# /etc/init.d/policyd-weight: v1 2006/11/08 Jan Wagner <waja@cyconet.org>
+
+### BEGIN INIT INFO
+# Provides: policyd-weight
+# Required-Start: $local_fs $network $remote_fs $syslog
+# Required-Stop: $local_fs $network $remote_fs $syslog
+# Default-Start:  2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: start and stop the policyd-weight daemon
+# Description: a Perl policy daemon for the Postfix MTA
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/policyd-weight
+NAME=policyd-weight
+PIDFILE=/var/run/$NAME.pid
+DESC=policyd-weight
+
+test -x $DAEMON || exit 0
+
+# Include policyd-weight defaults if available
+if [ -f /etc/default/policyd-weight ] ; then
+       . /etc/default/policyd-weight
+fi
+
+set -e
+
+case "$1" in
+  start)
+       echo -n "Starting $DESC: "
+               $DAEMON $DAEMON_OPTS start
+       echo "$NAME."
+       ;;
+  stop)
+       echo -n "Stopping $DESC (incl. cache): "
+               $DAEMON -k && start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE && rm -rf $PIDFILE
+       echo "$NAME."
+       ;;
+  dstop)
+       echo -n "Stopping $DESC (without cache): "
+               $DAEMON $DAEMON_OPTS stop
+       echo "$NAME."
+       ;;
+  reload)
+       echo "Reloading $DESC configuration files."
+               $DAEMON $DAEMON_OPTS reload
+       ;;
+  restart|force-reload)
+       echo -n "Restarting $DESC (incl. cache): "
+               $DAEMON -k && $DAEMON $DAEMON_OPTS restart
+       echo "$NAME."
+       ;;
+  drestart)
+       echo -n "Restarting $DESC (without cache): "
+               $DAEMON $DAEMON_OPTS restart
+       echo "$NAME."
+       ;;
+  *)
+       N=/etc/init.d/$NAME
+       echo "Usage: $N {start|stop|dstop|restart|drestart|reload|force-reload}" >&2
+       exit 1
+       ;;
+esac
+
+exit 0
diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644 (file)
index 0000000..65fba45
--- /dev/null
@@ -0,0 +1,3 @@
+01_change_lockpath.dpatch
+02_enable_ipv6.dpatch
+03_cacherejectmsg.dpatch
diff --git a/debian/patches/01_change_lockpath.dpatch b/debian/patches/01_change_lockpath.dpatch
new file mode 100644 (file)
index 0000000..9ff1f08
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 01_change_lockpath.dpatch by Jan Wagner <waja@cyconet.org>
+##
+## DP: Change lockpath to proper location
+
+@DPATCH@
+
+--- policyd-weight-0.1.14.17/policyd-weight    2008-03-29 17:53:05.000000000 +0100
++++ policyd-weight-0.1.14.17/policyd-weight    2008-03-29 17:53:59.000000000 +0100
+@@ -401,7 +401,7 @@
+ my $BL_SKIP_RELEASE   = 10; # skip a RBL for that many times
+
+ ## cache stuff
+-my $LOCKPATH          = '/tmp/.policyd-weight/';    # must be a directory (add
++my $LOCKPATH          = '/var/run/policyd-weight/';    # must be a directory (add
+                                                     # trailing slash)
+
+ my $SPATH             = $LOCKPATH.'/polw.sock';     # socket path for the cache
diff --git a/debian/patches/02_enable_ipv6.dpatch b/debian/patches/02_enable_ipv6.dpatch
new file mode 100644 (file)
index 0000000..ad3f53f
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 02_enable_ipv6.dpatch by Jonas Genannt <jonasge@gmx.net>
+##
+## DP: Enable IPv6
+
+@DPATCH@
+diff -urNad policyd-weight-0.1.15.1~/policyd-weight policyd-weight-0.1.15.1/policyd-weight
+--- policyd-weight-0.1.15.1~/policyd-weight    2008-09-29 22:27:05.000000000 +0200
++++ policyd-weight-0.1.15.1/policyd-weight     2008-09-29 22:27:42.000000000 +0200
+@@ -1742,11 +1742,6 @@
+     my $cansw;
+-    if(index($ip,":") != -1)
+-    { 
+-        #return ('DUNNO IPv6');               # we have no IPv6 support for now
+-    }
+-
+     my $client_name = $attr{client_name}              || '';
+     my $helo        = $attr{helo_name}                || '';
+     my $from        = address_stripped($attr{sender}) || '';
diff --git a/debian/patches/03_cacherejectmsg.dpatch b/debian/patches/03_cacherejectmsg.dpatch
new file mode 100644 (file)
index 0000000..4ad75f5
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_cacherejectmsg.dpatch by Jan Wagner <waja@cyconet.org>
+##
+## DP: Add more verbose reply on cache hit.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' policyd-weight-0.1.15.1~/policyd-weight policyd-weight-0.1.15.1/policyd-weight
+--- policyd-weight-0.1.15.1~/policyd-weight    2008-09-24 10:59:15.000000000 +0200
++++ policyd-weight-0.1.15.1/policyd-weight     2010-10-04 19:24:49.000000000 +0200
+@@ -426,7 +426,7 @@
+ my $CACHEMAXSIZE    = 4000; # at this number of entries cleanup takes place
+-my $CACHEREJECTMSG  = '550 temporarily blocked because of previous errors';
++my $CACHEREJECTMSG  = '550 [cached]  Mail appeared to be SPAM or forged. Ask your Mail/DNS-Administrator to correct HELO and DNS MX settings or to get removed from DNSBLs';
+ my $NTTL            = 1;    # after NTTL retries the cache entry is deleted
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' policyd-weight-0.1.15.1~/policyd-weight.conf.sample policyd-weight-0.1.15.1/policyd-weight.conf.sample
+--- policyd-weight-0.1.15.1~/policyd-weight.conf.sample        2008-03-28 14:44:26.000000000 +0100
++++ policyd-weight-0.1.15.1/policyd-weight.conf.sample 2010-10-04 19:25:15.000000000 +0200
+@@ -111,7 +111,7 @@
+    $CACHEMAXSIZE    = 4000; # at this number of entries cleanup takes place
+-   $CACHEREJECTMSG  = '550 temporarily blocked because of previous errors';
++   $CACHEREJECTMSG  = '550 [cached]  Mail appeared to be SPAM or forged. Ask your Mail/DNS-Administrator to correct HELO and DNS MX settings or to get removed from DNSBLs';
+    $NTTL            = 1;    # after NTTL retries the cache entry is deleted
diff --git a/debian/postinst b/debian/postinst
new file mode 100644 (file)
index 0000000..0ab9ed2
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+# based on arpwatch.postinst: v11 2004/09/15 KELEMEN Peter <fuji@debian.org>
+# postinst: v1 2006/01/12 Jan Wagner <waja@cyconet.org>
+
+set -e
+
+NUSER="polw"
+NGROUP="polw"
+NHOME="/var/lib/$NUSER"
+NGECOS="policy-weight user"
+
+case "$1" in
+       configure)
+               # Take care of group.
+               if NGROUP_ENTRY=`getent group $NGROUP`; then
+                       # group exists
+                       :
+               else
+                       # group does not exist yet
+                       addgroup --quiet --system $NGROUP
+               fi
+
+               # Take care of user.
+               if NUSER_ENTRY=`getent passwd $NUSER`; then
+                       # user exists
+                       adduser --quiet $NUSER $NGROUP
+                       #
+                       if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.1.14-beta-3"; then
+                               usermod -s /bin/false -c "$NGECOS" $NUSER
+                       fi
+               else
+                       # user does not exist yet
+                       adduser --quiet --system        \
+                               --ingroup $NGROUP       \
+                               --gecos "$NGECOS"       \
+                               --home $NHOME           \
+                               --no-create-home        \
+                               --shell /bin/sh         \
+                               --disabled-login        \
+                               --disabled-password     \
+                               --shell /bin/false      \
+                               $NUSER
+               fi
+
+               # be shure we get new startscript
+               if [ -n "$2" ] && dpkg --compare-versions "$2" lt "0.1.14-beta-6"; then
+                       if [ -L /etc/rc2.d/S40policyd-weight ] || [ -L /etc/rc2.d/S20policyd-weight ] ; then
+                               update-rc.d -f policyd-weight remove >/dev/null
+                       fi
+               fi
+
+               # Set up home directory.
+               if [ -d $NHOME ]; then
+                       chown -R ${NUSER}:${NGROUP} $NHOME
+                       chmod -R o-rwX $NHOME
+               fi
+               ;;
+
+       abort-upgrade|abort-remove|abort-deconfigure)
+               ;;
+       *)
+               echo "postinst called with unknown argument \`$1'" >&2
+               exit 1
+               ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/postrm b/debian/postrm
new file mode 100644 (file)
index 0000000..7b31ddd
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/sh
+# based on arpwatch.postrm: v2 2004/09/15 KELEMEN Peter <fuji@debian.org>
+# postrm: v1 2006/10/12 Jan Wagner <waja@cyconet.org>
+
+NUSER="polw"
+NGROUP="polw"
+
+set -e
+
+case "$1" in
+       purge)
+               # find first and last SYSTEM_UID numbers
+               for LINE in `grep SYSTEM_UID /etc/adduser.conf | grep -v "^#"`; do
+                       case $LINE in
+                               FIRST_SYSTEM_UID*)
+                                       FIST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='`
+                                       ;;
+                               LAST_SYSTEM_UID*)
+                                       LAST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='`
+                                       ;;
+                               *)
+                                       ;;
+                       esac
+               done
+               # remove system account if necessary
+               if [ -n "$FIST_SYSTEM_UID" ] && [ -n "$LAST_SYSTEM_UID" ]; then
+                       if USERID=`getent passwd $NUSER | cut -f 3 -d ':'`; then
+                               if [ -n "$USERID" ]; then
+                                       if [ "$FIST_SYSTEM_UID" -le "$USERID" ] && \
+                                               [ "$USERID" -le "$LAST_SYSTEM_UID" ] && \
+                                                       [ -x /usr/sbin/deluser ]; then
+                                                               deluser --quiet $NUSER || true
+                                                               # And then remove the group
+                                                               GROUPID=`getent group $NGROUP | cut -f 3 -d ':'`
+                                                               if [ -n "$GROUPID" ] && [ -x /usr/sbin/delgroup ] ;  then
+                                                                       delgroup --quiet $NGROUP || true
+                                                               fi
+                                       fi
+                               fi
+                       fi
+               fi
+               ;;
+
+       remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+               ;;
+
+       *)
+               echo "postrm called with unknown argument \`$1'" >&2
+               exit 1
+               ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..d1b606b
--- /dev/null
@@ -0,0 +1,45 @@
+#!/usr/bin/make -f
+# written by Jan Wagner <waja@cyconet.org>
+#
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include /usr/share/dpatch/dpatch.make
+
+build: patch-stamp
+
+clean: unpatch
+       dh_testdir
+       dh_testroot
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_prep
+       dh_installdirs
+
+       install -D -m 644 policyd-weight debian/policyd-weight/usr/sbin/policyd-weight
+
+# Build architecture-independent files here.
+binary-indep: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs changes.txt
+       dh_installdocs
+       dh_installinit -- defaults 19 21
+       dh_installman man/man5/policyd-weight.conf.5 man/man8/policyd-weight.8
+       dh_link
+       dh_compress
+       dh_fixperms
+       dh_perl
+       dh_installdeb
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..d3827e7
--- /dev/null
@@ -0,0 +1 @@
+1.0
diff --git a/debian/watch b/debian/watch
new file mode 100644 (file)
index 0000000..97449d9
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://www.policyd-weight.org/releases/policyd-weight-(.*)\.tar\.gz