--- groff-1.15.orig/include/lib.h
+++ groff-1.15/include/lib.h
@@ -76,6 +76,10 @@
   return c >= 0 && illegal_char_table[c];
 }
 
+#ifndef HAVE_STRCASECMP
+#  define	strcasecmp(a,b)	strcmp((a),(b))
+#endif
+
 #ifdef HAVE_CC_LIMITS_H
 #include <limits.h>
 #else /* not HAVE_CC_LIMITS_H */
--- groff-1.15.orig/libgroff/Makefile.sub
+++ groff-1.15/libgroff/Makefile.sub
@@ -13,3 +13,5 @@
 version.cc: $(srcdir)/../VERSION
 	@echo Making version.cc
 	@echo const char \*version_string = \"`cat $(srcdir)/../VERSION`\"\; >$@
+	@test -s $(srcdir)/../REVISION || echo 0 >$(srcdir)/../REVISION 
+	@echo const char \*revision_string = \"`cat $(srcdir)/../REVISION`\"\; >>$@
--- groff-1.15.orig/grops/ps.cc
+++ groff-1.15/grops/ps.cc
@@ -25,6 +25,7 @@
 #include "ps.h"
 #include <time.h>
 
+static int paperlength = 0;
 static int landscape_flag = 0;
 static int manual_feed_flag = 0;
 static int ncopies = 1;
@@ -413,6 +414,37 @@
     else if (!bflag)
       broken_flags = atoi(arg);
   }
+  if (strcmp(command, "paperfile") == 0) {
+    if (arg == 0)
+      error_with_file_and_line(filename, lineno,
+			       "`paperfile' command requires an argument");
+    else if (font::paperlength == 0) {
+      errno = 0;
+      FILE *paper_file = fopen(arg, "r");
+      if (paper_file == 0) {
+        error("can't open `%1'", arg);
+        return;
+      }
+      char paper_file_buf[1024];
+      if ( fgets( paper_file_buf, 1024, paper_file)) {
+	int l = strlen(paper_file_buf) - 1;
+	if ( paper_file_buf[l] == '\n' )
+	  paper_file_buf[l] = 0;
+	if ( strcasecmp(paper_file_buf, "a4") == 0)
+		paperlength = 841890;
+//	else if ( strcasecmp(paper_file_buf, "letter") == 0)
+//		paperlength = 792000;
+//	else
+//	  error_with_file_and_line(filename, lineno,
+//				   "unknown paper size in file `%1'", arg);
+        else
+		paperlength = 792000;
+      } else
+	  error_with_file_and_line(filename, lineno,
+				   "error in content of paper file `%1'", arg);
+      fclose( paper_file);
+    }
+  }
 }
 
 struct style {
@@ -543,7 +575,10 @@
   res = r;
   out.set_fixed_point(point);
   space_char_index = font::name_to_index("space");
-  paper_length = font::paperlength;
+  if ( paperlength )
+    paper_length = paperlength;
+  else
+    paper_length = font::paperlength;
   if (paper_length == 0)
     paper_length = 11*font::res;
   equalise_spaces = font::res >= 72000;
--- groff-1.15.orig/grops/psrm.cc
+++ groff-1.15/grops/psrm.cc
@@ -51,6 +51,29 @@
 
 const int NRESOURCES = sizeof(resource_table)/sizeof(resource_table[0]);
 
+static int read_uint_arg(const char **pp, unsigned *res)
+{
+  while (white_space(**pp))
+    *pp += 1;
+  if (**pp == '\0') {
+    error("missing argument");
+    return 0;
+  }
+  const char *start = *pp;
+  // XXX use strtoul
+  long n = strtol(start, (char **)pp, 10);
+  if (n == 0 && *pp == start) {
+    error("not an integer");
+    return 0;
+  }
+  if (n < 0) {
+    error("argument must not be negative");
+    return 0;
+  }
+  *res = unsigned(n);
+  return 1;
+}
+
 struct resource {
   resource *next;
   resource_type type;
@@ -101,9 +124,13 @@
   read_download_file();
   string procset_name("grops");
   extern const char *version_string;
+  extern const char *revision_string;
+  unsigned revision_uint;
+  if ( !read_uint_arg( &revision_string, &revision_uint) )
+	  revision_uint = 0;
   string procset_version(version_string);
   procset_resource = lookup_resource(RESOURCE_PROCSET, procset_name,
-				     procset_version, 0);
+				     procset_version, revision_uint);
   procset_resource->flags |= resource::SUPPLIED;
 }
 
@@ -447,29 +474,6 @@
       res += **pp;
     *pp += 1;
   }
-  return 1;
-}
-
-static int read_uint_arg(const char **pp, unsigned *res)
-{
-  while (white_space(**pp))
-    *pp += 1;
-  if (**pp == '\0') {
-    error("missing argument");
-    return 0;
-  }
-  const char *start = *pp;
-  // XXX use strtoul
-  long n = strtol(start, (char **)pp, 10);
-  if (n == 0 && *pp == start) {
-    error("not an integer");
-    return 0;
-  }
-  if (n < 0) {
-    error("argument must not be negative");
-    return 0;
-  }
-  *res = unsigned(n);
   return 1;
 }
 
--- groff-1.15.orig/grolj4/lj4.cc
+++ groff-1.15/grolj4/lj4.cc
@@ -567,11 +567,12 @@
 static
 int lookup_paper_size(const char *s)
 {
-  for (int i = 0; i < sizeof(paper_table)/sizeof(paper_table[0]); i++)
+  for (int i = 0; i < sizeof(paper_table)/sizeof(paper_table[0]); i++) {
     // FIXME Do this case-insensitively.
     // Perhaps allow unique prefix.
-    if (strcmp(s, paper_table[i].name) == 0)
+    if (strcasecmp(s, paper_table[i].name) == 0)
       return i;
+  }
   return -1;
 }
 
@@ -590,6 +591,34 @@
 				 "unknown paper size `%1'", arg);
       else
 	paper_size = n;
+    }
+  }
+  if (strcmp(command, "paperfile") == 0) {
+    if (arg == 0)
+      error_with_file_and_line(filename, lineno,
+			       "`paperfile' command requires an argument");
+    else if (paper_size < 0) {
+      errno = 0;
+      FILE *paper_file = fopen(arg, "r");
+      if (paper_file == 0) {
+        error("can't open `%1'", arg);
+        return;
+      }
+      char paper_file_buf[1024];
+      if ( fgets( paper_file_buf, 1024, paper_file)) {
+	int l = strlen(paper_file_buf) - 1;
+	if ( paper_file_buf[l] == '\n' )
+	  paper_file_buf[l] = 0;
+        int n = lookup_paper_size( paper_file_buf);
+        if (n < 0)
+	  error_with_file_and_line(filename, lineno,
+				   "unknown paper size in file `%1'", arg);
+        else
+	  paper_size = n;
+      } else
+	  error_with_file_and_line(filename, lineno,
+				   "error in content of paper file `%1'", arg);
+      fclose( paper_file);
     }
   }
 }
--- groff-1.15.orig/devps/Makefile.sub
+++ groff-1.15/devps/Makefile.sub
@@ -15,12 +15,14 @@
 	-rm -f DESC
 	cat $(srcdir)/DESC.in >DESC
 	echo broken $(BROKEN_SPOOLER_FLAGS) >>DESC
-	if test "$(PAGE)" = A4; then \
-	  echo "paperlength 841890" >>DESC; \
-	else \
-	  echo "paperlength 792000" >>DESC; \
-	fi
+#	if test "$(PAGE)" = A4; then \
+#	  echo "paperlength 841890" >>DESC; \
+#	else \
+#	  echo "paperlength 792000" >>DESC; \
+#	fi
+	echo "paperfile /etc/papersize" >>DESC;
 	test -z '$(PSPRINT)' ||	echo print '$(PSPRINT)' >>DESC
+
 
 fonts: DESC
 	$(MAKE) -f $(srcdir)/generate/Makefile \
--- groff-1.15.orig/devlj4/Makefile.sub
+++ groff-1.15/devlj4/Makefile.sub
@@ -21,11 +21,12 @@
 	echo "res $(LJ4RES)" >DESC
 	echo "unitwidth `expr 7620000 / $(LJ4RES)`" >>DESC
 	cat $(srcdir)/DESC.in >>DESC
-	if test "$(PAGE)" = A4; then \
-	  echo "papersize a4" >>DESC; \
-	else \
-	  echo "papersize letter" >>DESC; \
-	fi
+#	if test "$(PAGE)" = A4; then \
+#	  echo "papersize a4" >>DESC; \
+#	else \
+#	  echo "papersize letter" >>DESC; \
+#	fi
+	echo "paperfile /etc/papersize" >>DESC;
 	test -z '$(LJ4PRINT)' || echo print '$(LJ4PRINT)' >>DESC
 
 fonts:
--- groff-1.15.orig/mm/Makefile.sub
+++ groff-1.15/mm/Makefile.sub
@@ -1,6 +1,8 @@
 #
 # $Id: Makefile.sub,v 1.32 1999/09/03 05:33:12 jh Exp $
 #
+tmac_m = m
+
 MAN7=groff_mm.n groff_mmse.n
 FILES=0.MT 5.MT 4.MT ms.cov se_ms.cov 
 # Local configuration files with default values.
@@ -22,7 +24,7 @@
 	-test -d $(tmacdir) || mkdir $(tmacdir)
 	-rm -f $(tmacdir)/tmac.$(tmac_m)
 	$(INSTALL_DATA) $(srcdir)/tmac.m $(tmacdir)/tmac.$(tmac_m)
-	@sed -e "s;^.mso tmac.m;.mso $(tmac_m);g" $(srcdir)/tmac.mse \
+	@sed -e "s;^.mso tmac.m;.mso tmac.$(tmac_m);g" $(srcdir)/tmac.mse \
 		> $(tmacdir)/tmac.$(tmac_m)se
 
 
--- groff-1.15.orig/xditview/Imakefile
+++ groff-1.15/xditview/Imakefile
@@ -1,4 +1,4 @@
-GROFF_LIBDIR = /usr/local/share/groff
+GROFF_LIBDIR = /usr/share/groff
 GROFF_FONTDIR = $(GROFF_LIBDIR)/font
 GROFF_FONTPATH = .:$(GROFF_FONTDIR):/usr/local/lib/font:/usr/lib/font
 DPIS = 75 100
--- groff-1.15.orig/xditview/device.c
+++ groff-1.15/xditview/device.c
@@ -9,7 +9,7 @@
 #include "device.h"
 
 #ifndef FONTPATH
-#define FONTPATH "/usr/local/share/groff/font:/usr/local/lib/font:/usr/lib/font"
+#define FONTPATH "/usr/share/groff/font:/usr/local/lib/font:/usr/lib/font"
 #endif
 
 #ifndef isascii
--- groff-1.15.orig/doc/Makefile
+++ groff-1.15/doc/Makefile
@@ -33,7 +33,7 @@
 
 .me.dit:
 	$(SOELIM) $< \
-	| sed -e "s;@VERSION@;`cat ../VERSION`;" \
+	| sed -e "s;@VERSION@;`cat ../DEBIAN-VERSION`;" \
 	| $(TROFF) -Tps $(FFLAG) -me  >$@
 
 .tr.dit:
--- groff-1.15.orig/Makefile.in
+++ groff-1.15/Makefile.in
@@ -131,7 +131,7 @@
 common_words_file=$(datasubdir)/eign
 
 # manroot is the root of the man page directory tree.
-manroot=$(prefix)/man
+manroot=$(prefix)/share/man
 
 # man1ext is the man section for user commands.
 man1ext=1
@@ -265,7 +265,7 @@
   realclean extraclean distfiles TAGS depend uninstall_sub
 
 do=all
-dodirs=$(ALLDIRS) dot
+dodirs=$(DISTDIRS) dot
 # Default target for subdir_Makefile
 subdir=troff
 
@@ -358,6 +358,10 @@
 	rm -f groff-$(version).tar.gz
 	tar cfh - groff-$(version) | gzip -c >groff-$(version).tar.gz
 	rm -fr groff-$(version)
+
+.PHONY: debian
+debian:        ../groff_$(shell cat ${srcdir}/VERSION).orig.tar.gz
+	dpkg-buildpackage -rfakeroot 2>&1 | tee ../dpkg.log.${version}
 
 # $(PROGDIRS): libgroff
 # grops grotty grodvi: libdriver
--- groff-1.15.orig/configure.in
+++ groff-1.15/configure.in
@@ -38,7 +38,7 @@
 LIBS="$LIBS -lc $LIBM"
 AC_REPLACE_FUNCS(fmod strtol getcwd strerror putenv)
 LIBS="$saved_libs"
-AC_CHECK_FUNCS(rename mkstemp)
+AC_CHECK_FUNCS(rename mkstemp strcasecmp)
 AC_DECL_SYS_SIGLIST
 dnl checks for compiler characteristics
 GROFF_ARRAY_DELETE
--- groff-1.15.orig/debian/changelog
+++ groff-1.15/debian/changelog
@@ -0,0 +1,212 @@
+groff (1.15-3) frozen unstable; urgency=high
+
+  * mm and mse macros were missing (thanx to Daniel Quinlan to make me
+    discover this grave bug); closes: #55428.
+  * corrected wrong .so request in macro mse
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Mon, 17 Jan 2000 15:25:06 +0200
+
+groff (1.15-2) unstable; urgency=low
+
+  * quick fix to a bug reported only mainstream.
+    postscript device fails if paper format is not a4 or letter.
+    Fixed using "letter" for all other formats, as it _was_ before.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Fri, 14 Jan 2000 12:21:38 +0200
+
+groff (1.15-1) unstable; urgency=low
+
+  * new upstream release: only minor bugfixes.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Thu,  6 Jan 2000 18:23:41 +0200
+
+groff (1.12-1) unstable; urgency=low
+
+  * new upstream release.
+    Got all previous changes (except papersize),
+    plus: new HTML device! (expermental).
+  * leaved version numeric only: closes: #31739, thanx to 
+    Jonathan H N Chin <jhnc@pfaff.newton.cam.ac.uk>.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Fri, 17 Dec 1999 14:40:46 +0200
+
+groff (1.11b-1) unstable; urgency=low
+
+  * updated to policy 3.1.0.
+  * new imminent release 1.12; this use groff-current renamed
+    groff-1.11b.  Not to be uploaded until 1.12 is released.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Sun, 12 Dec 1999 18:15:26 +0200
+
+groff (1.11a-9) unstable; urgency=low
+
+  * not uploaded due to imminent 1.12
+  * added management of /etc/papersize in driver lj4.
+    todo: the same in driver ps.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Sun,  5 Dec 1999 14:26:18 +0200
+
+groff (1.11a-8) unstable; urgency=low
+
+  * moved tmac.local to /etc (as tmac.man.local) and symlinked from the
+    original place; made it a conffile. Thanx to Decklin Foster
+    <decklin@home.com>, closes: #39043
+  * recompiled with libstdc++2.10 . closes: #49392.
+  * added manpages groff_mdoc(7) and groff_mdoc.samples(7) taken from
+    netBSD, thanks to Ben Harris <bjh21@cam.ac.uk>. closes: #49159.
+  * added Y2K corrections from the beta-12, from Paul Eggert.
+  * Got rid of old and unusefull checks in postinst.
+  * added symlink from /usr/doc, and added -e to script; closes: #39410
+  * Bugs fixed in previous releases: closes: #27016, #28097.
+  * Updated to std policy 3.0.1
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Tue, 26 Oct 1999 14:39:10 +0300
+
+groff (1.11a-7) unstable; urgency=low
+
+  * Applied patch to add include path search to groff e gsoelim, provided by 
+    Peter Miller <millerp@canb.auug.org.au> needed by aegis.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Sat, 17 Oct 1998 23:45:27 +0300
+
+groff (1.11a-6) unstable; urgency=low
+
+  * Recompiled to generate new dependencies into libs
+    (closes: #27790, thanx to Zephaniah E, Hull.)
+    [Previous attempt wasn't succesful.]
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Sat, 17 Oct 1998 02:39:10 +0300
+
+groff (1.11a-5) unstable; urgency=low
+
+  * Recompiled to generate new dependencies into libs
+    (closes: #27790, thanx to Zephaniah E, Hull.)
+  * added mime file as suggested by Brian White 
+    (closes: #27016)
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Tue, 13 Oct 1998 18:54:55 +0300
+
+groff (1.11a-4) unstable; urgency=low
+
+  * Added groff_man(7) manpage for tmac.an macro written by Susan Kleinmann.
+  * Added patch from Andy Dougherty to let groff pass the -U flag along to
+    troff. (closes: #20628)
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Sat,  4 Apr 1998 23:46:42 +0300
+
+groff (1.11a-2) unstable; urgency=low
+
+  * groff (1.11a-2) unstable; urgency=low
+  * groff (1.11a-0bo2) bo-unstable; urgency=low
+
+  * (lintian): added a symlink for neqn manpage.
+  * (lintian): changed mode of manpage gxditview.1x to 644.
+  * (lintian): changed mode of app-defaults/GXditview to 644.
+  * (lintian): updated the debian/copyright file (previously
+    debian/README), to point to the actual postal address of the FSF,
+    even if the sources in the distribution, including the COPYING file)
+    still point tro the old file (this should be reported as a bug to
+    upstream :-) .  Now it says:
+        A copy of the GNU General Public License is available in
+        /usr/doc/copyright/GPL (as installed by package base-files);
+        if not, write to the Free Software Foundation, Inc.,
+        59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  * commented creation of ctags file in debian/rules (closes: #15825,
+    #16006).
+  * checked correct build of fontpath (closes: #16007).
+  * added gzipping of X11 manpage (closes: #17455), tx to David ROCHER.
+  * reverted security changes done in 1.10-3.5 due to added use of safer
+    macro.  Added -U flag to nroff/troff/groff/pic to revert to old
+    unsecure behaviour:
+    - nroff script defaults calling groff -S
+    - troff defaults as called with -msafer
+    - groff defaults as called with -S
+    - pic defaults as called with -S
+    Updated manpages nroff(1), groff(1), troff(1), pic(1) for the -U option.
+  * changed reference to me and msafer manpages in groff(1), to reflect
+    the change in their names (done in 1.10-3.5 and 1.10-5).
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Sun, 15 Feb 1998 13:09:27 +0200
+
+groff (1.11a-1) unstable; urgency=low
+
+  * changed Standards Version to 2.3.0.1
+  * corrected names of copyright and chnagelog files.
+  * added full copyright from MIT (for gzditview).
+  * avoid gzipping of copyright file (oops!)
+  * new upstream version 1.11a (fixes #12130) including:
+    - new document for pic.
+    - changes to groff manpage.
+  * full libc6 version (fixes #14592) Since there aren't changes to
+     code, there's no need for a libc5 version.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Mon, 17 Nov 1997 11:00:21 +0200
+
+groff (1.10-3.5) stable; urgency=high
+
+  * Compiled under debian-1.3.1 (libc5) as a security bugfix; used
+     version number 3.5 (instead of 5) to avoid downgrading for hamm.
+  * Avoided execution of arbitrary code embedded in documents;
+     added warning WARN_SECURITY, enabled by default, to warn about .sy
+     directives, but not yet documented in manpage. Warning mode enabled
+     by default via ifdef, should be toggled by option flag. (need
+     coordination with upstream maintainer.)
+  * Applied patch from Brian Mays <bem5r@virginia.edu> to pic/tex.cc to
+     cast a long double value to double (fixes #13788)
+  * Changed name of manpages me and msafer to groff_me and groff_msafer.
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Wed, 15 Oct 1997 23:15:08 +0300
+
+groff (1.10-4) unstable; urgency=low
+
+  * libc6 version
+  * added explicit link to libc to let ld.so find libc dependencies.
+  * added dinamic dependence as Suggest for gxditview.
+  * forced configure to use /usr/bin/perl (fixes bug#11149 and #13239)
+  * added debian version number to option -v
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Sun, 28 Sep 1997 09:09:22 +0300
+
+groff (1.10-3) frozen unstable; urgency=low
+
+  * Applied changes to avoid problem with bash-2 (bug#8755)
+  * Added gxditview notice in file copyright.debian
+  * Compiled to supply gxditview, to let groff -X and man -X work.
+     (changed font path in device.c)
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Wed, 16 Apr 1997 22:50:58 +0300
+
+groff (1.10-2) frozen unstable; urgency=low
+
+    * corrected shlibs.local for libstd++ depenedency (fixes #5401)
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Thu, 14 Nov 1996 08:39:25 +0200
+
+groff (1.10-1) frozen; urgency=low
+
+    * new maintainer: Fabrizio Polacco <fpolacco@debian.org>
+    * changed description in control file (fixes bug #4013 part 2)
+    * new upstream sources 1.10 (fixes bug #4013 part 1)
+    * added symlinks for geqn, gpic, gtbl (bug #4754)
+    * compressed manpages.
+    * Updated to Standards-Version 2.1.1.0
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Fri, 8 Nov 1996 13:50:09 +0200
+
+groff (1.09-12) frozen; urgency=low
+
+    * this version was never uploaded
+    * new maintainer: Fabrizio Polacco <fpolacco@debian.org>
+    * built using original upstream sources 1.09 + patch 1.09-11
+    * Updated to Standards-Version 2.1.1.0
+
+ -- Fabrizio Polacco <fpolacco@debian.org>  Wed, 6 Nov 1996 15:15:10 +0200
+
+Changes:
+ 2-Jul-1995 Alvar Bray <alvar@meiko.co.uk>
+	Set permissions of /usr/doc/groff dir in post install script.
+	Previous versions of this package may have got these wrong and
+	replacing the package will not fix them.
+ 5-Mar-1995 Bruce Perens <Bruce@Pixar.com>
+	Added Debian GNU/Linux package maintenance system files.
+
--- groff-1.15.orig/debian/control
+++ groff-1.15/debian/control
@@ -0,0 +1,18 @@
+Source: groff
+Section: text
+Priority: important
+Maintainer: Fabrizio Polacco <fpolacco@debian.org>
+Standards-Version: 3.1.0
+
+Package: groff
+Architecture: any
+Depends: ${shlibs:Depends}
+Suggests: ${shlibs:Suggests}
+Description: GNU troff text-formatting system. 
+ This package contains the traditional UN*X text formatting tools
+ troff, nroff, tbl, eqn and pic. These utilities, together with the
+ man package, are essential for displaying the on-line manual pages. 
+ .
+ Output can be produced in a number of formats including plain ASCII
+ and PostScript. All the standard macro packages are supported.  A
+ number of other utilities are also included together with several fonts.
--- groff-1.15.orig/debian/copyright
+++ groff-1.15/debian/copyright
@@ -0,0 +1,65 @@
+This is the Debian GNU/Linux prepackaged version of the GNU groff
+document formatting system. 
+GNU groff was written by James Clark <jjc@jclark.com>.  
+It is now maintained by Ted Harding <ted.harding@nessie.mcc.ac.uk> and
+Werner Lemberg <wl@gnu.org>.
+
+This debian package is maintained by Fabrizio Polacco <fpolacco@debian.org>
+who got the original tarball from   ftp://ftp.ffii.org/pub/groff/
+0c87c54b39a71da4ad92a67f13b740a2  1156304 groff_1.15.tar.gz
+which he simply renamed to groff_1.15.orig.tar.gz
+
+
+=========================================================================
+
+   Groff is Copyright (c) 1989-1997 Free Software Foundation, Inc.
+   Written by James Clark (jjc@jclark.com)
+
+   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; version 2 dated June, 1991.
+
+   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.
+
+   A copy of the GNU General Public License is available in
+   /usr/share/common-licenses/GPL (as installed by package base-files);
+   if not, write to the Free Software Foundation, Inc.,
+   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+=========================================================================
+
+Included in this release are implementations of troff, pic, eqn, tbl,
+refer, the -man macros and the -ms macros, and drivers for PostScript,
+TeX dvi format, HP LaserJet 4 printers, HTML format (still alpha), and
+typewriter-like devices.  Also included is a modified version of the
+Berkeley -me macros, an enhanced version of the X11 xditview
+previewer, and an implementation of the -mm macros contributed by
+Joergen Haegg (jh@axis.se).
+
+xditview is copyrighted by MIT under the usual X terms.
+
+/*
+ * Copyright 1991 Massachusetts Institute of Technology
+ *
+ * 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, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * 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.
+ *
+ */
+
--- groff-1.15.orig/debian/prerm
+++ groff-1.15/debian/prerm
@@ -0,0 +1,7 @@
+#! /bin/sh -e
+
+package="groff"
+
+if	[ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/${package} ]
+then	rm -f /usr/doc/${package}
+fi
--- groff-1.15.orig/debian/mime
+++ groff-1.15/debian/mime
@@ -0,0 +1 @@
+application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
--- groff-1.15.orig/debian/postinst
+++ groff-1.15/debian/postinst
@@ -0,0 +1,12 @@
+#! /bin/sh -e
+
+package="groff"
+
+if [ -x /usr/sbin/update-mime ]; then /usr/sbin/update-mime; fi
+
+if	[ "$1" = "configure" ]
+then	if	[ -d /usr/doc -a ! -e /usr/doc/${package} -a -d /usr/share/doc/${package} ]
+	then	ln -sf ../share/doc/${package} /usr/doc/${package}
+	fi
+fi
+
--- groff-1.15.orig/debian/postrm
+++ groff-1.15/debian/postrm
@@ -0,0 +1,4 @@
+#! /bin/sh -e
+
+test -x "$(which update-mime)" && update-mime || true
+
--- groff-1.15.orig/debian/rules
+++ groff-1.15/debian/rules
@@ -0,0 +1,121 @@
+#! /usr/bin/make -f
+#
+# rules to debianize groff
+
+CC = gcc
+CFLAGS = -O2
+LDFLAGS = -s
+
+package = groff
+
+mypc = polacco
+
+DEBVER=`dpkg-parsechangelog | awk '/Version:/{ print $$2 }'`
+
+DOCUMENTS= BUG-REPORT ChangeLog NEWS PROBLEMS PROJECTS README TODO \
+	doc/meintro.me doc/meref.me doc/pic.ms
+
+./configure:	./configure.in
+	$(checkdir)
+	autoconf
+
+Makefile:	./configure
+	$(checkdir)
+	-rm -f config.log config.cache
+	./configure --prefix=/usr
+
+xditview/Makefile:
+	$(checkdir)
+	cd xditview; xmkmf
+
+build:		Makefile xditview/Makefile
+	$(checkdir)
+	-test "`uname -n`" = "${mypc}" && ctags-exuberant */*.[ch] */*.cc
+	# libgroff/Makefile.sub use DEBIAN-VERSION instead of VERSION
+	dpkg-parsechangelog | awk '/Version:/{ print $$2 " (debian)" }' > DEBIAN-VERSION
+	$(MAKE) CC="$(CC)" CCFLAGS="$(CFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS) -lc"
+	cd xditview; $(MAKE) depend;  \
+	$(MAKE) CC="$(CC)" CCFLAGS="$(CFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS) -lc"
+	touch build
+
+clean:		Makefile xditview/Makefile
+	$(checkdir)
+	-rm -rf debian/tmp debian/files*
+	-rm -f build man/index.* `find . -name '*~'` tags
+	-$(MAKE) -i distclean
+	-cd xditview;$(MAKE) extraclean; rm -f Makefile
+	-rm -f configure config.log config.cache
+
+binary-indep:   checkroot build
+	$(checkdir)
+# There are no architecture-independent files to be uploaded
+# generated by this package.  If there were any they would be
+# made here.
+
+binary-arch:    checkroot build
+	$(checkdir)
+	#
+	install -d -g root -m 755 -o root debian/tmp/DEBIAN
+	install -d -g root -m 755 -o root debian/tmp/etc
+	install -d -g root -m 755 -o root debian/tmp/usr/share/doc/$(package)
+	install -d -g root -m 755 -o root debian/tmp/usr/lib/mime/packages
+	install -g root -m 644 -o root \
+		debian/mime	debian/tmp/usr/lib/mime/packages/groff
+	$(MAKE) install prefix=`pwd`/debian/tmp/usr
+	#install -d -g root -m 755 -o root debian/tmp/usr/X11R6/bin
+	#install -d -g root -m 755 -o root debian/tmp/usr/X11R6/man/man1
+	#install -d -g root -m 755 -o root debian/tmp/usr/X11R6/lib/X11/app-defaults
+	cd xditview; $(MAKE) install install.man DESTDIR="../debian/tmp"
+	ln -fs eqn debian/tmp/usr/bin/geqn
+	ln -fs tbl debian/tmp/usr/bin/gtbl
+	ln -fs pic debian/tmp/usr/bin/gpic
+	mv debian/tmp/usr/share/groff/tmac/man.local \
+			debian/tmp/etc/tmac.man.local
+	ln -fs /etc/tmac.man.local debian/tmp/usr/share/groff/tmac/man.local
+	#
+	install -g root -m 644 -o root \
+		debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
+	cp -p $(DOCUMENTS) debian/tmp/usr/share/doc/$(package)
+	cd debian/tmp/usr/share/doc/$(package) && mv ChangeLog changelog
+	chmod 644 `find debian/tmp/usr/share/doc/$(package) -type f -print`
+	chmod 755 `find debian/tmp/usr/share/doc/$(package) -type d -print`
+	-gzip -r9f debian/tmp/usr/share/doc/$(package)
+	# this not gzipped!
+	install -g root -m 644 -o root \
+		debian/copyright debian/tmp/usr/share/doc/$(package)
+	#
+	chmod 644 debian/tmp/usr/X11R6/lib/X11/app-defaults/*
+	chmod 644 debian/tmp/usr/X11*/man/man?/*
+	chmod 755 debian/tmp/usr/share/groff/font/devps/generate/afmname
+	chmod 755 debian/tmp/usr/share/groff/font/devps/generate/symbol.sed
+	chmod 755 debian/tmp/usr/share/groff/font/devdvi/generate/CompileFonts
+
+	-gzip -r9f debian/tmp/usr/share/man debian/tmp/usr/X11*/man
+	ln -sf eqn.1.gz debian/tmp/usr/share/man/man1/neqn.1.gz
+	ln -sf eqn.1.gz debian/tmp/usr/share/man/man1/geqn.1.gz
+	ln -sf tbl.1.gz debian/tmp/usr/share/man/man1/gtbl.1.gz
+	ln -sf pic.1.gz debian/tmp/usr/share/man/man1/gpic.1.gz
+	#
+	install -g root -m 644 -o root debian/control debian/tmp/DEBIAN
+	install -g root -m 644 -o root debian/conffiles debian/tmp/DEBIAN
+	install -g root -m 755 -o root debian/postinst debian/tmp/DEBIAN
+	install -g root -m 755 -o root debian/prerm debian/tmp/DEBIAN
+	install -g root -m 755 -o root debian/postrm debian/tmp/DEBIAN
+	#
+	dpkg-shlibdeps $(package)/$(package) -dSuggests xditview/gxditview
+	dpkg-gencontrol
+	chown -R root.root debian/tmp
+	chmod -R g-ws debian/tmp
+	dpkg --build debian/tmp ..
+
+define checkdir
+	test -f $(package)/$(package).cc -a -f debian/rules
+endef
+
+binary:         binary-indep binary-arch
+
+checkroot:
+	$(checkdir)
+	test root = "`whoami`"
+
+.PHONY: binary binary-arch binary-indep clean checkroot
--- groff-1.15.orig/debian/substvars
+++ groff-1.15/debian/substvars
@@ -0,0 +1,2 @@
+shlibs:Depends=libc6 (>= 2.1), libc6 (>= 2.1.2), libstdc++2.10
+shlibs:Suggests=xlib6g (>= 3.3-5), xlib6g (>= 3.3.5)
--- groff-1.15.orig/debian/conffiles
+++ groff-1.15/debian/conffiles
@@ -0,0 +1 @@
+/etc/tmac.man.local
--- groff-1.15.orig/DEBIAN-VERSION
+++ groff-1.15/DEBIAN-VERSION
@@ -0,0 +1 @@
+1.15-3 (debian)
--- groff-1.15.orig/REVISION
+++ groff-1.15/REVISION
@@ -0,0 +1 @@
+1

