[apertium-apy] 01/01: Imported Debian patch 0.1.0~r61159-1

Kartik Mistry kartik at moszumanska.debian.org
Thu Jul 2 13:50:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

kartik pushed a commit to branch master
in repository apertium-apy.

commit 6fbab8b458d016758f8111361bd6cb831c8e9f7b
Author: Kartik Mistry <kartik at debian.org>
Date:   Thu Jul 2 19:02:20 2015 +0530

    Imported Debian patch 0.1.0~r61159-1
---
 debian/README.source          |   7 ++
 debian/apertium-apy.init      | 181 ++++++++++++++++++++++++++++++++++++++++++
 debian/apertium-apy.install   |   5 ++
 debian/apertium-apy.logrotate |   9 +++
 debian/apertium-apy.postinst  |  56 +++++++++++++
 debian/apertium-apy.postrm    |  60 ++++++++++++++
 debian/apertium-apy.service   |  19 +++++
 debian/apertium-apy.upstart   |  16 ++++
 debian/changelog              |   5 ++
 debian/compat                 |   1 +
 debian/control                |  35 ++++++++
 debian/copyright              |  23 ++++++
 debian/rules                  |  12 +++
 debian/source/format          |   1 +
 debian/source/options         |   1 +
 debian/watch                  |   1 +
 16 files changed, 432 insertions(+)

diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..535fcd7
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,7 @@
+apertium-apy for Debian
+-----------------------
+
+apertium-apy is part of apertium-tools from upstream Apertium repository.
+
+ -- Kartik Mistry <kartik at debian.org>  Wed, 08 Oct 2014 21:21:33 +0530
+
diff --git a/debian/apertium-apy.init b/debian/apertium-apy.init
new file mode 100644
index 0000000..54d193a
--- /dev/null
+++ b/debian/apertium-apy.init
@@ -0,0 +1,181 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          apertium-apy
+# 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: Apertium APY service
+# Description:       Apertium APY is simple API for Apertium written in Python3
+### END INIT INFO
+
+# Authors: Gabriel Wicke <gwicke at wikimedia.org>,
+#          Kartik Mistry <kmistry at wikimedia.org>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Apertium APY service"
+NAME=apertium-apy
+SCRIPT_PATH=/usr/share/apertium-apy/servlet.py
+DAEMON="/usr/bin/python3 $SCRIPT_PATH /usr/share/apertium/modes"
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+LC_ALL=en_US.utf-8
+
+# Exit if the package is not installed
+[ -e "$SCRIPT_PATH" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# export the port and host env vars, if set
+export PORT
+export INTERFACE
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+	# up the number of fds [sockets] from 1024
+	ulimit -n 64000
+
+	# Return
+	#   0 if daemon has been started
+	#   1 if daemon was already running
+	#   2 if daemon could not be started
+
+	# calling /bin/sh is a hack needed to get output redirection on Ubuntu
+	# 12.04 LTS, see below
+	start-stop-daemon --start --quiet --pidfile $PIDFILE -bm \
+		-c apertium:apertium --test \
+		--exec /bin/sh -- \
+		-c "$DAEMON $DAEMON_ARGS >> /var/log/apertium/apertium-apy.log 2>&1" \
+		|| return 1
+	start-stop-daemon --start --quiet --pidfile $PIDFILE -bm \
+		-c apertium:apertium \
+		--exec /bin/sh -- \
+		-c "$DAEMON $DAEMON_ARGS >> /var/log/apertium/apertium-apy.log 2>&1" \
+		|| return 2
+	echo "Started apertium-apy on port $PORT"
+
+	# Cleaner version of the above, but does not work with Ubuntu 12.04
+	# LTS as the --no-close parameter is not yet supported there
+	#start-stop-daemon --start --quiet --pidfile $PIDFILE -bm --no-close \
+	#	-c apertium:apertium \
+	#	--exec $DAEMON -- $DAEMON_ARGS >> /var/log/apertium/apertium-apy.log 2>&1 \
+	#	|| return 2
+
+	# Add code here, if necessary, that waits for the process to be ready
+	# to handle requests from services started subsequently which depend
+	# on this one.  As a last resort, sleep for some time.
+    sleep 5
+}
+
+#
+# Function that stops the daemon/service
+#
+do_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 occurred
+	start-stop-daemon --stop --quiet --retry=TERM/60/KILL/5 --pidfile $PIDFILE --name $NAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+	# Wait for children to finish too if this is a daemon that forks
+	# and if the daemon is only ever run from this initscript.
+	# If the above conditions are not satisfied then add some other code
+	# that waits for the process to drop all resources that could be
+	# needed by services started subsequently.  A last resort is to
+	# sleep for some time.
+	start-stop-daemon --stop --quiet --oknodo --retry=0/5/KILL/5 --exec $DAEMON
+	[ "$?" = 2 ] && return 2
+	# Many daemons don't delete their pidfiles when they exit.
+	rm -f $PIDFILE
+	return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+	#
+	# If the daemon can reload its configuration without
+	# restarting (for example, when it is sent a SIGHUP),
+	# then implement that here.
+	#
+	start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+	return 0
+}
+
+case "$1" in
+  start)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  stop)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  status)
+	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+	;;
+  #reload|force-reload)
+	#
+	# If do_reload() is not implemented then leave this commented out
+	# and leave 'force-reload' as an alias for 'restart'.
+	#
+	#log_daemon_msg "Reloading $DESC" "$NAME"
+	#do_reload
+	#log_end_msg $?
+	#;;
+  restart|force-reload)
+	#
+	# If the "reload" option is implemented then remove the
+	# 'force-reload' alias
+	#
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+		# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+	exit 3
+	;;
+esac
diff --git a/debian/apertium-apy.install b/debian/apertium-apy.install
new file mode 100644
index 0000000..0e088aa
--- /dev/null
+++ b/debian/apertium-apy.install
@@ -0,0 +1,5 @@
+*.py usr/share/apertium-apy
+Makefile usr/share/apertium-apy
+serverlist-example usr/share/doc/apertium-apy
+tools/*.py usr/share/apertium-apy
+tools/*.sql usr/share/apertium-apy
diff --git a/debian/apertium-apy.logrotate b/debian/apertium-apy.logrotate
new file mode 100644
index 0000000..0182a2f
--- /dev/null
+++ b/debian/apertium-apy.logrotate
@@ -0,0 +1,9 @@
+/var/log/apertium/apertium-apy.log {
+    daily
+    copytruncate
+    missingok
+    compress
+    notifempty
+    rotate 15
+    size 256M
+}
diff --git a/debian/apertium-apy.postinst b/debian/apertium-apy.postinst
new file mode 100644
index 0000000..60a4ba4
--- /dev/null
+++ b/debian/apertium-apy.postinst
@@ -0,0 +1,56 @@
+#!/bin/sh
+# postinst script for apertium
+#
+# 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>
+#        * <postinst> `abort-remove'
+#        * <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)
+    # make sure that the apertium user exists. Simplest portable way to check
+    # is to chown something, so we'll create the directories that we need here.
+
+    makedir() {
+        if [ ! -d $1 ]; then
+            mkdir $1
+        fi
+        chown -R $2 $1 && chmod $3 $1
+    }
+
+    cd /var/log
+    makedir apertium root:root 700
+    chgrp apertium apertium 2>/dev/null || addgroup --system apertium
+    chown apertium apertium 2>/dev/null || adduser --system --home /var/lib/apertium --no-create-home \
+                                           --disabled-password --ingroup apertium apertium
+    # Now that we have the user ready, chown & chmod the log dir
+    makedir apertium apertium:apertium 700
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst 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
diff --git a/debian/apertium-apy.postrm b/debian/apertium-apy.postrm
new file mode 100644
index 0000000..db11800
--- /dev/null
+++ b/debian/apertium-apy.postrm
@@ -0,0 +1,60 @@
+#!/bin/sh
+# postrm script for apertium
+#
+# 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 http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+
+    # Delete user; recipe from
+    # https://wiki.debian.org/AccountHandlingInMaintainerScripts
+
+    USERNAME=apertium
+    if [ -x "$(command -v deluser)" ]; then
+        deluser --quiet --system $USERNAME > /dev/null || true
+    else
+        echo >&2 "not removing $USERNAME system account because deluser command was not found"
+    fi
+
+    # Delete directory for pid file
+    if [ -d "/var/run/apertium" ]; then
+        rm -rf "/var/run/apertium"
+    fi
+
+    # Delete directory for log files
+    if [ -d "/var/log/apertium" ]; then
+        rm -rf "/var/log/apertium"
+    fi
+    ;;
+
+    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
diff --git a/debian/apertium-apy.service b/debian/apertium-apy.service
new file mode 100644
index 0000000..f6aac46
--- /dev/null
+++ b/debian/apertium-apy.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Apertium APY service
+Documentation=http://wiki.apertium.org/wiki/Apertium-apy
+After=network.target
+
+[Service]
+# Change this to your username and edit to how you start apy:
+User=apertium
+WorkingDirectory=/usr/share/apertium-apy
+ExecStart=/usr/bin/python3 servlet.py /usr/share/apertium/modes
+
+# By default, if it restarts >10 times within 5 secs, it marks it as failed and gives up:
+Restart=always
+
+# No reason to have access to shared tmp files:
+PrivateTmp=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/apertium-apy.upstart b/debian/apertium-apy.upstart
new file mode 100644
index 0000000..365bc13
--- /dev/null
+++ b/debian/apertium-apy.upstart
@@ -0,0 +1,16 @@
+description "Apertium APY service"
+
+start on (local-filesystems and net-device-up IFACE!=lo)
+stop on runlevel [!2345]
+
+setuid "apertium"
+setgid "apertium"
+
+env LC_ALL=en_US.utf-8
+
+exec /usr/bin/python3 /usr/share/apertium-apy/servlet.py /usr/share/apertium/modes
+
+respawn
+
+# wait 60 seconds for a graceful restart before killing the master
+kill timeout 60
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..e766480
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+apertium-apy (0.1.0~r61159-1) unstable; urgency=low
+
+  * Initial release (Closes: #769063)
+
+ -- Kartik Mistry <kartik at debian.org>  Thu, 02 Jul 2015 19:02:20 +0530
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..6601e1f
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,35 @@
+Source: apertium-apy
+Section: science
+Priority: optional
+Maintainer: Debian Science Team <debian-science-maintainers at lists.alioth.debian.org>
+Uploaders: Kartik Mistry <kartik at debian.org>,
+           Tino Didriksen <mail at tinodidriksen.com>
+Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), python3-dev, sqlite3
+Standards-Version: 3.9.6
+Homepage: http://apertium.org
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/apertium-apy.git
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/apertium-apy.git
+
+Package: apertium-apy
+Architecture: any
+Depends: adduser,
+         apertium (>= 3.3),
+         apertium-lex-tools,
+         build-essential,
+         libxml2-dev,
+         libxslt-dev,
+         logrotate,
+         lttoolbox (>= 3.3.1),
+         python-toro,
+         python3-dev,
+         python3-lxml,
+         python3-pip,
+         python3-tornado,
+         zlib1g-dev,
+         ${misc:Depends},
+         ${python3:Depends},
+         ${shlibs:Depends}
+Description: Apertium APY service
+ This package contains Apertium APY which is simple Apertium
+ API written in Python 3 meant as a drop-in replacement for
+ ScaleMT.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..75eb403
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,23 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: apertium-apy
+Source: http://svn.code.sf.net/p/apertium/svn/trunk/apertium-tools
+
+Files: *
+Copyright: 2005-2007, Universitat d'Alacant / Universidad de Alicante
+           2007-2008, Prompsit Language Engineering S.L.
+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 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 <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..4ec26e9
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#DH_VERBOSE = 1
+
+# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+
+# main packaging script based on dh7 syntax
+%:
+	dh $@ --with python3
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 0000000..2df3e3f
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+extend-diff-ignore = '^\.gitreview$'
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..da98b04
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1 @@
+# apertium-apy is only available in SVN right now.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/apertium-apy.git



More information about the debian-science-commits mailing list