--- teseq-1.0.0.orig/debian/rules
+++ teseq-1.0.0/debian/rules
@@ -0,0 +1,30 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+include /usr/share/dpatch/dpatch.make
+
+override_dh_auto_configure:
+	autoreconf
+	dh_auto_configure
+
+override_dh_installman:
+	rm -f doc/teseq.1 doc/reseq.1
+	make doc/teseq.1 doc/reseq.1
+	dh_installman
+
+build: build-stamp
+build-stamp: $(DPATCH_STAMPFN)
+	dh build
+	touch build-stamp
+
+clean: unpatch
+	dh clean
+
+install: build
+	dh install
+
+binary-arch: build install
+	dh binary-arch
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- teseq-1.0.0.orig/debian/info
+++ teseq-1.0.0/debian/info
@@ -0,0 +1 @@
+doc/teseq.info
--- teseq-1.0.0.orig/debian/watch
+++ teseq-1.0.0/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://ftp.gnu.org/gnu/teseq/teseq-(.)\.(.)\.(.)\.tar.gz
--- teseq-1.0.0.orig/debian/compat
+++ teseq-1.0.0/debian/compat
@@ -0,0 +1 @@
+7
--- teseq-1.0.0.orig/debian/control
+++ teseq-1.0.0/debian/control
@@ -0,0 +1,26 @@
+Source: teseq
+Section: devel
+Priority: optional
+Maintainer: Ryan Niebur <ryanryan52@gmail.com>
+DM-Upload-Allowed: yes
+Build-Depends: debhelper (>= 7.0.50), autotools-dev, automake, help2man, dpatch, autoconf
+Standards-Version: 3.8.1
+Homepage: http://www.gnu.org/software/teseq/
+Vcs-Browser: http://git.ryan52.info/?p=teseq;a=summary
+Vcs-Git: git://git.ryan52.info/git/teseq/
+
+Package: teseq
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: utility for rendering terminal typescripts human-readable
+ GNU Teseq is a tool for analyzing files that contain control
+ characters and terminal control sequences. It is intended to be
+ useful for diagnosing terminal emulators, and programs that make
+ heavy use of terminal features (such as those based on the Curses
+ library).
+ .
+ It is primarily targeted at individuals who possess a basic
+ understanding of terminal control sequences, especially CSI
+ sequences; however, by default Teseq will try to identify and
+ describe the sequences that it encounters, and the behavior they
+ might produce in a terminal.
--- teseq-1.0.0.orig/debian/manpages
+++ teseq-1.0.0/debian/manpages
@@ -0,0 +1,2 @@
+doc/teseq.1
+doc/reseq.1
--- teseq-1.0.0.orig/debian/README.source
+++ teseq-1.0.0/debian/README.source
@@ -0,0 +1,17 @@
+Teseq's debian packaging uses dpatch to make changes to the upstream source.
+
+To apply all of the patches run:
+./debian/rules patch
+
+To unapply all of the patches run:
+./debian/rules unpatch
+
+To add (or edit) a patch run:
+dpatch-edit-patch name_of_patch_goes_here
+#make your changes
+exit
+
+dpatch will make a new patch in debian/patches/ if one with that name doesn't already exist, otherwise it will change the existing one.
+To make it get used add it to debian/patches/00list .
+
+To make a patch not get used remove it from debian/patches/00list .
--- teseq-1.0.0.orig/debian/docs
+++ teseq-1.0.0/debian/docs
@@ -0,0 +1 @@
+README
--- teseq-1.0.0.orig/debian/changelog
+++ teseq-1.0.0/debian/changelog
@@ -0,0 +1,34 @@
+teseq (1.0.0-2.7.201411021030) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. The following patches have been applied to the original source package
+    0001-bump-version-for-ucs400
+
+ -- Univention builddaemon <buildd@univention.de>  Sun, 02 Nov 2014 10:30:00 +0100
+
+teseq (1.0.0-2) unstable; urgency=low
+
+  * Bump version, otherwise the build stamp in UCS 3.2 is higher than the 4.0
+    build (Bug #35387)
+
+ -- Sönke Schwardt-Krummrich <schwardt@univention.de>  Fri, 30 Oct 2014 14:43:23 +0200
+
+teseq (1.0.0-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix "FTBFS: configure.ac:15: lzma compression is deprecated; use
+    `dist-xz' or `dist-lzip' instead": add patch 04-fix-ftbfs-dist-lzma.
+    (Closes: #665258)
+
+ -- gregor herrmann <gregoa@debian.org>  Fri, 06 Apr 2012 15:28:14 +0200
+
+teseq (1.0.0-2) unstable; urgency=low
+
+  * Fix FTBFS on mips and mipsel (Closes: #531739)
+
+ -- Ryan Niebur <ryanryan52@gmail.com>  Wed, 03 Jun 2009 19:59:52 -0700
+
+teseq (1.0.0-1) unstable; urgency=low
+
+  * Initial release (Closes: #493818)
+
+ -- Ryan Niebur <ryanryan52@gmail.com>  Thu, 21 May 2009 20:36:32 -0700
--- teseq-1.0.0.orig/debian/clean
+++ teseq-1.0.0/debian/clean
@@ -0,0 +1,2 @@
+doc/teseq.1
+doc/reseq.1
--- teseq-1.0.0.orig/debian/copyright
+++ teseq-1.0.0/debian/copyright
@@ -0,0 +1,127 @@
+This package was debianized by Ryan Niebur <ryanryan52@gmail.com> on
+Mon, 04 Aug 2008 20:20:41 -0700.
+
+It was downloaded from http://www.gnu.org/software/teseq/
+
+Upstream Author:
+
+    Micah Cowan <micah@cowan.name>
+
+Copyright:
+
+    Copyright (C) 2008 Micah Cowan
+
+License:
+    Copyright (C) 2008 Micah Cowan
+
+    GNU teseq 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 3 of the License, or
+    (at your option) any later version.
+
+    GNU teseq 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 full text of the GNU General Public License
+version 3 is in `/usr/share/common-licenses/GPL-3'.
+
+files in the doc directory:
+
+Copyright (C) 2008 Micah Cowan <<micah@cowan.name>>
+
+     Permission is granted to copy, distribute and/or modify this
+     document under the terms of the GNU Free Documentation License,
+     Version 1.2 or any later version published by the Free Software
+     Foundation; with no Invariant Sections, no Front-Cover Texts, and
+     no Back-Cover Texts.  A copy of the license is included in the
+     section entitled "GNU Free Documentation License".
+
+On Debian systems, the full text of the GNU Free Documentation License
+version 1.2 is in `/usr/share/common-licenses/GFDL-1.2'.
+
+The Debian packaging is Copyright 2008-2009, Ryan Niebur <ryanryan52@gmail.com> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL-3'.
+
+reseq:
+    Copyright (C) 2008  Micah Cowan <micah@cowan.name>
+
+    Copying and distribution of this file, with or without modification,
+    are permitted in any medium without royalty provided the copyright
+    notice and this notice are preserved.
+
+csi.c:
+    Copyright 2002-2007,2008 by Thomas E. Dickey
+
+                            All Rights Reserved
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+
+    The above copyright notice and this permission notice shall be included
+    in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
+    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+    Except as contained in this notice, the name(s) of the above copyright
+    holders shall not be used in advertising or otherwise to promote the
+    sale, use or other dealings in this Software without prior written
+    authorization.
+
+    Copyright 1987, 1988  The Open Group
+
+    Permission to use, copy, modify, distribute, and sell this software and its
+    documentation for any purpose is hereby granted without fee, provided that
+    the above copyright notice appear in all copies and that both that
+    copyright notice and this permission notice appear in supporting
+    documentation.
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+    OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+    AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+    Except as contained in this notice, the name of The Open Group shall not be
+    used in advertising or otherwise to promote the sale, use or other dealings
+    in this Software without prior written authorization from The Open Group.
+
+    Copyright 1987, 1988 by Digital Equipment Corporation, Maynard.
+
+                            All Rights Reserved
+
+    Permission to use, copy, modify, and distribute this software and its
+    documentation for any purpose and without fee is hereby granted,
+    provided that the above copyright notice appear in all copies and that
+    both that copyright notice and this permission notice appear in
+    supporting documentation, and that the name of Digital not be used in
+    advertising or publicity pertaining to distribution of the software
+    without specific, written prior permission.
+
+    DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+    ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+    DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+    ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+    SOFTWARE.
+
--- teseq-1.0.0.orig/debian/patches/03-fix-ftbfs-on-mips.dpatch
+++ teseq-1.0.0/debian/patches/03-fix-ftbfs-on-mips.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03-fix-ftbfs-on-mips.dpatch by Ryan Niebur <ryanryan52@gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: make the pedantic checks warnings, not errors, as they fail on mips{,el}
+
+@DPATCH@
+diff -urNad teseq~/Makefile.am teseq/Makefile.am
+--- teseq~/Makefile.am	2009-06-03 19:45:22.000000000 -0700
++++ teseq/Makefile.am	2009-06-03 19:45:31.000000000 -0700
+@@ -18,7 +18,7 @@
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ AUTOMAKE_OPTIONS = subdir-objects
+-AM_CFLAGS=-Wall -g -O2 -ansi -pedantic-errors
++AM_CFLAGS=-Wall -g -O2 -ansi -pedantic
+ 
+ bin_PROGRAMS = teseq
+ dist_bin_SCRIPTS  = reseq
--- teseq-1.0.0.orig/debian/patches/00list
+++ teseq-1.0.0/debian/patches/00list
@@ -0,0 +1,4 @@
+01-better-name-in-manpages
+02-fix-bad-memory-access
+03-fix-ftbfs-on-mips
+04-fix-ftbfs-dist-lzma
--- teseq-1.0.0.orig/debian/patches/01-better-name-in-manpages.dpatch
+++ teseq-1.0.0/debian/patches/01-better-name-in-manpages.dpatch
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01-better-name-in-manpages.dpatch by Ryan Niebur <ryanryan52@gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: get rid of useless whatis description
+
+@DPATCH@
+diff -urNad teseq~/Makefile.am teseq/Makefile.am
+--- teseq~/Makefile.am	2008-08-06 23:16:46.000000000 -0700
++++ teseq/Makefile.am	2008-08-06 23:16:50.000000000 -0700
+@@ -46,10 +46,10 @@
+ SUFFIXES = .cm
+ 
+ doc/teseq.1: src/teseq.c
+-	$(HELP2MAN) ./teseq -o doc/teseq.1
++	$(HELP2MAN) ./teseq -o doc/teseq.1 -n "Format text with terminal escapes and control sequences for human consumption."
+ 
+ doc/reseq.1: ./reseq.in
+-	$(HELP2MAN) ./reseq -o doc/reseq.1
++	$(HELP2MAN) ./reseq -o doc/reseq.1 -n "Reverse the translations made by teseq."
+ 
+ .cm.c:
+ 	$(CHECKMK) $< > $@ || ( rm -f $@ && false )
--- teseq-1.0.0.orig/debian/patches/04-fix-ftbfs-dist-lzma.dpatch
+++ teseq-1.0.0/debian/patches/04-fix-ftbfs-dist-lzma.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04-fix-ftbfs-dist-lzma.dpatch by gregor herrmann <gregoa@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: dist-lzma is obsolete and causes a FTBFS now (#665258).
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' teseq-1.0.0~/configure.ac teseq-1.0.0/configure.ac
+--- teseq-1.0.0~/configure.ac	2008-08-02 08:01:10.000000000 +0200
++++ teseq-1.0.0/configure.ac	2012-04-06 15:16:14.759561704 +0200
+@@ -12,7 +12,7 @@
+ 
+ AC_PREREQ(2.61)
+ AC_INIT([GNU teseq], [1.0.0], [bug-teseq@gnu.org])
+-AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 dist-lzma gnu])
++AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 dist-xz gnu])
+ AC_CONFIG_SRCDIR([src/teseq.c])
+ AC_CONFIG_HEADER([src/config.h])
+ 
--- teseq-1.0.0.orig/debian/patches/02-fix-bad-memory-access.dpatch
+++ teseq-1.0.0/debian/patches/02-fix-bad-memory-access.dpatch
@@ -0,0 +1,69 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02-fix-bad-memory-access.dpatch by Ryan Niebur <ryanryan52@gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: upstream 325 245d8eac5c73 - Fix index-out-of-bounds in print_gxdm_info.
+
+@DPATCH@
+diff -urNad teseq~/ChangeLog teseq/ChangeLog
+--- teseq~/ChangeLog	2008-08-06 23:14:56.000000000 -0700
++++ teseq/ChangeLog	2008-08-06 23:15:10.000000000 -0700
+@@ -1,3 +1,12 @@
++2008-08-06  Micah Cowan  <micah@cowan.name>
++
++	* src/teseq.c (print_gxdm_info): Ensure we don't index the
++	desig_strs string unless the index is in the appropriate
++	range. Thanks to Bruno Haible for spotting the bug.
++
++	* tests/iso-2022/input, tests/iso-2022/output: Tests for
++	print_gxdm_info fix ("Esc $ z").
++
+ 2008-08-01  Micah Cowan  <micah@cowan.name>
+ 
+ 	* Initial release, vesion 1.0.0!
+diff -urNad teseq~/src/teseq.c teseq/src/teseq.c
+--- teseq~/src/teseq.c	2008-08-06 23:14:56.000000000 -0700
++++ teseq/src/teseq.c	2008-08-06 23:15:01.000000000 -0700
+@@ -546,7 +546,7 @@
+       set = 6;
+       designate = i1 - 0x2c;
+     }
+-  else if (i1 != 0x27 && i1 != 0x2c)
++  else if (i1 >= 0x28 && i1 != 0x2c)
+     {
+       set = 4;
+       designate = i1 - 0x28;
+@@ -554,6 +554,8 @@
+   else
+     return;
+ 
++  assert (designate >= 0);
++  assert (designate < 4);
+   if (configuration.labels)
+     {
+       putter_single (p->putr, "& G%cDM%d: G%d-DESIGNATE MULTIBYTE 9%d-SET",
+diff -urNad teseq~/tests/iso-2022/expected teseq/tests/iso-2022/expected
+--- teseq~/tests/iso-2022/expected	2008-08-06 23:14:56.000000000 -0700
++++ teseq/tests/iso-2022/expected	2008-08-06 23:15:22.000000000 -0700
+@@ -53,7 +53,8 @@
+ : Esc $ ( B
+ : Esc * ! $ A
+ : Esc $ ( + B
++: Esc $ z
+ . ESC/^[
+ |$(|
+ . SUB/^Z LF/^J ESC/^[
+-|$)|
++|$)|.
+diff -urNad teseq~/tests/iso-2022/input teseq/tests/iso-2022/input
+--- teseq~/tests/iso-2022/input	2008-08-01 23:04:56.000000000 -0700
++++ teseq/tests/iso-2022/input	2008-08-06 23:15:22.000000000 -0700
+@@ -2,5 +2,5 @@
+ 'A(B)A*Z+5,A(p
+ -A.B/t
+ =>
+-$B:#F|$O!";3ED$5$s!#(B$)D$(B*!$A$(+B$(
+-$)
+\ No newline at end of file
++$B:#F|$O!";3ED$5$s!#(B$)D$(B*!$A$(+B$z$(
++$)
