Package: makeztxt
Version: 1.60-5
Severity: normal
Tags: patch

Dear maintainer,

I've prepared an NMU for makeztxt (versioned as 1.60-5.1) and will
request it be sponsored in a couple of days. Please feel free to tell
me if I should delay it longer.

Regards,

Stephen
reverted:
--- makeztxt-1.60/makeztxt.c
+++ makeztxt-1.60.orig/makeztxt.c
@@ -358,11 +358,6 @@
 #endif
     }
 
-  if (optind < argc-1) 
-    fprintf(stderr, "%s operates on single files only (%d specified).\n"
-	    "Processing %s, ignoring extra filenames.\n",
-	    argv[0], argc-optind, argv[optind]);
-
   /* Set the database options from those accumulated on the command line */
   if (!nobackup)
     attr |= dmHdrAttrBackup;
diff -u makeztxt-1.60/debian/compat makeztxt-1.60/debian/compat
--- makeztxt-1.60/debian/compat
+++ makeztxt-1.60/debian/compat
@@ -1 +1 @@
-4
+5
diff -u makeztxt-1.60/debian/watch makeztxt-1.60/debian/watch
--- makeztxt-1.60/debian/watch
+++ makeztxt-1.60/debian/watch
@@ -5,2 +5,2 @@
-version=2
-opts=pasv ftp://ftp.sourceforge.net/pub/sourceforge/gutenpalm/makeztxt-(.*)-src\.tar\.gz debian uupdate
+version=3
+http://sf.net/gutenpalm/makeztxt-(.+)\.tar\.gz debian uupdate
diff -u makeztxt-1.60/debian/control makeztxt-1.60/debian/control
--- makeztxt-1.60/debian/control
+++ makeztxt-1.60/debian/control
@@ -2,13 +2,14 @@
 Section: otherosfs
 Priority: optional
 Maintainer: Rolandas Juodzbalis <rolan...@home.lt>
-Build-Depends: debhelper (>= 4.0.0), zlib1g-dev
-Recommends: pilot-link | jpilot | gnome-pilot | kpilot
-Standards-Version: 3.6.1
+Build-Depends: debhelper (>= 5), zlib1g-dev, quilt (>= 0.46-6)
+Standards-Version: 3.8.3
 
 Package: makeztxt
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: pilot-link | jpilot | gnome-pilot | kpilot
+Homepage: http://gutenpalm.sf.net/
 Description: Create zTXT databases from ASCII files to read them in a Palm
  A simple commandline program that takes a plain ASCII text file and
  compresses it into a zTXT database. Makeztxt will remove newline
@@ -23 +24 @@
- Palm (http://gutenpalm.sf.net/)
+ Palm.
diff -u makeztxt-1.60/debian/rules makeztxt-1.60/debian/rules
--- makeztxt-1.60/debian/rules
+++ makeztxt-1.60/debian/rules
@@ -6,9 +6,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-
-
-
+include /usr/share/quilt/quilt.make
+    
 CFLAGS = -Wall -g
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -28,7 +27,7 @@
 	touch configure-stamp
 
 
-build: build-stamp
+build: $(QUILT_STAMPFN) build-stamp
 
 build-stamp: configure-stamp 
 	dh_testdir
@@ -39,13 +38,13 @@
 
 	touch build-stamp
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp configure-stamp
 
 	# Add here commands to clean up after the build process.
-	-$(MAKE) distclean
+	$(MAKE) distclean
 
 	dh_clean 
 
@@ -57,7 +56,6 @@
 
 	# Add here commands to install the package into debian/makeztxt.
 	install -D makeztxt $(CURDIR)/debian/makeztxt/usr/bin/makeztxt
-	install -D makeztxt.1 $(CURDIR)/debian/makeztxt/usr/share/man/man1/makeztxt.1
 
 # Build architecture-independent files here.
 binary-indep: build install
diff -u makeztxt-1.60/debian/changelog makeztxt-1.60/debian/changelog
--- makeztxt-1.60/debian/changelog
+++ makeztxt-1.60/debian/changelog
@@ -1,3 +1,24 @@
+makeztxt (1.60-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Isolate all changes in the debian directory:
+    + move makeztxt.1 to the debian directory;
+    + add warn-on-multiple-files.patch to represent the change to
+      makeztxt.c in the previous diff.gz;
+    + use quilt to manage patches, and add README.source.
+  * Avoid FTBFS due to missing define (Closes: #526559). Thanks Peter
+    Green!
+  * Avoid segfaulting on long lines (Closes: #335206). Thanks Marius
+    Gedminas!
+  * Build correct files regardless of word size (Closes: #417241).
+    Thanks Matija Nalis!
+  * No longer ignore errors when cleaning.
+  * Use sf.net redirector in debian/watch (Closes: #450228).
+  * Upgrade to debhelper compatibility level 5 (no change required).
+  * Upgrade to Standards-Version 3.8.3: add Homepage entry.
+
+ -- Stephen Kitt <st...@sk2.org>  Tue, 27 Oct 2009 19:27:10 +0100
+
 makeztxt (1.60-5) unstable; urgency=low
 
   * New maintainer (Closes: #307557) 
reverted:
--- makeztxt-1.60/makeztxt.1
+++ makeztxt-1.60.orig/makeztxt.1
@@ -1,84 +0,0 @@
-.TH MAKEZTXT 1 "Jan 22, 2004"
-.SH NAME
-makeztxt - Create zTXT databases from ASCII files to read them in a Palm
-.SH SYNOPSIS
-.B "makeztxt --help"
-.br
-.B "makeztxt [-hlLnV] [-A annofile] [-a adjust] [-b line_length] [-m markfile]"
-.br
-.B "  [-o outfile] [-R regexfile] [-r regex] [-t title] [-z comp_type] input"
-.br
-.SH OPTIONS
-.br
-Please note that "input" refers to one and only one file - makeztxt
-cannot operate on multiple files at once.
-.br
-.IP "-A, --annofile"
-file containing zTXT annotations
-.IP "-a, --adjust"
-method for linefeed stripping (0, 1, 2, defaults to 0)
-.RS
-.IP "0"
-strip linefeeds for lines longer than length
-.IP "1"
-strip linefeed if line has any text
-.IP "2"
-no linefeed stripping
-.RE
-.IP "-b, --length"
-lines longer than this get linefeed stripped
-.IP "-h, --help"
-this help
-.IP "-l, --list"
-list regex generated bookmarks
-.IP "-L, --launchable"
-set the launchable bit in the output DB
-.IP "-m, --markfile"
-list of bookmarks to use in zTXT
-.IP "-n, --nobackup"
-do not set the backup bit in the DB
-.IP "-o, --output"
-output file to be created
-.IP "-R, --regexfile"
-file containing list of regex to use
-.IP "-r, --regex"
-do a regex search for bookmarks
-.IP "-t, --title"
-title of database
-.IP "-V, --version"
-makeztxt version
-.IP "-z, --compression"
-method of compression (1 or 2)
-.RS
-.IP "1"
-allow random access (default)
-.IP "2"
-one big data stream (10%-15% more compression)
-.RE
-.SH DESCRIPTION
-.br
-makeztxt is a simple commandline program that takes a plain ASCII text file
-and compresses it into a zTXT database.  makeztxt will remove newline
-characters at the end of lines that contain text so that the paragraphs flow
-better on the Palm screen.  makeztxt supports the use of regular expressions
-to automatically generate a list of bookmarks for you.  Lastly, makeztxt can
-also break an existing zTXT file into it's components (text, bookmarks,
-annotations) and store them into separate files for you.
-.SH FEATURES
-.IP "Creates zTXT databases"
-.IP "Deconstructs zTXT databases into component pieces"
-.IP "Use regular expression to automatically generate bookmarks"
-.IP "Includes libztxt, a small C library, so you can easily add zTXT creation or disection to your program"
-.IP "Create zTXTs that allow on-demand decompression, or get 10% - 15% more compression with the original style zTXT."
-.IP "Read regular expressions from a config file (.makeztxtrc)"
-.SH SEE ALSO
-.br
-For a full description (with examples) of the options listed above,
-refer to /usr/share/doc/makeztxt/README.gz
-.SH AUTHOR
-John Gruenenfelder (jo...@as.arizona.edu)
-.br
-This man page was created for the Debian package by Gunnar Wolf
-(gw...@debian.org) 
-.SH WEBSITE
-http://gutenpalm.sf.net
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/makeztxt.manpages
+++ makeztxt-1.60/debian/makeztxt.manpages
@@ -0,0 +1 @@
+debian/makeztxt.1
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/makeztxt.1
+++ makeztxt-1.60/debian/makeztxt.1
@@ -0,0 +1,84 @@
+.TH MAKEZTXT 1 "Jan 22, 2004"
+.SH NAME
+makeztxt - Create zTXT databases from ASCII files to read them in a Palm
+.SH SYNOPSIS
+.B "makeztxt --help"
+.br
+.B "makeztxt [-hlLnV] [-A annofile] [-a adjust] [-b line_length] [-m markfile]"
+.br
+.B "  [-o outfile] [-R regexfile] [-r regex] [-t title] [-z comp_type] input"
+.br
+.SH OPTIONS
+.br
+Please note that "input" refers to one and only one file - makeztxt
+cannot operate on multiple files at once.
+.br
+.IP "-A, --annofile"
+file containing zTXT annotations
+.IP "-a, --adjust"
+method for linefeed stripping (0, 1, 2, defaults to 0)
+.RS
+.IP "0"
+strip linefeeds for lines longer than length
+.IP "1"
+strip linefeed if line has any text
+.IP "2"
+no linefeed stripping
+.RE
+.IP "-b, --length"
+lines longer than this get linefeed stripped
+.IP "-h, --help"
+this help
+.IP "-l, --list"
+list regex generated bookmarks
+.IP "-L, --launchable"
+set the launchable bit in the output DB
+.IP "-m, --markfile"
+list of bookmarks to use in zTXT
+.IP "-n, --nobackup"
+do not set the backup bit in the DB
+.IP "-o, --output"
+output file to be created
+.IP "-R, --regexfile"
+file containing list of regex to use
+.IP "-r, --regex"
+do a regex search for bookmarks
+.IP "-t, --title"
+title of database
+.IP "-V, --version"
+makeztxt version
+.IP "-z, --compression"
+method of compression (1 or 2)
+.RS
+.IP "1"
+allow random access (default)
+.IP "2"
+one big data stream (10%-15% more compression)
+.RE
+.SH DESCRIPTION
+.br
+makeztxt is a simple commandline program that takes a plain ASCII text file
+and compresses it into a zTXT database.  makeztxt will remove newline
+characters at the end of lines that contain text so that the paragraphs flow
+better on the Palm screen.  makeztxt supports the use of regular expressions
+to automatically generate a list of bookmarks for you.  Lastly, makeztxt can
+also break an existing zTXT file into it's components (text, bookmarks,
+annotations) and store them into separate files for you.
+.SH FEATURES
+.IP "Creates zTXT databases"
+.IP "Deconstructs zTXT databases into component pieces"
+.IP "Use regular expression to automatically generate bookmarks"
+.IP "Includes libztxt, a small C library, so you can easily add zTXT creation or disection to your program"
+.IP "Create zTXTs that allow on-demand decompression, or get 10% - 15% more compression with the original style zTXT."
+.IP "Read regular expressions from a config file (.makeztxtrc)"
+.SH SEE ALSO
+.br
+For a full description (with examples) of the options listed above,
+refer to /usr/share/doc/makeztxt/README.gz
+.SH AUTHOR
+John Gruenenfelder (jo...@as.arizona.edu)
+.br
+This man page was created for the Debian package by Gunnar Wolf
+(gw...@debian.org) 
+.SH WEBSITE
+http://gutenpalm.sf.net
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/README.source
+++ makeztxt-1.60/debian/README.source
@@ -0,0 +1,27 @@
+makeztxt packaging for Debian
+=============================
+
+This package uses quilt to manage patches to the original source. These are
+stored in debian/patches.
+
+To obtain the source which is compiled for the final package:
+* install quilt
+* export QUILT_PATCHES="debian/patches"
+* run either
+        ./debian/rules patch
+  or
+        quilt push -a
+
+To revert all patches, run either
+        ./debian/rules unpatch
+or
+        quilt pop -a
+
+To add a new patch, apply the existing patches, then indicate you're
+creating a new patch with
+        quilt new 99-fix-whatever.patch
+Edit the appropriate files with
+        quilt edit file1.c
+        quilt edit file2.h
+Store the changes with
+        quilt refresh
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/patches/series
+++ makeztxt-1.60/debian/patches/series
@@ -0,0 +1,4 @@
+ftbfs-regs-fix.patch
+warn-on-multiple-files.patch
+portable-typedefs.patch
+segfault-fix.patch
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/patches/ftbfs-regs-fix.patch
+++ makeztxt-1.60/debian/patches/ftbfs-regs-fix.patch
@@ -0,0 +1,15 @@
+Avoid a FTBFS, and handle noopt; patch provided by Peter Green:
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526559
+
+--- a/Makefile
++++ b/Makefile
+@@ -10,7 +10,8 @@ LIBS	= -lztxt
+ INCLUDE	= -I../common -I.
+ 
+ CC	= gcc
+-CFLAGS	= -Wall -O2 -pipe $(INCLUDE)
++CFLAGS	?= -Wall -O2
++CFLAGS	+= -D_GNU_SOURCE -pipe $(INCLUDE)
+ # GNU make is mandatory
+ #MAKE	= make
+ 
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/patches/warn-on-multiple-files.patch
+++ makeztxt-1.60/debian/patches/warn-on-multiple-files.patch
@@ -0,0 +1,17 @@
+When multiple files are specified on the command line, only the first
+is taken into account. Warn the user to avoid surprises...
+
+--- a/makeztxt.c
++++ b/makeztxt.c
+@@ -358,6 +358,11 @@ process_arguments(ztxt *ztxtdb, int argc
+ #endif
+     }
+ 
++  if (optind < argc-1)
++    fprintf(stderr, "%s operates on single files only (%d specified).\n"
++	    "Processing %s, ignoring extra filenames.\n",
++	    argv[0], argc-optind, argv[optind]);
++
+   /* Set the database options from those accumulated on the command line */
+   if (!nobackup)
+     attr |= dmHdrAttrBackup;
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/patches/portable-typedefs.patch
+++ makeztxt-1.60/debian/patches/portable-typedefs.patch
@@ -0,0 +1,22 @@
+Use portable type definitions, notably to allow correct operation on
+64-bit platforms. Patch provided by Matija Nalis:
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417241
+
+--- a/libztxt/databaseHdrs.h
++++ b/libztxt/databaseHdrs.h
+@@ -10,10 +10,12 @@
+ #ifndef __DATABASEHDRS_H__
+ #define __DATABASEHDRS_H__
+ 
++#include <bits/types.h>
++
+ /* Normal Palm typedefs */
+-typedef unsigned char   UInt8;
+-typedef unsigned short  UInt16;
+-typedef unsigned long   UInt32;
++typedef __uint8_t       UInt8;
++typedef __uint16_t      UInt16;
++typedef __uint32_t      UInt32;
+ typedef UInt32          LocalID;
+ 
+ /* Max length of DB name */
only in patch2:
unchanged:
--- makeztxt-1.60.orig/debian/patches/segfault-fix.patch
+++ makeztxt-1.60/debian/patches/segfault-fix.patch
@@ -0,0 +1,29 @@
+Patch provided by Marius Gedminas:
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=335206
+
+makeztxt 1.60 may segfault if you run it with -a 2 on a text file that
+has a line of text longer than 255 characters.
+
+The bug:
+
+  reformat_ztxt allocates a 255-byte buffer on the stack, then calls
+  getline_nocr and specifies outsize == 255.  getline_nocr tries
+  to guard against buffer overflows by comparing (i < outsize - 1).
+  What happens when i == outsize - 2?  We step into the loop, do i++,
+  then see that i == outsize - 1, break outside the loop, do i++ again (now i
+  == outsize), then do out[i] = '\0' which steps outside the array and
+  overwrites a different variable on the caller's stack.
+
+The fix:
+
+--- a/libztxt/ztxt_process.c.orig	2005-10-22 18:33:28.000000000 +0300
++++ b/libztxt/ztxt_process.c	2005-10-22 18:33:29.000000000 +0300
+@@ -478,7 +478,7 @@
+   if (*offset >= insize - 1)
+     return NULL;
+ 
+-  while ((buf[i] != '\n') && (*offset < insize-1) && (i < outsize-1))
++  while ((buf[i] != '\n') && (*offset < insize-1) && (i < outsize-2))
+     {
+       i++;
+       (*offset)++;

Reply via email to