[Python-apps-commits] r13441 - in packages/policyd-rate-limit/trunk (19 files)

kitterman at users.alioth.debian.org kitterman at users.alioth.debian.org
Thu Jul 28 15:24:43 UTC 2016


    Date: Thursday, July 28, 2016 @ 15:24:42
  Author: kitterman
Revision: 13441

[svn-inject] Applying Debian modifications (0.5.1-1) to trunk

Added:
  packages/policyd-rate-limit/trunk/debian/
  packages/policyd-rate-limit/trunk/debian/changelog
  packages/policyd-rate-limit/trunk/debian/compat
  packages/policyd-rate-limit/trunk/debian/control
  packages/policyd-rate-limit/trunk/debian/copyright
  packages/policyd-rate-limit/trunk/debian/patches/
  packages/policyd-rate-limit/trunk/debian/patches/ignore-init-service.patch
  packages/policyd-rate-limit/trunk/debian/patches/series
  packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.cron.daily
  packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.docs
  packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.init
  packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.manpages
  packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postinst
  packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postrm
  packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.service
  packages/policyd-rate-limit/trunk/debian/rules
  packages/policyd-rate-limit/trunk/debian/source/
  packages/policyd-rate-limit/trunk/debian/source/format
  packages/policyd-rate-limit/trunk/debian/watch


Property changes on: packages/policyd-rate-limit/trunk/debian
___________________________________________________________________
Added: mergeWithUpstream
   + 1

Added: packages/policyd-rate-limit/trunk/debian/changelog
===================================================================
--- packages/policyd-rate-limit/trunk/debian/changelog	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/changelog	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,10 @@
+policyd-rate-limit (0.5.1-1) UNRELEASED; urgency=low
+
+  * Initial release. (Closes: #831456)
+  * Disable the usage of upstream init scripts (patch ignore-init-service.patch)
+    and use policyd-rate-limit.service and policyd-rate-limit.init instead.
+    They are identical to the upstream ones except for /usr/local/bin/ replaced
+    by /usr/bin/. It also let dh_installdeb automatically setup symbolic links
+    in rc* in postinst and postrm.
+
+ -- Valentin Samir <valentin.samir at crans.org>  Mon, 18 Jul 2016 20:19:00 +0200

Added: packages/policyd-rate-limit/trunk/debian/compat
===================================================================
--- packages/policyd-rate-limit/trunk/debian/compat	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/compat	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1 @@
+9

Added: packages/policyd-rate-limit/trunk/debian/control
===================================================================
--- packages/policyd-rate-limit/trunk/debian/control	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/control	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,32 @@
+Source: policyd-rate-limit
+Section: mail
+Priority: optional
+Maintainer: Valentin Samir <valentin.samir at crans.org>
+Build-Depends: debhelper (>= 9),
+               dh-python,
+               python3,
+               python3-setuptools,
+               python-docutils,
+               dpkg-dev (>= 1.17)
+Standards-Version: 3.9.8
+Homepage: https://pypi.python.org/pypi/policyd-rate-limit
+Vcs-Git: https://github.com/nitmir/policyd-rate-limit -b debian
+Vcs-Browser: https://github.com/nitmir/policyd-rate-limit/tree/debian
+X-Python3-Version: >= 3.4
+
+Package: policyd-rate-limit
+Architecture: all
+Depends: ${misc:Depends},
+         ${python3:Depends},
+         adduser
+Suggests: python3-mysqldb,
+            python3-psycopg2
+Enhances: postfix
+Description: postfix policy daemon limiting the number of mails a user can send
+ policyd-rate-limit is a simple postfix policy daemon written in python3
+ allowing to limit the number of mails a user can send over time.
+ Users are identified either via their sasl usernames or their ip addresses.
+ Limitation rules are a list of couples (number of mails, number of seconds).
+ If a user has sent more than number of mails in number of seconds,
+ a configurable error is returned to the user.
+

Added: packages/policyd-rate-limit/trunk/debian/copyright
===================================================================
--- packages/policyd-rate-limit/trunk/debian/copyright	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/copyright	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,23 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: policyd-rate-limit
+Source: https://github.com/nitmir/policyd-rate-limit
+
+Files: *
+Copyright: 2015-2016 Valentin Samir <valentin.samir at crans.org>
+License: GPL-3.0
+
+License: GPL-3.0
+ 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, version 3 of the License.
+ .
+ This package 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, see <https://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

Added: packages/policyd-rate-limit/trunk/debian/patches/ignore-init-service.patch
===================================================================
--- packages/policyd-rate-limit/trunk/debian/patches/ignore-init-service.patch	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/patches/ignore-init-service.patch	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,25 @@
+Description: disable installation by setup.py of init script and unit file installation
+ policyd-rate-limit.service and policyd-rate-limit.init are identical except for
+ /usr/local/bin/ replaced by /usr/bin/. It also let dh_installdeb automatically
+ setup symbolic links in rc* in postinst and postrm.
+Author: Valentin Samir <valentin.samir at crans.org>
+
+---
+
+Last-Update: <2016-07-09>
+
+--- policyd-rate-limit-0.4.1.orig/setup.py
++++ policyd-rate-limit-0.4.1/setup.py
+@@ -23,12 +23,6 @@ def add_data_file(dir, file, check_dir=F
+ # if install as root populate /etc
+ if os.getuid() == 0:
+     add_data_file("/etc", 'policyd_rate_limit/policyd-rate-limit.conf')
+-    add_data_file('/etc/init.d', 'init/policyd-rate-limit')
+-    add_data_file(
+-        "/etc/systemd/system",
+-        'init/policyd-rate-limit.service',
+-        check_dir=True
+-    )
+ # else use user .config dir
+ else:
+     conf_dir = os.path.expanduser("~/.config/")

Added: packages/policyd-rate-limit/trunk/debian/patches/series
===================================================================
--- packages/policyd-rate-limit/trunk/debian/patches/series	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/patches/series	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1 @@
+ignore-init-service.patch

Added: packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.cron.daily
===================================================================
--- packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.cron.daily	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.cron.daily	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# cron script for policyd-rate-limit
+test -x /usr/bin/policyd-rate-limit || exit 0
+/usr/bin/policyd-rate-limit --clean >/dev/null

Added: packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.docs
===================================================================
--- packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.docs	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.docs	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1 @@
+README.rst

Added: packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.init
===================================================================
--- packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.init	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.init	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,85 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          policyd-rate-limit
+# Required-Start:    $remote_fs $network $syslog
+# Required-Stop:     $remote_fs $network $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Postfix policyd rate limiter
+### END INIT INFO
+
+# 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 version 3 for
+# more details.
+#
+# You should have received a copy of the GNU General Public License version 3
+# along with this program; if not, write to the Free Software Foundation, Inc., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# (c) 2015 Valentin Samir
+
+DAEMON="/usr/bin/policyd-rate-limit"
+NAME="policyd-rate-limit"
+DESC="Postfix policyd rate limiter"
+PID="$($DAEMON --get-config pidfile)"
+
+[ -x $DAEMON ] || exit 0
+
+. /lib/lsb/init-functions
+
+stoped(){
+  if [ -f $PID ]; then
+    pid=`cat $PID`
+    if ps -p $pid >/dev/null; then
+      return 1
+    fi
+  fi
+  return 0
+}
+
+start(){
+ if stoped; then
+  log_daemon_msg "Starting $DESC" "$NAME"
+  /sbin/start-stop-daemon --start --pidfile $PID -b --exec $DAEMON
+  log_end_msg $?
+ else
+  log_action_msg "Already running: $NAME"
+ fi
+}
+
+stop(){
+ if stoped; then
+  log_action_msg "Not running: $NAME"
+ else
+  log_daemon_msg "Stopping $DESC" "$NAME"
+  /sbin/start-stop-daemon --stop --pidfile $PID --retry 30
+  log_end_msg $?
+ fi
+}
+
+status(){
+    status_of_proc -p "$PID" "$DAEMON" "$NAME"
+}
+
+case $1 in
+  start) start
+  ;;
+  stop) stop
+  ;;
+  restart)
+    stop && start
+  ;;
+  force-reload)
+    stop && start
+  ;;
+  status)
+    status
+  ;;
+  *)
+   echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
+   exit 1
+  ;;
+esac
+
+exit $?

Added: packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.manpages
===================================================================
--- packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.manpages	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.manpages	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,2 @@
+build/man/policyd-rate-limit.conf.5
+build/man/policyd-rate-limit.8

Added: packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postinst
===================================================================
--- packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postinst	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postinst	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,50 @@
+#!/bin/sh
+# postinst script
+#
+# 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>
+#       * <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
+#
+
+case "$1" in
+    configure)
+        # if using default user and group, continue, else let the sysadmin deal with it
+        if [ "$(policyd-rate-limit --get-config user)" = "policyd-rate-limit" ] &&
+            [ "$(policyd-rate-limit --get-config group)" = "policyd-rate-limit" ];
+        then
+            # if the default user/group do not exists, create it and set config ownership
+            # if it already exists (e.g. package upgrade) do nothing
+            if ! id -u policyd-rate-limit >/dev/null 2>&1; then
+                adduser --system --group --home /run/policyd-rate-limit \
+                    --no-create-home --quiet policyd-rate-limit
+                chown root:policyd-rate-limit /etc/policyd-rate-limit.conf
+                chmod 640 /etc/policyd-rate-limit.conf
+            fi
+        fi
+    ;;
+
+    abort-remove|abort-deconfigure|abort-upgrade)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0

Added: packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postrm
===================================================================
--- packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postrm	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.postrm	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,42 @@
+#!/bin/sh
+# postrm script for policyd-rate-limit
+#
+# 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 https://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+        rm -rf /var/lib/policyd-rate-limit
+    ;;
+
+    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
+

Added: packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.service
===================================================================
--- packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.service	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/policyd-rate-limit.service	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,12 @@
+[Unit]
+Description=Postfix policyd rate limiter
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/policyd-rate-limit
+KillSignal=SIGINT
+StandardOutput=syslog
+StandardError=syslog
+
+[Install]
+WantedBy=multi-user.target

Added: packages/policyd-rate-limit/trunk/debian/rules
===================================================================
--- packages/policyd-rate-limit/trunk/debian/rules	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/rules	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,28 @@
+#! /usr/bin/make -f
+
+#export DH_VERBOSE = 1
+export PYBUILD_NAME = policyd-rate-limit
+
+PKD  = $(abspath $(dir $(MAKEFILE_LIST)))
+PKG  = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog --show-field=Source))
+VER  ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog -SVersion | cut -d- -f1)
+
+%:
+	dh $@ --with python3 --buildsystem=pybuild
+
+override_dh_auto_build:
+	make man_files
+	dh_auto_build
+
+override_dh_auto_clean:
+	dh_auto_clean
+	make clean
+
+get-orig-source:  $(info I: $(PKG)_$(VER))
+	@echo "# Downloading..."
+	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
+
+set-source: get-orig-source
+	rm -rf .pc
+	tar --strip-components=1 -xf policyd-rate-limit_$(VER).orig.tar.gz
+	mv policyd-rate-limit_$(VER).orig.tar.gz ../


Property changes on: packages/policyd-rate-limit/trunk/debian/rules
___________________________________________________________________
Added: svn:executable
   + *

Added: packages/policyd-rate-limit/trunk/debian/source/format
===================================================================
--- packages/policyd-rate-limit/trunk/debian/source/format	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/source/format	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1 @@
+3.0 (quilt)

Added: packages/policyd-rate-limit/trunk/debian/watch
===================================================================
--- packages/policyd-rate-limit/trunk/debian/watch	                        (rev 0)
+++ packages/policyd-rate-limit/trunk/debian/watch	2016-07-28 15:24:42 UTC (rev 13441)
@@ -0,0 +1,4 @@
+version=3
+opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
+https://pypi.debian.net/policyd-rate-limit/policyd-rate-limit-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
+




More information about the Python-apps-commits mailing list