From 2ecd76bed59b79154de9d03c543529b979021208 Mon Sep 17 00:00:00 2001 From: Sergey Dryabzhinsky Date: Mon, 2 May 2016 09:16:07 +0300 Subject: [PATCH] First version of Debian packaging files --- packaging/debian/changelog | 5 + packaging/debian/compat | 1 + packaging/debian/control | 20 +++ packaging/debian/copyright | 40 ++++++ packaging/debian/denyhosts-server.dirs | 3 + packaging/debian/denyhosts-server.init | 75 +++++++++++ packaging/debian/denyhosts-server.install | 4 + packaging/debian/denyhosts-server.links | 1 + packaging/debian/denyhosts-server.logrotate | 16 +++ packaging/debian/denyhosts-server.manpages | 1 + packaging/debian/denyhosts-server.postinst | 55 ++++++++ packaging/debian/denyhosts-server.postrm | 27 ++++ packaging/debian/denyhosts-server.service | 18 +++ packaging/debian/denyhosts-server.upstart | 41 ++++++ packaging/debian/docs | 6 + packaging/debian/etc/denyhosts-server.conf | 122 ++++++++++++++++++ .../denyhosts-server-stats.conf | 35 +++++ .../denyhosts-server-xmlrpc.conf | 23 ++++ .../debian/patches/01-edit-setup-script.patch | 42 ++++++ packaging/debian/patches/series | 1 + packaging/debian/rules | 21 +++ packaging/debian/source/format | 1 + packaging/debian/watch | 3 + 23 files changed, 561 insertions(+) create mode 100644 packaging/debian/changelog create mode 100644 packaging/debian/compat create mode 100644 packaging/debian/control create mode 100644 packaging/debian/copyright create mode 100644 packaging/debian/denyhosts-server.dirs create mode 100644 packaging/debian/denyhosts-server.init create mode 100644 packaging/debian/denyhosts-server.install create mode 100644 packaging/debian/denyhosts-server.links create mode 100644 packaging/debian/denyhosts-server.logrotate create mode 100644 packaging/debian/denyhosts-server.manpages create mode 100644 packaging/debian/denyhosts-server.postinst create mode 100644 packaging/debian/denyhosts-server.postrm create mode 100644 packaging/debian/denyhosts-server.service create mode 100644 packaging/debian/denyhosts-server.upstart create mode 100644 packaging/debian/docs create mode 100644 packaging/debian/etc/denyhosts-server.conf create mode 100644 packaging/debian/etc/nginx/sites-available/denyhosts-server-stats.conf create mode 100644 packaging/debian/etc/nginx/sites-available/denyhosts-server-xmlrpc.conf create mode 100644 packaging/debian/patches/01-edit-setup-script.patch create mode 100644 packaging/debian/patches/series create mode 100755 packaging/debian/rules create mode 100644 packaging/debian/source/format create mode 100644 packaging/debian/watch diff --git a/packaging/debian/changelog b/packaging/debian/changelog new file mode 100644 index 0000000..9b9acd1 --- /dev/null +++ b/packaging/debian/changelog @@ -0,0 +1,5 @@ +denyhosts-server (2.0.0-1) trusty; urgency=medium + + * Initial Release. + + -- Sergey Dryabzhinsky Sun, 10 Jan 2016 01:17:46 +0300 diff --git a/packaging/debian/compat b/packaging/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/packaging/debian/compat @@ -0,0 +1 @@ +7 diff --git a/packaging/debian/control b/packaging/debian/control new file mode 100644 index 0000000..1d6b549 --- /dev/null +++ b/packaging/debian/control @@ -0,0 +1,20 @@ +Source: denyhosts-server +Section: net +Priority: optional +Maintainer: Jan-Pascal van Best +Uploaders: Sergey Dryabzhinsky +Build-Depends: debhelper (>= 7.0.50~), python (>= 2.6.6-3~), dh-python | debhelper (>= 8), python-minify | python2.7-pip-minify | python2.6-pip-minify +Standards-Version: 3.9.3 +Homepage: https://github.com/janpascal/denyhosts_sync.git + +Package: denyhosts-server +Architecture: all +Depends: lsb-base (>= 3.1-13), ${python:Depends}, ${misc:Depends}, + python-twisted, python-ipaddr, python-jinja2, python-numpy, python-geoip, + python-matplotlib, python-twistar | python2.7-pip-twistar | python2.6-pip-twistar +Recommends: nginx | nginx-light | nginx-hosting | nginx-full +Description: denyhosts-server is a server for denyhosts clients + denyhosts-server is a server that allows denyhosts clients to share + blocked IP addresses. It is intended to be a drop-in replacement for + the service at xmlrpc.denyhosts.net that up to now has been provided + by the original author of denyhosts. diff --git a/packaging/debian/copyright b/packaging/debian/copyright new file mode 100644 index 0000000..fd0631e --- /dev/null +++ b/packaging/debian/copyright @@ -0,0 +1,40 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: DenyHosts-Server +Upstream-Contact: Jan-Pascal van Best +Source: https://github.com/janpascal/denyhosts_sync + +Files: * +Copyright: 2005-2006, Phil Schwartz + 2014-2015, Jesse Smith + 2012, 2014-2015, Matt Ruffalo +License: GPL-2+ + 2015, Jan-Pascal van Best janpascal@vanbest.org +License: GPL-3 + +Files: debian/* +Copyright: 2006, Marco Bertorello + 2011, Kyle Willmon +License: GPL-2+ + 2015, Sergey Dryabzhinsky +License: GPL-3 + +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. + . + 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 package; 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, version 2, can be found in '/usr/share/common-licenses/GPL-2'. + . + On Debian systems, the complete text of the GNU General Public + License, version 3, can be found in '/usr/share/common-licenses/GPL-3'. diff --git a/packaging/debian/denyhosts-server.dirs b/packaging/debian/denyhosts-server.dirs new file mode 100644 index 0000000..6e7c985 --- /dev/null +++ b/packaging/debian/denyhosts-server.dirs @@ -0,0 +1,3 @@ +/var/lib/denyhosts-server/static/graph +/var/www/sites/denyhosts-server +/var/log/denyhosts-server diff --git a/packaging/debian/denyhosts-server.init b/packaging/debian/denyhosts-server.init new file mode 100644 index 0000000..70ef84a --- /dev/null +++ b/packaging/debian/denyhosts-server.init @@ -0,0 +1,75 @@ +#! /bin/sh +# +### BEGIN INIT INFO +# Provides: denyhosts-server +# Required-Start: $syslog $network $remote_fs +# Required-Stop: $syslog $network $remote_fs +# Should-Start: mysql +# Should-Stop: mysql +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: DenyHosts synchronisation service +# Description: Service that allows DenyHosts clients to share blocked IP +# addresses. +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/denyhosts-server +DESC="DenyHosts sync server" +NAME=`basename $DAEMON` +PIDFILE=/var/run/$NAME.pid +DAEMONUSER=denyhosts-server +DAEMONGROUP=denyhosts +WORKDIR=/var/lib/denyhosts-server +CONFIG_FILE=/etc/denyhosts-server.conf +QUIET=--quiet + +test -x $DAEMON || exit 0 + +# Include defaults if available +if [ -f /etc/default/denyhosts-server ] ; then + . /etc/default/denyhosts-server +fi +DAEMON_ARGS="-c $CONFIG_FILE" + +#set -e + +. /lib/lsb/init-functions + +case "$1" in + start) + log_begin_msg "Starting $DESC: $NAME" + start-stop-daemon --start $QUIET --chuid $DAEMONUSER:$DAEMONGROUP \ + --chdir $WORKDIR \ + --make-pidfile --pidfile $PIDFILE --background \ + --startas $DAEMON -- $DAEMON_ARGS + log_end_msg $? + ;; + stop) + log_begin_msg "Stopping $DESC: $NAME" + start-stop-daemon --stop $QUIET --retry=TERM/30/KILL/5 --chuid $DAEMONUSER:$DAEMONGROUP \ + --chdir $WORKDIR \ + --pidfile $PIDFILE \ + --startas $DAEMON -- $DAEMON_ARGS + log_end_msg $? + ;; + restart) + $0 stop + $0 start + ;; + status) + status_of_proc "$DAEMON" $NAME + ;; + reload|force-reload) + log_begin_msg "Reloading $DESC: $NAME" + start-stop-daemon --stop --signal HUP --pidfile $PIDFILE + log_end_msg $? + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/packaging/debian/denyhosts-server.install b/packaging/debian/denyhosts-server.install new file mode 100644 index 0000000..b7837b1 --- /dev/null +++ b/packaging/debian/denyhosts-server.install @@ -0,0 +1,4 @@ +static/css/*.min.* /var/lib/denyhosts-server/static/css +static/js/*.min.* /var/lib/denyhosts-server/static/js +template /var/lib/denyhosts-server/ +debian/etc/* etc/ diff --git a/packaging/debian/denyhosts-server.links b/packaging/debian/denyhosts-server.links new file mode 100644 index 0000000..1fac74e --- /dev/null +++ b/packaging/debian/denyhosts-server.links @@ -0,0 +1 @@ +/var/lib/denyhosts-server/static /var/www/sites/denyhosts-server/static diff --git a/packaging/debian/denyhosts-server.logrotate b/packaging/debian/denyhosts-server.logrotate new file mode 100644 index 0000000..f891c5e --- /dev/null +++ b/packaging/debian/denyhosts-server.logrotate @@ -0,0 +1,16 @@ +/var/log/denyhosts-server/*.log { + create 0640 denyhosts adm + missingok + daily + rotate 32 + compress + delaycompress + notifempty + postrotate + if [ -x /usr/sbin/invoke-rc.d ]; then \ + invoke-rc.d denyhosts-server reload > /dev/null; \ + else \ + /etc/init.d/denyhosts-server reload > /dev/null; \ + fi + endscript +} diff --git a/packaging/debian/denyhosts-server.manpages b/packaging/debian/denyhosts-server.manpages new file mode 100644 index 0000000..d3a1dc6 --- /dev/null +++ b/packaging/debian/denyhosts-server.manpages @@ -0,0 +1 @@ +denyhosts-server.1 diff --git a/packaging/debian/denyhosts-server.postinst b/packaging/debian/denyhosts-server.postinst new file mode 100644 index 0000000..02d3b74 --- /dev/null +++ b/packaging/debian/denyhosts-server.postinst @@ -0,0 +1,55 @@ +#!/bin/sh + +set -e + +CNF=/etc/denyhosts-server.conf +WD=/var/lib/denyhosts-server +# denyhosts-server user +DSU=denyhosts-server +DSG=denyhosts +DAEMON=/usr/sbin/denyhosts-server + +case "$1" in + configure) + if [ -z "$2" ]; then + echo "" + echo "Add user $DSU if not exists." + + addgroup --system $DSG || true + adduser --system --no-create-home --home $WD \ + --ingroup $DSG --disabled-password --disabled-login --gecos /dev/null $DSU || true + usermod -aG www-data $DSU || true + # For init/upgrade db + usermod -s /bin/sh $DSU || true + + chown -R $DSU:$DSG /var/log/denyhosts-server + chown -R $DSU:www-data /var/lib/denyhosts-server + chown -R $DSU:www-data /var/www/sites/denyhosts-server + + echo "" + service denyhosts-server stop || true + echo "Init denyhosts-server database." + su -c "cd $WD; $DAEMON -c $CNF --recreate-database --force" - $DSU + echo "" + else + echo "" + echo "Upgrade denyhosts-server database." + service denyhosts-server stop || true + su -c "cd $WD; $DAEMON -c $CNF --evolve-database --force" - $DSU + echo "" + fi + service nginx reload || true + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument '$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/packaging/debian/denyhosts-server.postrm b/packaging/debian/denyhosts-server.postrm new file mode 100644 index 0000000..a36a51e --- /dev/null +++ b/packaging/debian/denyhosts-server.postrm @@ -0,0 +1,27 @@ +#!/bin/sh +# postrm script for denyhosts + +set -e + +case "$1" in + purge) + rm -fr /var/log/denyhosts-server + rm -fr /var/lib/denyhosts-server + deluser denyhosts-server || true + deluser --group --only-if-empty denyhosts || true + service nginx reload || true + rm -rf /var/www/sites/denyhosts-server + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + +esac + +#DEBHELPER# + +exit 0 diff --git a/packaging/debian/denyhosts-server.service b/packaging/debian/denyhosts-server.service new file mode 100644 index 0000000..b8c865f --- /dev/null +++ b/packaging/debian/denyhosts-server.service @@ -0,0 +1,18 @@ +[Unit] +Description=DenyHosts synchronisation service +After=syslog.target + +[Service] +Type=simple +User=denyhosts-server +Group=denyhosts +EnvironmentFile=-/etc/default/denyhosts-server +WorkingDirectory=/var/lib/denyhosts-server +ExecStart=/usr/sbin/denyhosts-server -c /etc/denyhosts-server.conf +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure +StandardOutput=syslog +StandardError=syslog + +[Install] +WantedBy=multi-user.target diff --git a/packaging/debian/denyhosts-server.upstart b/packaging/debian/denyhosts-server.upstart new file mode 100644 index 0000000..45daea0 --- /dev/null +++ b/packaging/debian/denyhosts-server.upstart @@ -0,0 +1,41 @@ +author "Sergey Dryabzhinsky " +description "Handles starting of DenyHosts Sync on server reboot, or in the event of an error" + +env NAME=denyhosts-server +env NAME2="DenyHosts sync server" +env DAEMON="/usr/sbin/denyhosts-server" +env CONFIG="/etc/denyhosts-server.conf" +env PIDFILE="/var/run/denyhosts-server.pid" +env DAEMONUSER=denyhosts-server +env DAEMONGROUP=denyhosts +env WORKDIR=/var/lib/denyhosts-server + +start on runlevel [2345] +stop on runlevel [016] + +expect daemon + +respawn +respawn limit 10 5 + +exec start-stop-daemon --start --chuid $DAEMONUSER:$DAEMONGROUP \ + --chdir $WORKDIR \ + --make-pidfile --pidfile $PIDFILE --background \ + --startas $DAEMON -- -c $CONFIG + +pre-start script + if [ -f $PIDFILE ]; then + pid=$(cat $PIDFILE) + if kill -0 "$pid" > /dev/null; then + start-stop-daemon --stop --quiet --retry 5 --pidfile $PIDFILE + echo "Restarting $NAME2" | logger -t "$NAME" + else + echo "$NAME2 started" | logger -t "$NAME" + fi + rm -f $PIDFILE + fi +end script + +pre-stop script + echo "$NAME2 stopped" | logger -t "$NAME" +end script diff --git a/packaging/debian/docs b/packaging/debian/docs new file mode 100644 index 0000000..202e662 --- /dev/null +++ b/packaging/debian/docs @@ -0,0 +1,6 @@ +LICENSE.md +README.md +changelog.txt +denyhosts-server.conf.example +denyhosts-server.init.example +denyhosts-server.service.example diff --git a/packaging/debian/etc/denyhosts-server.conf b/packaging/debian/etc/denyhosts-server.conf new file mode 100644 index 0000000..53fae6c --- /dev/null +++ b/packaging/debian/etc/denyhosts-server.conf @@ -0,0 +1,122 @@ +# section database. All configuration items besides 'type' are passed as-is +# to the database connect() function + +# Database settings. Depending on the database type, you can add several +# parameters to connect to the database. + +# For sqlite3, just fill in the database filename as "database" +# sqlite3 is not suitable for a high volume server + +# For PostgreSQL use the following parameters: +# type - psycopg2 +# dbname – the database name (only in the dsn string) +# database – the database name (only as keyword argument) +# user – user name used to authenticate +# password – password used to authenticate +# host – database host address (defaults to UNIX socket if not provided) +# port – connection port number (defaults to 5432 if not provided) + + +# For mysql, use the following parameters: +# host – name of host to connect to. Default: use the local host via a UNIX socket (where applicable) +# user – user to authenticate as. Default: current effective user. +# passwd – password to authenticate with. Default: no password. +# db – database to use. Default: no default database. +# port – TCP port of MySQL server. Default: standard port (3306). +# unix_socket – location of UNIX socket. Default: use default location or TCP for remote hosts. +# connect_timeout – Abort if connect is not completed within given number of seconds. Default: no timeout (?) + +[database] +# Type of database. Choice of sqlite3, MySQLdb, psycopg2 (PostgreSQL) +# Default: sqlite3 +type: sqlite3 + +# Database name. Default: /var/lib/denyhosts-server/denyhosts.sqlite +database: /var/lib/denyhosts-server/denyhosts.sqlite + +# Maximum size of database connection pool. Default: 5 +# For high volume servers, set this to 100 or so. +cp_max: 16 + +[sync] +# Maximum number of cracker IP addresses reported back to +# denyhosts clients per sync. Default: 50 +#max_reported_crackers: 50 + +# TCP addr to listen on. Default: 0.0.0.0 +#listen_host: 127.0.0.1 + +# TCP port to listen on. Default: 9911 +#listen_port: 9911 + +# Enable debugging methods. See debug_views.py for details. +# Default: no +#enable_debug_methods: no + +# Legacy server to use as a source of bad hosts, to bootstrap +# the database. Leave empty if you don't want to use a legacy server. +# Set legacy_server to http://xmlrpc.denyhosts.net:9911 in order to +# use the legacy server maintained by the original DenyHosts author +# Default: No legacy server configured. +#legacy_server: + +# How often (in seconds) to download hosts from legacy server. +# Default: 300 seconds (5 minutes) +#legacy_frequency: 300 + +# Threshold value for legacy server. Default: 10 +#legacy_threshold = 10 + +# Resiliency value for legacy server (in seconds) +# Default: 10800 (three hours) +#legacy_resiliency = 10800 + +[maintenance] +# Maintenance interval in seconds (3600 = one hour; 86400 = one day) +# Default: 3600 +#interval_seconds: 3600 + +# Number of days before reports are expired. Default: 30 +expiry_days: 366 + +# Number of days before hosts retrieved from legacy server are expired. Default: 30 +#legacy_expiry_days: 30 + +[logging] +# Location of the log file. Default: /var/log/denyhosts-server/denyhosts-server.log +logfile: /var/log/denyhosts-server/denyhosts-server.log + +# Log level. One of CRITICAL, ERROR, WARNING, INFO of DEBUG +# Default: INFO. Set to WARNING for high-volume server +#loglevel: INFO + +[stats] +# How often (in seconds) to update the statistics HTML page +# and graphs. Default: 600 (10 minutes) +#update_frequency: 600 + +# Location of static files. Place the css directory containing +# bootstrap.min.css and the js directory containing bootstrap.min.js +# here. Default: static/ under the project root +#static_dir: static + +# Location of graph files. The server will cache the generated statistic +# graph images here. This directory should be writable by the server. +# Default: static/graph +#graph_dir: static/graph + +# Location of template files. +# Default: template +#template_dir: template + +# Whether to resolve hostnames for the IP addresses in the statistics +# Default: yes +resolve_hostnames: no + +# TCP addr to serve statistics. Can be the same a the listen_host in the +# [sync] section. Default: 0.0.0.0 +#listen_host: 127.0.0.1 + +# TCP port to serve statistics. Can be the same a the listen_port in the +# [sync] section. Default: 9911 +#listen_port: 8811 diff --git a/packaging/debian/etc/nginx/sites-available/denyhosts-server-stats.conf b/packaging/debian/etc/nginx/sites-available/denyhosts-server-stats.conf new file mode 100644 index 0000000..ae2c7cb --- /dev/null +++ b/packaging/debian/etc/nginx/sites-available/denyhosts-server-stats.conf @@ -0,0 +1,35 @@ +### +# Do copy this file into .conf +# It can be overwritten by pkg +# + +server { + listen 80; + + root /var/www/sites/denyhosts-server; + index stats.html; + + server_name denyhosts-server; + + set $backend http://127.0.0.1:8811; + + location = / { + include proxy_params; + proxy_pass $backend; + } + + location / { + try_files $uri $uri/ =404; + } + + location /static/graph { + root /var/lib/denyhosts-server; + try_files $uri $uri/ =404; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +} diff --git a/packaging/debian/etc/nginx/sites-available/denyhosts-server-xmlrpc.conf b/packaging/debian/etc/nginx/sites-available/denyhosts-server-xmlrpc.conf new file mode 100644 index 0000000..7e65f84 --- /dev/null +++ b/packaging/debian/etc/nginx/sites-available/denyhosts-server-xmlrpc.conf @@ -0,0 +1,23 @@ +### +# Do copy this file into .conf +# It can be overwritten by pkg +# + +server { + listen 80; + + root /var/www/sites/denyhosts-server; + + server_name xmlrpc.denyhosts-server; + + location / { + include proxy_params; + proxy_pass http://127.0.0.1:9911; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +} diff --git a/packaging/debian/patches/01-edit-setup-script.patch b/packaging/debian/patches/01-edit-setup-script.patch new file mode 100644 index 0000000..752126b --- /dev/null +++ b/packaging/debian/patches/01-edit-setup-script.patch @@ -0,0 +1,42 @@ +--- a/setup.py ++++ b/setup.py +@@ -11,24 +11,24 @@ + description='DenyHosts Synchronisation Server', + author='Jan-Pascal van Best', + author_email='janpascal@vanbest.org', +- url='http://www.github.com/janpascal/denyhosts_sync_server', ++ url='https://github.com/janpascal/denyhosts_sync', + packages=['denyhosts_server'], +- install_requires=["Twisted", "twistar", "ipaddr", "jinja2", "numpy", "matplotlib", "GeoIP", "minify"], ++# install_requires=["Twisted", "twistar", "ipaddr", "jinja2", "numpy", "matplotlib", "GeoIP", "minify"], + scripts=['scripts/denyhosts-server'], + data_files=[ +- ('static/js', glob('static/js/*.min.js')), +- ('static/css', glob('static/css/*.min.css')), +- ('static/graph', glob('static/graph/README')), +- ('template', glob('template/*')), +- ('docs', [ +- 'README.md', +- 'LICENSE.md', +- 'changelog.txt', +- 'denyhosts-server.conf.example', +- 'denyhosts-server.service.example', +- 'denyhosts-server.init.example' +- ] +- ), ++# ('static/js', glob('static/js/*.min.js')), ++# ('static/css', glob('static/css/*.min.css')), ++# ('static/graph', glob('static/graph/README')), ++# ('template', glob('template/*')), ++# ('docs', [ ++# 'README.md', ++# 'LICENSE.md', ++# 'changelog.txt', ++# 'denyhosts-server.conf.example', ++# 'denyhosts-server.service.example', ++# 'denyhosts-server.init.example' ++# ] ++# ), + ], + license=""" + Copyright (C) 2015 Jan-Pascal van Best diff --git a/packaging/debian/patches/series b/packaging/debian/patches/series new file mode 100644 index 0000000..75fea24 --- /dev/null +++ b/packaging/debian/patches/series @@ -0,0 +1 @@ +01-edit-setup-script.patch diff --git a/packaging/debian/rules b/packaging/debian/rules new file mode 100755 index 0000000..978b30e --- /dev/null +++ b/packaging/debian/rules @@ -0,0 +1,21 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# + +DESTDIR := $(CURDIR)/debian/denyhosts-server + +%: + dh --with python2 $@ + +override_dh_auto_install: + python setup.py minify_css minify_js install --no-compile -O0 --force \ + --root=$(DESTDIR) \ + --install-scripts=usr/sbin + +override_dh_clean: + rm -fv static/*/*.min.* + rm -fr *.egg-info + dh_clean + +override_dh_installchangelogs: + dh_installchangelogs changelog.txt diff --git a/packaging/debian/source/format b/packaging/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/packaging/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/packaging/debian/watch b/packaging/debian/watch new file mode 100644 index 0000000..0f8ef8b --- /dev/null +++ b/packaging/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/denyhosts_sync-$1\.tar\.gz/ \ + https://github.com/janpascal/denyhosts_sync/tags .*/v?(\d\S*)\.tar\.gz debian uupdate