--- snmptt-1.3.orig/debian/install
+++ snmptt-1.3/debian/install
@@ -0,0 +1,2 @@
+snmptt snmpttconvert snmpttconvertmib snmptthandler usr/sbin
+snmptt.ini etc/snmp
--- snmptt-1.3.orig/debian/dirs
+++ snmptt-1.3/debian/dirs
@@ -0,0 +1,3 @@
+etc/snmp
+var/log/snmptt
+var/spool/snmptt
--- snmptt-1.3.orig/debian/postinst
+++ snmptt-1.3/debian/postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+	configure)
+		if ! getent passwd snmptt >/dev/null; then
+			adduser --disabled-password --system --group \
+				--home /var/spool/snmptt \
+				--gecos "SNMP Trap Translator" snmptt
+		fi
+
+		[ -d /var/log/snmptt ] || mkdir /var/log/snmptt
+		[ -d /var/spool/snmptt ] || mkdir /var/spool/snmptt
+		chown snmptt:snmptt /var/log/snmptt /var/spool/snmptt
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- snmptt-1.3.orig/debian/postrm
+++ snmptt-1.3/debian/postrm
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+
+case $1 in
+	purge)
+		rm -rf /var/spool/snmptt
+		;;
+esac
+
+#DEBHELPER#
--- snmptt-1.3.orig/debian/docs
+++ snmptt-1.3/debian/docs
@@ -0,0 +1 @@
+docs/*
--- snmptt-1.3.orig/debian/examples
+++ snmptt-1.3/debian/examples
@@ -0,0 +1,2 @@
+examples/*
+sample-*
--- snmptt-1.3.orig/debian/logrotate
+++ snmptt-1.3/debian/logrotate
@@ -0,0 +1,11 @@
+/var/log/snmptt/*.log /var/log/snmptt/*.debug {
+	missingok
+	notifempty
+	weekly
+	rotate 4
+	compress
+	sharedscripts
+	postrotate
+		/etc/init.d/snmptt reload > /dev/null
+	endscript
+}
--- snmptt-1.3.orig/debian/copyright
+++ snmptt-1.3/debian/copyright
@@ -0,0 +1,23 @@
+This package was debianized by Christoph Berg <myon@debian.org> on
+Mon, 30 Mar 2009 11:59:30 +0200.
+
+Copyright:
+ Copyright 2002-2007 Alex Burger <alex_b@users.sourceforge.net>
+
+Upstream:
+ http://www.snmptt.org/
+ http://sourceforge.net/project/showfiles.php?group_id=51473
+
+License:
+ 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.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
--- snmptt-1.3.orig/debian/init.d
+++ snmptt-1.3/debian/init.d
@@ -0,0 +1,132 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          snmptt
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: SNMP Trap Translator
+# Description:       SNMP trap handler for use with snmptrapd
+### END INIT INFO
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="SNMP trap translator"
+NAME=snmptt
+DAEMON=/usr/sbin/$NAME
+DAEMON_ARGS="--daemon"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_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 -- \
+		$DAEMON_ARGS \
+		|| 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.
+}
+
+#
+# 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/30/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/30/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() {
+	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
+	;;
+  reload|force-reload)
+	log_daemon_msg "Reloading $DESC" "$NAME"
+	do_reload
+	log_end_msg $?
+	;;
+  restart)
+	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
+	exit 3
+	;;
+esac
+
+:
--- snmptt-1.3.orig/debian/watch
+++ snmptt-1.3/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts="uversionmangle=s/beta/~beta/" \
+http://sf.net/snmptt/snmptt[_.-](.*).(?:tar.gz|tgz|zip)
--- snmptt-1.3.orig/debian/control
+++ snmptt-1.3/debian/control
@@ -0,0 +1,17 @@
+Source: snmptt
+Section: net
+Priority: extra
+Maintainer: Christoph Berg <myon@debian.org>
+Build-Depends: debhelper (>= 7)
+Homepage: http://www.snmptt.org/
+Standards-Version: 3.8.4
+Vcs-Git: git://git.debian.org/collab-maint/snmptt.git
+Vcs-Browser: http://git.debian.org/?p=collab-maint/snmptt.git
+
+Package: snmptt
+Architecture: all
+Depends: adduser, libconfig-inifiles-perl, libsnmp-perl, snmpd, ${misc:Depends}
+Recommends: libsys-syslog-perl
+Description: SNMP trap handler for use with snmptrapd
+ SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl for use
+ with the Net-SNMP / UCD-SNMP snmptrapd program (www.net-snmp.org).
--- snmptt-1.3.orig/debian/rules
+++ snmptt-1.3/debian/rules
@@ -0,0 +1,15 @@
+#!/usr/bin/make -f
+
+#include /usr/share/quilt/quilt.make
+
+#build: patch
+#clean: unpatch
+
+install-local:
+	dh install
+	install -m644 examples/snmptt.conf.generic debian/snmptt/etc/snmp/snmptt.conf
+
+binary: install-local
+
+%:
+	dh $@
--- snmptt-1.3.orig/debian/compat
+++ snmptt-1.3/debian/compat
@@ -0,0 +1 @@
+7
--- snmptt-1.3.orig/debian/changelog
+++ snmptt-1.3/debian/changelog
@@ -0,0 +1,35 @@
+snmptt (1.3-1) unstable; urgency=low
+
+  * New upstream version. (Closes: #575036)
+  * Remove quilt, patches went upstream.
+  * Reload instead of restart in logrotate config.
+
+ -- Christoph Berg <myon@debian.org>  Tue, 23 Mar 2010 10:54:35 +0100
+
+snmptt (1.2-4) unstable; urgency=low
+
+  * Fix LSB init.d header, thanks Petter Reinholdtsen. (Closes: #542163)
+  * Recommend libsys-syslog-perl, thanks Keith Erekson. (Closes: #539309)
+  * Create snmptt system user, also thanks Keith Erekson. (Closes: #539306)
+  * Add logrotate config, and move log files to /var/log/snmptt/.
+  * Run with umask 022.
+
+ -- Christoph Berg <myon@debian.org>  Mon, 21 Sep 2009 11:21:50 +0200
+
+snmptt (1.2-3) unstable; urgency=low
+
+  * Mangle upstream version in watch file.
+
+ -- Christoph Berg <myon@debian.org>  Wed, 10 Jun 2009 18:29:27 +0200
+
+snmptt (1.2-2) unstable; urgency=low
+
+  * Add watch file and fix some lintian warnings.
+
+ -- Christoph Berg <myon@debian.org>  Fri, 15 May 2009 09:26:41 +0200
+
+snmptt (1.2-1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Christoph Berg <myon@debian.org>  Mon, 30 Mar 2009 11:50:08 +0200
