--- mgetty-1.1.30.orig/doc/faxrunqd.8in
+++ mgetty-1.1.30/doc/faxrunqd.8in
@@ -276,23 +276,25 @@
 behaviour, you can send it the following signals:
 
 .TP
-.B SIGHUP
-.TP
 .B SIGINT
 .TP
 .B SIGTERM
 remove lock file, remove pid file, terminate immediately.
 
 .TP
+.B SIGHUP
+finish all fax jobs that are currently being sent, then terminate  (this
+is used to signal faxrunqd "I want you to terminate" without disturbing
+the normal flow of operation - SIGINT/TERM etc. can lead to some faxes being
+sent twice).
+
+.TP
 .B SIGUSR1
 close, roll, and re-open log file.
 
 .TP
 .B SIGUSR2
-finish all fax jobs that are currently being sent, then terminate  (this
-is used to signal faxrunqd "I want you to terminate" without disturbing
-the normal flow of operation - SIGHUP etc. can lead to some faxes being
-sent twice).
+dump current modem success/failure statistics to log file.
 
 .IX fax
 .SH BUGS
--- mgetty-1.1.30.orig/doc/mgetty.8in
+++ mgetty-1.1.30/doc/mgetty.8in
@@ -42,10 +42,13 @@
 .B -p <login prompt>
 Use the given string to prompt users for their login names. Various
 tokens are allowed in this string. These tokens are: @ for the system
-name, \\n, \\r, \\g, \\v, \\f, \\t for newline, carriage return, bell,
-vertical tab, form feed, and tab, respectively. \\P and \\L will expand to
-the tty name ("ttyS0"). \\I will give the "CONNECT foobar" string returned
+name, \\n, \\r, \\g, \\b, \\v, \\f, \\t for newline, carriage return, bell,
+backspace, vertical tab, form feed, and tab, respectively.
+\\P and \\L will expand to the tty name ("ttyS0"). \\Y will give the Caller
+ID, \\I the "CONNECT foobar" string returned
 by the modem, and \\S will output the port speed.
+\\s, \\m, \\V, \\R represent the operating system, the hardware name,
+the OS version, the OS release.
 \\N and \\U give the number of users currently logged in.
 \\C will be changed into the result of ctime(), and \\D and \\T will
 output the date and time, respectively. Finally, \\<digit> will use digit
--- mgetty-1.1.30.orig/doc/mgetty.texi-in
+++ mgetty-1.1.30/doc/mgetty.texi-in
@@ -1,6 +1,6 @@
 \input texinfo    @c -*-texinfo-*-
 @c %**start of header
-@c $Id: mgetty.texi-in,v 4.58 2002/11/17 21:19:45 gert Exp $ (c) 1993-2000 Gert Doering and Klaus Weidner
+@c $Id: mgetty.texi-in,v 4.59 2003/04/06 14:09:09 gert Exp $ (c) 1993-2000 Gert Doering and Klaus Weidner
 @setfilename mgetty.info
 @settitle mgetty + sendfax
 @c %**end of header
@@ -1096,6 +1096,9 @@
 @samp{/etc/issue}.  Some special characters are substituted by connect
 speed, date, etc. - see below (login-prompt) for a list.
 
+Note: maximum line length after substitution is 300 characters, so be 
+careful with ASCII art banners with lots of color settings and such.
+
 @item @code{prompt-waittime} @var{msecs}
 
 This specifies how long @code{mgetty} will wait for modem and line to
@@ -1117,6 +1120,10 @@
 @item \b backspace (ascii 010)
 @item \f form feed (ascii 013)
 @item \t TAB
+@item \s operating system (OS)
+@item \m hardware name
+@item \V OS version
+@item \R OS release
 @item \P (and \L) port name (e.g. ttyS0)
 @item \C date and time, in "ctime()" format
 @item \I Connection string (e.g. 2400/REL)
@@ -1128,7 +1135,7 @@
 @item \@var{digit} character with the specified octal code
 @end itemize
 
-The maximum lenght of the login prompt is limited to 140 characters (after
+The maximum lenght of the login prompt is limited to 300 characters (after
 expansion).
 
 @item @code{login-time} @var{secs}
@@ -3039,11 +3046,22 @@
 implemented since Linux 2.4.10, or in earlier Versions with Jan
 Oberlaender's patch
 (http://www.stud.uni-karlsruhe.de/~uslk/i4l-callednumber.tar.gz).
+(@strong{NOTE}: This doesn't seem to work for at least Linux 2.4.20
+as shipped by RedHat 8.0 - anyone with some details??!)
 
 Alternatively, you can set @code{ATS23.0=1}. This will make i4l signal
-the dialed MSN number as @code{RING/12345}.  Unfortunately, it will be
-recognized by mgetty as caller ID, not destination MSN, so you might need
-to do some fiddling with 'ring.c' to get this fixed.
+the dialed MSN number as @code{RING/12345}.  This was problematic in the
+past, as lots of other modems have a similar format to report the Caller ID
+(like @code{RING;4321} in ELSA modems) but recent mgetty versions handle 
+this properly.  With this, you can run a single mgetty instance for all
+your telephone numbers: just set @code{AT&L*} in your init string - this
+tells isnd4linux that @strong{all} incoming calls are to be signalled
+to mgetty, not only specific MSN.
+
+@c init-chat "" ATZ OK AT&L* OK ATS23.0=1S23.2=1S0=0 OK
+@c fax-only yes
+@c rings 2
+@c modem-quirks 1
 
 For the full list of available AT commands, consult the i4l docs
 (for example in @file{/usr/src/linux/Documentation/isdn/README}.
@@ -3063,8 +3081,9 @@
 
 There's a small catch: modem autodetection will make mgetty think that
 your ttyI device doesn't support fax (because most cards can't do it).  So 
-you need to set @code{modem-type c2.0} in @file{mgetty.config} and/or
-@file{sendfax.config} to force class 2.0 mode.
+you need to set @code{modem-type cls} in @file{mgetty.config} and/or
+@file{sendfax.config} to force class 2 mode.  Class 2.0 mode is not
+supported.
 
 Voice support with @code{vgetty} should work (use your ttyI device 
 as an answering machine, etc.).  I have not tried it yet - talk to the
--- mgetty-1.1.30.orig/fax/faxspool.in
+++ mgetty-1.1.30/fax/faxspool.in
@@ -3,7 +3,7 @@
 # faxspool - sample script how to spool fax input data to a spool
 #            directory, creating jobs to be run by faxrunq
 #
-# sccsid: $Id: faxspool.in,v 4.22 2002/11/23 15:14:57 gert Exp $ (c) Gert Doering
+# sccsid: $Id: faxspool.in,v 4.25 2003/06/28 20:44:04 gert Exp $ (c) Gert Doering
 #
 # syntax: faxspool [flags] <phone-number> <job(s)>
 #
@@ -26,6 +26,15 @@
 #  3.10.93: use "hp2hig3" for hp-pcl4-files (cl)
 # 19.10.93: phone directories (caz)
 # $Log: faxspool.in,v $
+# Revision 4.25  2003/06/28 20:44:04  gert
+# reset umask after creating temp directory
+#
+# Revision 4.24  2003/04/09 21:05:14  gert
+# fix case of "faxing without header" (-h -) - wasn't copying G3 files
+#
+# Revision 4.23  2003/01/21 13:27:12  gert
+# abort if input file names contain whitespace or quote characters
+#
 # Revision 4.22  2002/11/23 15:14:57  gert
 # revert 4.14 -> 4.15 change: faxqueue_done is now back in $FAX_SPOOL_OUT
 # (new permission concept, faxrunq/faxrunqd no longer running as root)
@@ -577,11 +586,15 @@
 fi
 
 #
-# check, if all the files exist & are readable
+# check, if all the file names are "clean", that the files exist & are readable
 #
 
 for file
 do
+    if [ `echo "$file" | tr -d ' \011\012\015\047\140"' ` != "$file" ]
+    then
+	$echo "$0: invalid characters in file name '$file'!" >&2 ; exit 5
+    fi
     if [ ! -r $file -a x$file != x- ]
     then
 	$echo "$0: cannot open '$file'!" >&2 ; exit 5
@@ -617,12 +630,14 @@
 #
 spooldir=${TMP:-/tmp}/$new_seq.$$.`date +%S`
 
+oldumask=`umask`
 umask 077
 if mkdir $spooldir ; then
     $echo "spooling to $spooldir (->$new_seq)..."
 else
     $echo "ERROR: can't create work dir '$spooldir', giving up" >&2 ; exit 6
 fi
+umask $oldumask
 
 #
 # process all input files
@@ -847,22 +862,23 @@
 fi
 
 #	
-# concatenate header with pages
+# concatenate header with pages (optionally) and copy over to spool dir
 #
-if [ -z "$FAX_HEADER" ]
+if [ -n "$FAX_HEADER" ]
 then
-    finalpg="$pages"				# don't :)
-else
     $echo "\nPutting Header lines on top of pages..."
 
     hdrfont=$PBMFONT_HEADER_F
     test -z "$normal_res" || hdrfont=$PBMFONT_HEADER_N
+fi
 
-    finalpg=""
-    for f in $pages
-    do
+finalpg=""
+for f in $pages
+do
 	nr=`expr $nr + 1`
 
+    if [ -n "$FAX_HEADER" ]
+    then
 	cat $FAX_HEADER | sed -e "s;@T@;$phone;g" -e "s;@P@;$nr;g" \
 			      -e "s;@M@;$maxnr;g" -e "s;@U@;$USER;g" \
 			      -e "s;@N@;$FULLNAME;g" \
@@ -873,9 +889,13 @@
 	| g3cat - $f | \
 	$FAXQ_HELPER input $new_seq f$nr.g3 \
 	&& rm $f
+    else
+	g3cat $f | \
+	$FAXQ_HELPER input $new_seq f$nr.g3 \
+	&& rm $f
+    fi
 	finalpg="$finalpg f$nr.g3"
-    done
-fi				# end "if ! -z $FAX_HEADER"
+done
 
 if [ -z "$finalpg" -a -z "$poll_req" ]
 then
--- mgetty-1.1.30.orig/fax/faxrunqd.in
+++ mgetty-1.1.30/fax/faxrunqd.in
@@ -9,10 +9,19 @@
 #
 # initial version: Feb 17, 1997
 #
-$rcs_id='RCS: $Id: faxrunqd.in,v 1.63 2002/11/23 16:52:18 gert Exp $';
+$rcs_id='RCS: $Id: faxrunqd.in,v 1.65 2003/01/14 14:16:09 gert Exp $';
 #
 # Change Log:
+#
 # $Log: faxrunqd.in,v $
+# Revision 1.65  2003/01/14 14:16:09  gert
+# include "total success" counter in the per_phone_statistics
+#
+# Revision 1.64  2003/01/07 14:48:52  gert
+# If a job is re-queued, heavily penalize previously used modem.
+# This way, a defective modem (or a modem that has problems connecting to
+# just a few destination numbers) has less impact on overall stability.
+#
 # Revision 1.63  2002/11/23 16:52:18  gert
 # make messages more clear, print warning if running as root
 #
@@ -608,6 +617,7 @@
 #   - no other job for this phone number already queued
 #   - this modem must be allowed for that job
 #   - if multiple queues allowed, take the shortest one
+#   - the modem used previously is heavily penalized
 #
 # called whenever a job's $queue{$job}->{status} changes to 'active'
 #
@@ -661,6 +671,9 @@
 		               @{$queue{$j}->{ttys}} : @standard_ttys;
 
     # find tty with the shortest queue (among those that are allowed)
+    #
+    # the previously used modem always gets a queue len of "9998", and is 
+    # thus only used if no other modem is available
     my $min_l = 9999;
     my $min_t = $ttys[0];
 
@@ -674,9 +687,12 @@
 	    $tty_in_use{$t}=0;
 	}
 
-	if ( $mq_length{$t}+$mq_badness{$t} < $min_l )
+	my $this_q_len = ( $t eq $queue{$j}->{last_modem} ) ? 9998 :
+				$mq_length{$t}+$mq_badness{$t};
+
+	if ( $this_q_len < $min_l )
 	{
-	    $min_l = $mq_length{$t}+$mq_badness{$t}; $min_t = $t;
+	    $min_l = $this_q_len; $min_t = $t;
 	}
     }
 
@@ -701,7 +717,7 @@
     $queue{$j}->{weight} = 1 + scalar( @{$queue{$j}->{pages}} );
     $mq_length{$min_t} += $queue{$j}->{weight};
 
-    print LOG "$j: possible ttys: " . join( ':', @ttys ) . " -> queue selected: $min_t (l: $min_l->" . $mq_length{$min_t} . ")\n"  if $opt_d;
+    print LOG "$j: possible ttys: " . join( ':', @ttys ) . " last: ". $queue{$j}->{last_modem} . " -> queue selected: $min_t (l: $min_l->" . $mq_length{$min_t} . ")\n"  if $opt_d;
 
     # rotate @standard_ttys, to distribute load more evenly among modems
     push @standard_ttys, (shift @standard_ttys);
@@ -804,6 +820,7 @@
 	}
 
 	$queue{$job}->{'tries'} = $queue{$job}->{'tries_c'} = 0;
+	$queue{$job}->{'last_modem'} = 'unknown';
 
 	while( <J> )
 	{
@@ -1264,15 +1281,13 @@
     $tty_statistics{$t}{total}++;
     $tty_statistics{$t}{$ex}++;
 
-    # and, in case of errors, for per-remote-phone statistics
-    if ( $ex > 0 )
-    {
+    # and for per-remote-phone statistics
         my $ph = $queue{$j}->{'phone'};
-	if ( ! defined( $per_phone_statistics{$ph} ) || 
-	     ! defined( $per_phone_statistics{$ph}{$ex} ) )
+    if ( ! defined( $per_phone_statistics{$ph} ) )
+	    { $per_phone_statistics{$ph}{0} = 0; }
+    if ( ! defined( $per_phone_statistics{$ph}{$ex} ) )
 		{ $per_phone_statistics{$ph}{$ex} = 0; }
 	$per_phone_statistics{$ph}{$ex}++;
-    }
 
     # now handle return codes.  This is tricky if multiple jobs have been 
     # combined into one sendfax call - might have failed in the middle...
@@ -1443,6 +1458,9 @@
 	my $fstr = ( $ex<10 )? "failed" : "FATAL FAILURE";
 	&wstat( $j, "Status " . localtime() . " $fstr, exit($ex): $verb_ex\n");
 
+	# remember tty used (try to get another one for next call)
+	$queue{$j}->{last_modem} = $tty;
+
 	# write acct.log
 	&wacct($j, "fail $ex: $verb_ex");
 
@@ -1704,7 +1722,7 @@
     foreach $t (keys %tty_statistics)
     {
 	print LOG "modem statistics for tty '$t'\n";
-	print LOG "    total faxes sent: ${tty_statistics{$t}{'total'}}\n";
+	print LOG "    total fax calls : ${tty_statistics{$t}{'total'}}\n";
 	print LOG "    total success   : ${tty_statistics{$t}{'0'}}\n";
 	foreach (sort(keys %{$tty_statistics{$t}}))
 	{
@@ -1719,8 +1737,10 @@
     foreach $t (sort (keys %per_phone_statistics))
     {
 	print LOG "error statistics for remote number '$t'\n";
+	print LOG "    total success   : ${per_phone_statistics{$t}{'0'}}\n";
 	foreach (sort(keys %{$per_phone_statistics{$t}}))
 	{
+	    next if ( $_ eq '0' );
             printf LOG "    error code %-2d   : %d [%s]\n",
 		$_, $per_phone_statistics{$t}{$_}, 
 		$exitcodes[$_];
--- mgetty-1.1.30.orig/fax/faxrm.in
+++ mgetty-1.1.30/fax/faxrm.in
@@ -7,7 +7,7 @@
 # There are still a lot rough edges - but it works, and should give you an
 # idea how to improve it
 #
-# SCCS: $Id: faxrm.in,v 4.5 2002/11/16 22:16:51 gert Exp $ Copyright (C) 1994 Gert Doering
+# SCCS: $Id: faxrm.in,v 4.6 2003/02/04 16:46:36 gert Exp $ Copyright (C) 1994 Gert Doering
 
 FAX_SPOOL=@FAX_SPOOL@
 FAX_SPOOL_OUT=@FAX_SPOOL_OUT@
@@ -16,7 +16,7 @@
 echo="@ECHO@"
 #
 # helper program for privileged queue access
-FAXQ_HELPER=/usr/local/lib/mgetty+sendfax/faxq-helper
+FAXQ_HELPER=@LIBDIR@/faxq-helper
 #
 
 if [ ! -d $FAX_SPOOL_OUT ]
--- mgetty-1.1.30.orig/fax/faxq-helper.c
+++ mgetty-1.1.30/fax/faxq-helper.c
@@ -71,6 +71,8 @@
 int    fax_out_uid;		/* user ID to chown() fax jobs to */
 int    fax_out_gid;		/* group ID ... */
 
+#define	ROOT_UID	0	/* root's user ID - override checks */
+
 #define FAX_SEQ_FILE	".Sequence"
 #define FAX_SEQ_LOCK	"LCK..seq"
 
@@ -370,7 +372,7 @@
 
     while( *p != '\0' )
     {
-	if ( *p != '.' && *p != ':' && ! isalnum(*p) )
+	if ( *p == '/' || *p == '\\' || isspace(*p) || !isprint(*p) )
 	{
 	    eout( "invalid char. '%c' in file name '%s', abort\n",
 		  *p, outfilename );
@@ -386,7 +388,7 @@
 
     sprintf( pathbuf, "%s/%s", dir1, outfilename );
 
-    fd = open( pathbuf, O_WRONLY | O_CREAT | O_EXCL, 0600 );
+    fd = open( pathbuf, O_WRONLY | O_CREAT | O_EXCL, 0644 );
     if ( fd < 0 )
     {
 	eout( "can't open '%s' for writing: %s\n", pathbuf, strerror(errno));
@@ -543,6 +545,9 @@
 
     sprintf( buf, "%s/JOB", dir1 );
 
+    /* the JOB file has to be world-readable, relax umask */
+    umask( 0022 );
+
 /* TODO: check if this portably catches symlinks to non-existant files! */
     if ( ( fd = open( buf, O_WRONLY | O_CREAT | O_EXCL, 0644 ) ) < 0 )
     {
@@ -571,7 +576,8 @@
 
 	if ( strncmp(buf, "user ", 5) == 0 )
 	{
-	    if ( strcmp( buf+5, real_user_name ) != 0 )
+	    if ( real_user_id != ROOT_UID &&
+		 strcmp( buf+5, real_user_name ) != 0 )
 	    {
 		eout( "user name mismatch (%s <-> %s)\n", buf+5, real_user_name );
 		break;
@@ -678,7 +684,8 @@
 
 	if ( strncmp(buf, "user ", 5) == 0 )
 	{
-	    if ( strcmp( buf+5, real_user_name ) != 0 )
+	    if ( real_user_id != ROOT_UID &&
+		 strcmp( buf+5, real_user_name ) != 0 )
 	    {
 		fprintf( stderr, "%s: not your job, can't do anything (%s <-> %s)\n", jfile, buf+5, real_user_name );
 		unlink( lfile );
@@ -803,8 +810,11 @@
 
     /* common things to check and prepare */
 
-    /* directories and JOB files have to be readable */
-    umask(0022);
+    /* make sure people do not play umask tricks on us - the only
+     * bits that are accepted in a user umask are "044" - permit/prevent 
+     * read access by group/other.  Write access is always denied.
+     */
+    umask( ( umask(0) & 0044 ) | 0022 );
 
     /* get numeric uid/gid for fax user */
     pw = getpwnam( FAX_OUT_USER );
--- mgetty-1.1.30.orig/TODO
+++ mgetty-1.1.30/TODO
@@ -352,6 +352,8 @@
 246) fix "RING/<msn>" handling for i4l
 
 248) include script to rotate/move log files on a regular basis
+     (base on contrib/mvlog, move to tools/, run through sedscript for
+     location and naming for the log files)
 
 250) move prototype for time() to mgetty.h, remove everywhere else
 
@@ -373,3 +375,37 @@
 
 257) generalize calling $(MAKE) in subdirs - put all $(MAKE) arguments
      in one common variable
+
+261) faxrunqd: don't count "modem locked" as "failure" for a given job
+     (but *do* delay by a certain time)
+     (hmmm - maybe not.  If all modems are locked for a long period of
+     time, it might be useful to flag the fax as "failed" to get people to
+     notice.  Combine with 259 - should resolve problem)
+
+262) faxrunqd: smarter algorithm for "modem is broken"
+     (locked = doesn't count, can't init = +1, NO CARRIER = +0.2)
+
+263) faxspool.rules: add sample mappings for PDF (via acroread, xpdf,
+     recent ghostscript versions)
+
+264) faxrunqd: timeout on "hanging" sendfax processes
+     (timeout > 15 min + 5 minutes * number of pages, or something like that)
+
+265) faxrunqd: write tty to acct.log (format change / WEB gui)
+
+260) faxrunqd: bump up priority of "exit 12" jobs
+266) faxunrqd: if a job fails half-way through (12), increase priority
+     to re-send missing parts quickly
+
+267) faxrunqd: sort per-modem statistics numerically (watchout: "total")
+
+268) faxrunq+faxrunqd: have configurable counters for 
+        "send-a-warning after <x> tries, fail after <y>"
+     have separate counter for "modem-locked"
+              costing-failures    tries-except-modem-locked    total-tries
+       warning        -                     10                    10
+       failure        5                     30                   100
+
+269) faxrunqd: have configurable threshold for "everything is broken"
+     -> if that threshold is reached, generate STOP file, warning e-mail, 
+     and suspend itself  (like "the local in-house PABX is broken")
--- mgetty-1.1.30.orig/Makefile
+++ mgetty-1.1.30/Makefile
@@ -1,6 +1,6 @@
 # Makefile for the mgetty fax package
 #
-# SCCS-ID: $Id: Makefile,v 4.56 2002/12/16 13:08:23 gert Exp $ (c) Gert Doering
+# SCCS-ID: $Id: Makefile,v 4.58 2003/06/12 07:52:51 gert Exp $ (c) Gert Doering
 #
 # this is the C compiler to use (on SunOS, the standard "cc" does not
 # grok my code, so please use gcc there. On ISC 4.0, use "icc".).
@@ -213,6 +213,7 @@
 FAX_SPOOL_OUT=$(FAX_SPOOL)/outgoing
 #
 # the user that owns the "outgoing fax queue" (FAX_SPOOL_OUT)
+# this user must exist in the system, otherwise faxspool will not work!
 #
 # faxrunq and faxrunqd should run under this user ID, and nothing else.  
 # This user needs access to the modems of course.  
@@ -300,8 +301,8 @@
 # Nothing to change below this line ---------------------------------!
 #
 MR=1.1
-SR=30
-DIFFR=1.1.29
+SR=31
+DIFFR=1.1.30
 #
 #
 OBJS=mgetty.o logfile.o do_chat.o locks.o utmp.o logname.o login.o \
@@ -511,7 +512,7 @@
 	ssh home.leo.org -l doering 'cd $$HOME ; ./beta'
 
 # send to Marc and Knarf
-	head -30 ChangeLog |mail -s "mgetty$(MR).$(SR).tar.gz on greenie/alpha" knarf@camelot.de marc marcs
+	head -30 ChangeLog |mail -s "mgetty$(MR).$(SR).tar.gz on greenie/alpha" mgetty@knarf.de marc marcs
 #	-./ftp.sh $(MR).$(SR) ftp.camelot.de /pub/incoming
 #	-./ftp.sh $(MR).$(SR) poseidon.thphy.uni-duesseldorf.de /incoming
 
@@ -600,9 +601,9 @@
 # data files + directories
 #
 	test -d $(LIBDIR)  || \
-		( ./mkidirs $(LIBDIR) ; chmod 755 $(LIBDIR) )
+		( ./mkidirs $(LIBDIR) &&  chmod 755 $(LIBDIR) )
 	test -d $(CONFDIR) || \
-		( ./mkidirs $(CONFDIR); chmod 755 $(CONFDIR))
+		( ./mkidirs $(CONFDIR) && chmod 755 $(CONFDIR))
 	test -f $(CONFDIR)/login.config || \
 		$(INSTALL) -o root -m 600 login.config $(CONFDIR)/
 	test -f $(CONFDIR)/mgetty.config || \
@@ -627,17 +628,17 @@
 # fax spool directories
 #
 	test -d $(spool) || \
-		( mkdir $(spool) ; chmod 755 $(spool) )
+		( mkdir $(spool) && chmod 755 $(spool) )
 	test -d $(FAX_SPOOL) || \
-		( mkdir $(FAX_SPOOL) ; \
-		  chown $(FAX_OUT_USER) $(FAX_SPOOL) ; \
+		( mkdir $(FAX_SPOOL) && \
+		  chown $(FAX_OUT_USER) $(FAX_SPOOL) && \
 		  chmod 755 $(FAX_SPOOL) )
 	test -d $(FAX_SPOOL_IN) || \
-		( mkdir $(FAX_SPOOL_IN) ; chmod 755 $(FAX_SPOOL_IN) )
+		( mkdir $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
 	test -d $(FAX_SPOOL_OUT) || \
-		( mkdir $(FAX_SPOOL_OUT) ; \
-		  chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT) ; \
-		  chmod 755 $(FAX_SPOOL_OUT) )
+		  mkdir $(FAX_SPOOL_OUT)
+	chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
+	chmod 755 $(FAX_SPOOL_OUT)
 #
 # g3 tool programs
 #
--- mgetty-1.1.30.orig/voice/libutil/access.c
+++ mgetty-1.1.30/voice/libutil/access.c
@@ -5,7 +5,7 @@
  * exactly one unnested call to voice_desimpersonify() for each
  * voice_impersonify() because of the static umask below.
  *
- * $Id: access.c,v 1.2 1999/07/04 07:15:52 marcs Exp $
+ * $Id: access.c,v 1.3 2003/04/23 08:49:16 gert Exp $
  *
  */
 
@@ -32,14 +32,14 @@
 	    &gid);
 
    if (setegid(gid)) {
-      lprintf(L_WARN, "%s: cannot set effective GID to %d",
-	      program_name, gid);
+      lprintf(L_WARN, "%s: cannot set effective GID to %d: %s",
+	      program_name, gid, strerror(errno));
       return 0;
    }
 
    if (seteuid(uid)) {
-      lprintf(L_WARN, "%s: cannot set effective UID to %d",
-	      program_name, uid);
+      lprintf(L_WARN, "%s: cannot set effective UID to %d: %s",
+	      program_name, uid, strerror(errno));
       return 0;
    }
 
@@ -52,14 +52,14 @@
 
 int voice_desimpersonify(void) {
    if (seteuid(getuid())) {
-      lprintf(L_WARN, "%s: cannot switch back to effective UID %d",
-	      program_name, getuid());
+      lprintf(L_WARN, "%s: cannot switch back to effective UID %d: %s",
+	      program_name, getuid(), strerror(errno));
       return 0;
    }
 
    if (setegid(getgid())) {
-      lprintf(L_WARN, "%s: cannot switch back to effective GID %d",
-	      program_name, getgid());
+      lprintf(L_WARN, "%s: cannot switch back to effective GID %d: %s",
+	      program_name, getgid(), strerror(errno));
       return 0;
    }
 
--- mgetty-1.1.30.orig/voice/libvoice/V253modem.c
+++ mgetty-1.1.30/voice/libvoice/V253modem.c
@@ -16,7 +16,7 @@
   Hint: Recorded voice files are in .ub format (refer to the sox manpage about this) except the header.
         So you can use this files with sox.
  *
- * $Id: V253modem.c,v 1.6 2002/11/25 21:14:51 gert Exp $
+ * $Id: V253modem.c,v 1.7 2003/01/08 22:03:18 gert Exp $
  *
  */
 
@@ -352,7 +352,7 @@
 
 /* Only verifies the RMD name */
 #define V253modem_RMD_NAME "V253modem"
-#define ELSA_RMD_NAME "ELSA"
+#define ELSA_RMD_NAME "Elsa"
 int V253_check_rmd_adequation(char *rmd_name) 
 {
    return !strncmp(rmd_name,
--- mgetty-1.1.30.orig/faxrecp.c
+++ mgetty-1.1.30/faxrecp.c
@@ -94,13 +94,13 @@
 
 #ifdef SHORT_FILENAMES
     sprintf(temp, "%s/f%c%07x%s.%02d", directory,
-		 fax_par_d.vr == 0? 'n': 'f',
+		 (fax_par_d.vr == 0 || fax_par_d.vr == 8) ? 'n': 'f',
 	         (int) call_start & 0xfffffff,
 	         DevId, pagenum );
 #else
     /* include sender's fax id - if present - into filename */
     sprintf(temp, "%s/f%c%07x%s-", directory,
-		fax_par_d.vr == 0? 'n': 'f',
+		(fax_par_d.vr == 0 || fax_par_d.vr == 8) ? 'n': 'f',
 		(int) call_start & 0xfffffff,
 		DevId );
     i = strlen(temp);
--- mgetty-1.1.30.orig/logfile.c
+++ mgetty-1.1.30/logfile.c
@@ -3,13 +3,6 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <fcntl.h>
-#ifdef USE_VARARGS
-# if !defined(NeXT) || defined(NEXTSGTTY)
-#  include <varargs.h>
-# endif
-#else
-# include <stdarg.h>
-#endif
 #include <sys/types.h>
 #include <time.h>
 #include <errno.h>
@@ -18,6 +11,15 @@
 
 #include "mgetty.h"
 #include "policy.h"
+
+/* this must be included after ugly.h (sets USE_VARARGS on non-ANSI cc's) */
+#ifdef USE_VARARGS
+# if !defined(NeXT) || defined(NEXTSGTTY)
+#  include <varargs.h>
+# endif
+#else
+# include <stdarg.h>
+#endif
 
 #ifdef SYSLOG
 #include <syslog.h>
--- mgetty-1.1.30.orig/faxlib.c
+++ mgetty-1.1.30/faxlib.c
@@ -178,8 +178,10 @@
 
 	    if ( line[ix+1] == ',' &&		/* +FPS:s,lc,blc */
 		 sscanf( &line[ix+2],
-			 (modem_type==Mt_class2_0)?"%x,%x,%x,%x"
-			                          :"%d,%d,%d,%d",
+			 ( modem_type == Mt_class2 || 
+			  (modem_quirks & MQ_FPS_NOT_HEX) )
+			                          ?"%d,%d,%d,%d"
+						  :"%x,%x,%x,%x",
 		         &fhs_lc, &fhs_blc, &fhs_cblc, &fhs_lbc ) >= 2 )
 	    {
 		lprintf( L_NOISE, "%d lines received, %d lines bad, %d bytes lost", fhs_lc, fhs_blc, fhs_lbc );
@@ -636,7 +638,7 @@
 	  case 1445:
 	    lprintf( L_MESG, "USR Courier/Sportster v32bis detected (buggy fax implementation)" );
 	    modem_type=Mt_class2_0;
-	    modem_quirks |= MQ_USR_FMINSP;
+	    modem_quirks |= MQ_USR_FMINSP | MQ_FPS_NOT_HEX;
 	    break;
 	  case 2886:
 	  case 3361:
@@ -645,17 +647,20 @@
 	  case 3367:
 	    lprintf( L_MESG, "USR Courier/Sportster V.34(+) detected" );
 	    modem_type=Mt_class2_0;
+	    modem_quirks |= MQ_FPS_NOT_HEX;
 	    mis = mdm_get_idstring( "ATI3", 1, fd );
 	    break;
 	  case 5601:
 	  case 5607:
 	    lprintf( L_MESG, "USR Courier/Sportster 56k detected" );
 	    modem_type=Mt_class2_0;
+	    modem_quirks |= MQ_FPS_NOT_HEX;
 	    mis = mdm_get_idstring( "ATI3", 1, fd );
 	    break;
 	  case 6401:
 	    lprintf( L_MESG, "USR I-Modem detected" );
 	    modem_type=Mt_class2_0;
+	    modem_quirks |= MQ_FPS_NOT_HEX;
 	    mis = mdm_get_idstring( "ATI3", 1, fd );
 	    break;
 	  case 62:	/* sure? */
@@ -813,6 +818,7 @@
 	{
 	    lprintf( L_MESG, "USR Courier/Sportster V90 (national variant?) detected" );
 	    modem_type=Mt_class2_0;
+	    modem_quirks |= MQ_FPS_NOT_HEX;
 	    mis = mdm_get_idstring( "ATI3", 1, fd );
 	}
 	/* grrr, another one of those - Bill Nugent <whn@topelo.lopi.com> */
@@ -834,6 +840,12 @@
 	    lprintf( L_MESG, "Multitech MT5634Z internal detected" );
 	    modem_type=Mt_class2;
 	    modem_quirks |= MQ_NEED2;
+	}
+	else if ( strncmp( l, "LT V.92", 7 ) == 0 )	/* gert */
+	{
+	    lprintf( L_MESG, "Multitech MT5634ZBA-V92 detected" );
+	    modem_type=Mt_class2_0;
+	    modem_quirks |= MQ_FPS_NOT_HEX;
 	}
     }
 
--- mgetty-1.1.30.orig/faxrec.c
+++ mgetty-1.1.30/faxrec.c
@@ -208,7 +208,7 @@
     fprintf( pipe_fp, "\nModem device: %s\n", Device );
     fprintf( pipe_fp, "\nCommunication parameters: %s\n", fax_param );
     fprintf( pipe_fp, "    Resolution : %s\n",
-		      fax_par_d.vr == 0? "normal" :"fine");
+	      (fax_par_d.vr == 0 || fax_par_d.vr == 8) ? "normal" :"fine");
     fprintf( pipe_fp, "    Bit Rate   : %d\n", ( fax_par_d.br+1 ) * 2400 );
     fprintf( pipe_fp, "    Page Width : %d pixels\n", fax_par_d.wd == 0? 1728:
 	              ( fax_par_d.wd == 1 ? 2048: 2432 ) );
--- mgetty-1.1.30.orig/logname.c
+++ mgetty-1.1.30/logname.c
@@ -51,7 +51,7 @@
 
 char * ln_escape_prompt _P1( (ep), char * ep )
 {
-#define MAX_PROMPT_LENGTH 140
+#define MAX_PROMPT_LENGTH 300
     static char * p = NULL;
     int    i;
     static struct utsname un;
@@ -191,7 +191,7 @@
     
     if ( *ep != 0 )
     {
-	lprintf( L_WARN, "buffer overrun - input prompt too long" );
+	lprintf( L_WARN, "ln_escape_prompt: input line too long - data truncated" );
     }
 
     return p;
--- mgetty-1.1.30.orig/README.1st
+++ mgetty-1.1.30/README.1st
@@ -72,7 +72,7 @@
 
 Generic questions ("it doesn't work") should go to the mgetty mailing list
 (mgetty@muc.de), because I just don't have time to explain it all again
-and again.
+and again.  (Un-)Subscription is done via mgetty-request@muc.de.
 
 And... please do not forget that I'm doing this kind of support entirely
 in my spare time - sometimes my answers will be very short, or it may
--- mgetty-1.1.30.orig/ugly.h
+++ mgetty-1.1.30/ugly.h
@@ -38,5 +38,10 @@
 #define const
 #define volatile
 
+/* <stdarg.h> and function(fmt,...) is incompatible with K&R protoypes */
+#ifndef USE_VARARGS
+#  define USE_VARARGS
+#endif
+
 #endif
 
--- mgetty-1.1.30.orig/ChangeLog
+++ mgetty-1.1.30/ChangeLog
@@ -1,3 +1,79 @@
+Wed Aug 20 12:39:53 MEST 2003  Gert Doering (gert@greenie.muc.de)
+
+	* fax/faxrunqd.in: change signal handling - use HUP for graceful
+	    exit, and dump statistics to logfile upon receipt of USR2
+
+Sat Jun 28 22:14:35 MEST 2003  Gert Doering (gert@greenie.muc.de)
+
+	* fax/faxq-helper.c: honour user umask when spooling G3 files
+	  (user decides whether group/other can read faxes)
+
+	* fax/faxspoool.in: reset umask after creating tmpdir (with umask 077)
+
+	* fax/faxq-helper.c: file name validation was overly strict - 
+	  accept anything that's printable, not a space, '/' or '\'
+
+Thu Jun 12 16:56:44 MEST 2003  Gert Doering (gert@greenie.muc.de)
+
+	* faxlib.c: Multitech and USR return class 2.0/2.1 +FPS:<x>,<lc>
+	  values in decimal, not hex -> change +FPS: parser to do decimal
+	  for those modems (via modem_quirks |= MQ_FPS_NOT_HEX)
+
+	* fax_lib.h: add MQ_FPS_NOT_HEX modem quirk bit
+
+	* faxrec.c, faxrecp.c: understand VR=8 for "normal mode" (200x100 dpi)
+
+Mon Apr 28 19:41:14 MEST 2003  Gert Doering (gert@greenie.muc.de)
+
+	* logname: make "buffer overrun" error message more precise
+
+Wed Apr 23 10:49:25 MEST 2003  John R. Jackson <jrj@purdue.edu>
+
+	* voice/libutil/access.c: more verbose error reporting
+
+Wed Apr  9 23:05:23 MEST 2003  Gert Doering (gert@greenie.muc.de)
+
+	* fax/faxspool.in: fix spooling without header line (-h -)
+
+Sun Apr  6 16:09:14 MEST 2003  Andreas Barth <aba@not.so.argh.org>
+
+	* mgetty.8in, mgetty.texi-in: document escape sequences for
+	  /etc/issue and login prompt.
+
+Wed Mar  5 21:37:38 MET 2003  Gert Doering (gert@greenie.muc.de)
+
+	* Makefile: abort "make install" before installing faxspool
+	  if fax user does not exist
+
+	* Makefile: unconditionally chown $FAX_SPOOL_OUT to fax user
+
+Tue Feb  4 17:46:45 MET 2003  Gert Doering (gert@greenie.muc.de)
+
+	* fax/faxq-helper.c: uid=0 overrides access permission checks
+
+	* fax/faxrm.in: bugfix: get faxq-helper path from sedscript
+
+Tue Jan 21 14:27:39 MET 2003  Gert Doering (gert@greenie.muc.de)
+
+	* fax/faxspool.in: abort with a proper error message on input file
+	  names containing white space or quote characters
+
+Tue Jan 14 14:30:42 MET 2003  Gert Doering (gert@greenie.muc.de)
+
+	* fax/faxrunqd.in: include "success" counter in per_phone_statistics
+
+	* ugly.h: #define USE_VARARGS for non-Ansi C compilers
+
+	* logfile.c: change #include<> sequence to catch USE_VARARGS def.
+
+Wed Jan  8 23:03:26 MET 2003  Gert Doering (gert@greenie.muc.de)
+
+	* fax/faxrunqd.in: if a fax job fails, reschedule on different
+	  modem (if possible)
+
+	* voice/libvoice/V253modem.c: fix ELSA_RMD_NAME (used for
+	  V.253 modem <-> other modem RMD equivalency checks)
+
 Mon Dec 16 14:08:06 MET 2002  Gert Doering (gert@greenie.muc.de)
 
 	* release 1.1.30
--- mgetty-1.1.30.orig/version.h
+++ mgetty-1.1.30/version.h
@@ -1 +1 @@
-char * mgetty_version = "experimental test release 1.1.30-Dec16";
+char * mgetty_version = "experimental test release 1.1.31-Sep23";
--- mgetty-1.1.30.orig/fax_lib.h
+++ mgetty-1.1.30/fax_lib.h
@@ -102,3 +102,6 @@
 #define MQ_NO_XON	0x08	/* do not wait for XON char when sending */
 #define MQ_USR_FMINSP	0x20	/* USR: +FCC=1,<max> sets MIN speed instead */
 #define MQ_SHOW_NSF	0x40	/* set AT+FNR=1,1,1,1 (with NSFs) */
+#define MQ_FPS_NOT_HEX	0x80	/* +FPS:<status>,<lc> reported as decimal */
+
+/* note: 0x100 and 0x200 currently used for teergrubing - faxrecp.c */
--- mgetty-1.1.30.orig/debian/TODO
+++ mgetty-1.1.30/debian/TODO
@@ -0,0 +1,19 @@
+This file notes what should be done (and what warnings we currently accept)
+for the Debian package.
+
+The current tree of example files should be re-visited and re-packaged.
+The goal is to throw all working-and-not-deprecated files at a script place,
+and mark all other as not working. However, the way to do this is to first
+create a scripting system, and then (as the next step) re-visit the scripts.
+So we ignore linda/lintian warnings and errors about the example scripts at
+the moment.
+
+We also need an rewrite of the upstream make system. This is on the way.
+So, if something is more or less an aesthetical problem, we ignore it if
+if needs changes in debian/rules. We'll do that direct after the
+implementation of the new makefiles.
+
+vm and newslock don't have a manpage, but - well, this is know by the BTS,
+and if someone sponsors one we'll happily accept it.
+
+Andreas Barth, 2003-09-28
--- mgetty-1.1.30.orig/debian/README.debian
+++ mgetty-1.1.30/debian/README.debian
@@ -0,0 +1,71 @@
+You can find documentation through (if the package mgetty-docs is installed!)
+
+1. info mgetty
+
+2. reading/printing the manual in this directory
+
+The only thing you usually need to do is customize the configuration
+files in /etc/mgetty and /etc/inittab.
+
+Inittab entries
+---------------
+You can find examples of inittab entries in:
+/usr/share/doc/mgetty/examples/inittab.DEBIAN (provided mgetty-docs is
+installed).
+
+Faxing (if mgetty-fax installed)
+--------------------------------
+In order for faxrunqd to be run by /etc/init.d/mgetty-fax, you will need
+to specify the port(s) to be used, in /etc/mgetty/faxrunqd.config
+
+Customize /etc/mgetty/faxheader to have your phone number on all faxes.
+
+The receiving script is stored as /etc/mgetty/new_fax. It receives four
+parameters or more: the hangup code, the remote id, the number of pages,
+the file names.
+
+If you are going to be using sendfax directly, then you'll probably
+want to tell it which ports to use in /etc/mgetty/sendfax.config
+
+--------------------------
+Some modems have a bug wherein they refuse to receive FAXes at any speed
+other than 19200 bps.  Many modern modems do not have this problem, so the
+default behavior of mgetty now is *not* to switch the speed to 19200 bps.
+
+IF you are having troubles with receiving FAXes, add the following line to
+your /etc/mgetty/mgetty.config:
+
+switchbd 19200
+
+This will put you back to the default behavior of mgetty prior to the
+release of version 1.1.0-2.
+
+PAP-Dialup
+----------
+mgetty's /etc/mgetty config files are preconfigured to allow easy access
+for dialup without a dialin script using PAP authentication.
+If you install the pppd package then dialup from Win95 or other compatible
+dialers is a snap. See win95.ppp in this directory.
+
+FIDO EMSI Handling
+------------------
+mgetty comes with FIDO support enabled. A sequence of characters is send
+before the login prompt to detect and EMSI session and later erased with
+backspace. If this causes problems then switch EMSI off in mgetty.config. 
+This can be done by placing a line "fido-send-emsi n" in /etc/mgetty.config.
+
+mgetty-voice Documentation and Examples
+---------------------------------------
+Can be found under /usr/doc/mgetty/voice once mgetty-docs has been installed.
+
+Windoze Client
+--------------
+There is a W9x/WNT client, which allows you to send faxes from windows
+to a server running mgetty, to be faxed:
+
+  http://www.itex.co.za/mgetty
+
+
+Philip Hands <phil@hands.com>
+Christoph Lameter <clameter@debian.org>
+John Goerzen <jgoerzen@complete.org>
--- mgetty-1.1.30.orig/debian/changelog
+++ mgetty-1.1.30/debian/changelog
@@ -0,0 +1,796 @@
+mgetty (1.1.30-6.backports.org.1) stable; urgency=low
+
+  * compiled on woody for backports.org. You might reports on this version to
+    the Debian BTS.
+ 
+ -- Andreas Barth <aba@not.so.argh.org>  Wed, 29 Oct 2003 22:12:30 +0100
+
+mgetty (1.1.30-6) unstable; urgency=low
+
+  * New maintainer team; we approve our own NMU of course.
+  * packages mostly linda/lintian clean, except causes given in debian/TODO
+  * updated to the most current upstream pre-version
+  * moved patches from and to upstream; removed now included patches and
+    one irrelevant one (suppression of action names in caller id strings)
+  * added fix for voice on Zoom 2949C / 2949L. Closes: #209140, #210465
+  * show also time at faxq. Closes: #209230
+  * removed recommendation on metamail. Closes: #212346
+  * fixed pid-file-path in mgetty-fax's init.d. Closes: #214479
+
+ -- Andreas Barth <aba@not.so.argh.org>  Wed,  8 Oct 2003 20:01:01 +0200
+
+mgetty (1.1.30-5.1) unstable; urgency=low
+
+  * NMU under the "we want sarge RSN"-policy, see 
+    http://lists.debian.org/debian-devel-announce/2003/debian-devel-announce-200308/msg00010.html
+  * mgetty: removes old log rotation in /etc/cron.daily/mgetty in postinst
+    (Closes: #202759)
+  * mgetty-fax: fixed permissions problem the way upstream recommends
+    (Closes: #201681)
+  * FTBFS fix (Closes: #201675)
+  * removed executable-bit from documentation
+  * removed leftovers from patches.
+
+ -- Andreas Barth <aba@not.so.argh.org>  Fri, 25 Jul 2003 10:35:34 +0200
+
+mgetty (1.1.30-5) unstable; urgency=low
+
+  * mgetty-fax: fix mgetty-fax.prerm to remove hidden files properly by testing for
+    "remove" instead of "purge".
+  * mgetty-fax: Reference faxrunq.config instead of faxrunqd.config in init script.
+  * mgetty-fax: faxrunqd's now runs as uucp most of the time but regains
+    and drops root priviledges as needed for logfile handling. Logfiles
+    are owned by root.adm and created with 0640 permissions. (Closes: #201282)
+  * mgetty-fax: Put faxrunqd's pidfile back into /var/run.
+  * mgetty-fax: faxrunqd now accepts -D and -g correctly. (Closes: #200815)
+  * mgetty-fax: faxrunqd accepts both ids and user-/groupnames as
+    parameters to -u and -g. (Thanks to Andreas Barth <aba@not.so.argh.org>)
+  * mgetty-fax: faxrunqd takes 7 logfiles into account when SIGUSR1 is
+    caught (instead of 3).
+  * mgetty-fax: faxrunqd does not display anything when SIGUSR2 (graceful
+    exit) is caught. This happens when "/etc/init.d/mgetty-fax stop" is
+    invoked.
+  * mgetty-fax: remove "-e" from init script execution since it is useless
+    and causes the configuration process to die when faxrunq.config is not
+    configured.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Tue, 15 Jul 2003 16:10:15 -0400
+
+mgetty (1.1.30-4) unstable; urgency=low
+
+  * New patch to create correct info section information from doc/mgetty.texi.
+  * Fix permissions for the new security scheme of mgetty-fax. Notify the
+    administrator about those changes during postinst. (Closes: #195179)
+  * Ensure correct permissions are set during execution of the postinst
+    script of mgetty-voice since we messed them up with the last release.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Tue,  8 Jul 2003 01:31:00 -0400
+
+mgetty (1.1.30-3) unstable; urgency=low
+
+  * Override permissions of /usr/lib/mgetty-fax/faxq-helper, /var/lock/fax
+    and /var/spool/fax/outgoing with dpkg-statoverride.
+  * /etc/mgetty/faxrunqd_should_not_be_run renamed to
+    faxrunqd_should_not_be_run to hide it. Removed during prerm phase of
+    mgetty-fax.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Fri,  4 Jul 2003 11:34:15 -0400
+
+mgetty (1.1.30-2) unstable; urgency=low
+
+  * Fixed some package descriptions.
+  * Install faxrunqd back into /usr/sbin/.
+  * Documentation for /etc/issue updated. Thanks to Andreas Barth
+    <aba@not.so.argh.org>. (Closes: #72269)
+  * Adapted faxrunq.conf to give example paths more compliant with the FHS.
+  * Remove useless warning from mgetty-fax.init.d. Make the start of
+    faxrunqd an installation option with debconf. (Closes: #68714)
+  * mgetty-fax now depends on debconf. Dependency on gs OR'd with
+    gs-aladdin and gs-esp for completion.
+  * Standards version set to 3.5.8 in debian/control.
+  * Permissions of binaries and directories set with post-installation
+    scripts instead of from debian/rules.
+  * README.Debian more accurate regarding /etc/mgetty/new_fax. (Closes: #197966)
+  * Obsolete bug reports. (Closes: #13540, #22156)
+  * Useless bug report. (Closes: #191623)
+  * Documentation fix. (Closes: #191525)
+  * Do not provide cron scripts anymore. Depends on logrotate instead.
+    (Closes: #127304)
+  * Merge of debian/postinst with debian/mgetty.postinst.
+  * Produce better tiff files. (Closes: #86917)
+  * New security scheme. Old bug closed. Security enhancements correctly
+    adapted to Debian. (Closes: #11478, #195179)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Tue,  1 Jul 2003 23:55:30 -0400
+
+mgetty (1.1.30-1) unstable; urgency=low
+
+  * New upstream release.
+  * Close this. (Closes: #170304)
+  * New modems: GVC MD 0340 and Multitech's MT5634ZBAV-V92. (Closes: #175498, #182923)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Mon, 28 Apr 2003 00:20:04 -0400
+
+mgetty (1.1.28-5) unstable; urgency=low
+
+  * mgetty-fax: stupid typo, be burning in hell! (Closes: #171251)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Sun,  1 Dec 2002 10:08:48 -0500
+
+mgetty (1.1.28-4) unstable; urgency=low
+
+  * This bug seems to have disappeared since 1.1.18. Reopen if needed
+    (Closes: #32808)
+  * mgetty-fax: erase /var/spool/fax/outgoing/.last_run when purging.
+    (Closes: #94283)
+  * No answer, seems to no more happen anyway. Reopen if needed
+    (Closes: #105459)
+  * Fix put in patch #12. Do not output anything when catching TERM or
+    HUP. (Closes: #139907)
+  * Patch #44: unclear char signedness fixed in faxinput.c.
+    (Closes: #169455)
+  * mgetty-fax: prerm/postrm running with '-e'.
+  * Patch #45: removed references to deprecated variables sys_nerr and
+    sys_errlist, using strerror instead.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Wed, 27 Nov 2002 19:13:52 -0500
+
+mgetty (1.1.28-3) unstable; urgency=low
+
+  * faxspool now accepts parameters with spaces. (Closes: 70081)
+  * This does not seem to happen anymore. (Closes: #93762)
+  * This bug does not occur anymore with recent versions of KDE.
+  (Closes: #101750)
+  * Recognize CallerID info from gsm modems. Thanks to Erwan MAS
+    <erwan_AT_mas.nom.fr> for his patch. (Closes: #112163)
+  * Fixes related to CallerID info handling. Thanks to Paul Miller
+    <paul_AT_pinheiro.tcimet.net> for his patch. (Closes: #128668)
+  * /bin/bash used to execute shell scripts. (Closes: #149851)
+  * Support for another Zoom modem software revision. Thanks to Jim
+    Winstead <jimw_AT_trainedmonkey.com> for his patch. (Closes: #156106)
+  * Stop faxrunqd gracefully. (Closes: #156665)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Mon, 28 Oct 2002 01:11:56 -0500
+
+mgetty (1.1.28-2) unstable; urgency=low
+
+  * Slightly optimized debian/rules with make tricks.
+  * mgetty-viewfax: viewfax.tif goes into /usr/share/doc/mgetty-viewfax/
+    since it's part of the documentation.
+  * mgetty-docs: both PS and HTML documentation is provided, texinfo is
+    kept if people need it (Closes: #47086)
+  * mgetty-fax: this feature has been supported in recent versions
+    (Closes: #60866)
+  * Viewfax's buffer run fixed in upstream 2.5 (Closes: #69971, #69974)
+  * mgetty-fax: this bug should not occur with current Perl 5.6.1. Reopen
+    if *really* needed (Closes: #77327)
+  * mgetty-fax: mime info provided, optional handling of unconverted g3
+    files provided in new_fax (Closes: #135277)
+  * mgetty-fax: stupid typo fixed now (Closes: #152246)
+  * mgetty: Respect Debian lock file standard naming
+            convention. (Closes: #153394)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Sat,  3 Aug 2002 17:26:56 -0400
+
+mgetty (1.1.28-1) unstable; urgency=low
+
+  * New Upstream Release.
+  * confirm bug close from NMU. (Closes: #140179)
+  * Splitted the main patch and put the resulting patches in
+    debian/patches for easier handling. The resulting diff should only
+    contain the Debian subdirectory now. Added "patch" as a
+    build-dependency.
+  * mgetty-fax: logs go into /var/log/mgetty.
+  * Depends on gs only (the gs-compatible packages should provide 'gs').
+  * Do not depend on perl5 anymore. Do not depend on perl at all since
+    perl-base should provide everything required.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Tue, 30 Jul 2002 04:23:29 -0400
+
+mgetty (1.1.27-4.1) unstable; urgency=high
+
+  * debian/rules:
+    - Install login.config with mode 600 instead of 644 (Closes: #140179)
+
+ -- Colin Walters <walters@debian.org>  Thu,  4 Apr 2002 23:18:06 -0500
+
+mgetty (1.1.27-4) unstable; urgency=low
+
+  * Fix spelling error in description for mgetty-docs. (Closes: #125130)
+  * Fix implicit declarations during compilation. (Closes: #125385)
+  * mgetty-pvftools: new package containing the pvftools stripped from the
+    mgetty-voice package.
+  * Put voice/ChangeLog into /usr/share/doc/mgetty/ChangeLog.voice.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Mon, 17 Dec 2001 22:03:32 -0500
+
+mgetty (1.1.27-3) unstable; urgency=low
+
+  * mgetty-voice: do not put value for voice_shell_log between quotes in
+    /etc/mgetty/voice.conf (Closes: #120456)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Thu, 22 Nov 2001 22:07:15 -0500
+
+mgetty (1.1.27-2) unstable; urgency=low
+
+  * mgetty-fax: fixes a security hole in /etc/mgetty/new_fax and depends
+    on debianutils (>= 1.6) for /bin/tempfile. (Closes: #111271)
+  * Depends on either gs or gs-aladdin. (Closes: #93640)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Tue, 20 Nov 2001 06:01:17 -0500
+
+mgetty (1.1.27-1) unstable; urgency=low
+
+  * New Upstream Release.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Tue, 20 Nov 2001 05:24:31 -0500
+
+mgetty (1.1.26-4) unstable; urgency=low
+
+  * faxrunqd doesn't automatically start as a daemon. (Closes: #115187)
+  * Bug fixed in NMU's (Closes: #36965, #56446, #70741, #46315, #50173,
+    #67453, #87922, #94689, #41874)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Wed, 10 Oct 2001 23:43:23 -0400
+
+mgetty (1.1.26-3) unstable; urgency=low
+
+  * Don't exit with code != 0 if info documentation is not found.
+    (Closes: 114942, 114612)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Wed, 10 Oct 2001 02:51:01 -0400
+
+mgetty (1.1.26-2) unstable; urgency=low
+
+  * New Maintainer.
+  * Bug fix in the daily cronjob which could cause severe disk consumption
+    under certain circumstances. (Closes: #75140, #74995)
+  * 1.1.26 does build on ia64. (Closes: #104828, #105089)
+  * Doc fix. (Closes: #46214, #47514)
+  * Suggests gs but do not depend on it (Closes: #69340)
+  * Obsolete bugs. (Closes: #54218, #88900, #36965, #56446, #111205,
+    #81521, #111170, #38918, #47705, #27336)
+
+ -- Wolfgang Sourdeau <was@debian.org>  Fri,  5 Oct 2001 03:48:39 -0400
+
+mgetty (1.1.26-1.1) unstable; urgency=low
+
+  * NMU.
+  * Added build-dependency on xlibs-dev, groff. (Closes: #111205)
+  * Removed "-g" from CFLAGS in g3/Makefile.
+  * Put custom header files (policy.h, voice-defs.h) in debian/.
+  * mgetty.info is now put in /usr/share/info instead of /usr/info/.
+  * mgetty-docs.postrm to mgetty-docs.prerm (for uninstalling mgetty.info at
+    the correct time).
+  * /etc/mgetty/login.config chmod'd to 0644.
+  * /var/spool/fax/outgoing, /var/lock/fax,
+    /var/spool/voice/{incoming,messages} chmod'd to 2775.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Fri,  7 Sep 2001 04:44:53 -0400
+
+mgetty (1.1.26-1) unstable; urgency=low
+
+  * NMU.
+  * Updated to version 1.1.26. (Closes: #41874, #46315, #50173, #67453, #69971, #69974, #81521, #87922, #94689)
+  * Missing manpages are marked as undocumented (debian/rules).
+  * .o files from the viewfax contributed package are not installed anymore.
+  * Removed references to dh_suidregister (debian/rules).
+  * mgetty.asc and mgetty.ms are not generated since texi2roff is not
+    packaged for Debian.
+  * added dependencies on debhelper, texi2html, texinfo, tetex-bin.
+  * removed "-g" from CFLAGS in certain Makefiles.
+
+ -- Wolfgang Sourdeau <was@debian.org>  Sun,  2 Sep 2001 19:30:53 -0400
+
+mgetty (1.1.21-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Changed chown invocation in debian/rules to fix build.
+  * Rebuilt on and for upload to sid. (Closes: #80640)
+
+ -- Robert McQueen <robot101@debian.org>  Thu, 25 Jan 2001 22:48:15 +0000
+
+mgetty (1.1.21-3potato1) stable; urgency=high
+
+  * SECURITY: fix for insecure tempfile handling
+  * disables fall-back delivery to /tmp
+
+ -- Michael Stone <mstone@debian.org>  Mon,  8 Jan 2001 23:03:10 -0500
+
+mgetty (1.1.21-3) stable; urgency=low
+
+  * make mgetty-fax's postinst create /var/spool/fax/outgoing/.last_run
+    to close a potential symlink exploit by members of the fax group
+    that is otherwise possible until that file is created
+
+ -- Philip Hands <phil@hands.com>  Thu, 31 Aug 2000 19:05:13 +0100
+
+mgetty (1.1.21-2.1) frozen unstable; urgency=medium
+
+  * Fixes new_fax file issue (Closes: #56446)
+  * NMU
+
+ -- Ivan E. Moore II <rkrusty@debian.org>  Mon, 14 Feb 2000 12:15:10 -0700
+
+mgetty (1.1.21-2) unstable; urgency=medium
+
+  * add test in prerm to work round old prerm problem (really closes: 47439)
+
+ -- Philip Hands <phil@hands.com>  Mon,  1 Nov 1999 12:14:10 +0000
+
+mgetty (1.1.21-1.1) unstable; urgency=low
+
+  * Non-maintainer upload
+  * Add --oknodo to init.d script so we don't fail miserably during
+    package removal. Closes: 47439
+
+ -- Wichert Akkerman <wakkerma@debian.org>  Sat, 30 Oct 1999 20:25:22 +0200
+
+mgetty (1.1.21-1) unstable; urgency=low
+
+  * New upstream release (closes: #41871, #41873, #41872)
+  * make cron.daily's execution conditional (closes: #34034)
+  * eliminate globbing in debhelper calls (closes: #32028)
+  * use new_fax.mime4 as the default new_fax (closes: #35984, #32545, #29117)
+  * move /usr/lib/mgetty+sendfax to /usr/lib/mgetty-fax
+  * document faxrunqd's options (closes: #31524)
+  * move fax receipt bits into mgetty (closes: #32020)
+  * add -D (daemon mode) option to faxrunqd
+  * move to using /usr/share/... for docs.
+
+ -- Philip Hands <phil@hands.com>  Sun, 26 Sep 1999 17:59:25 +0100
+
+mgetty (1.1.20-1) unstable; urgency=low
+
+  * New upstream release
+  * move most of mgetty-docs to /usr/doc/mgetty
+
+ -- Philip Hands <phil@hands.com>  Sat,  3 Apr 1999 20:53:24 +0100
+
+mgetty (1.1.18-2) unstable; urgency=low
+
+  * add /var/spool/fax/incoming directory to mgetty-fax
+    (closes: #25466, #24973)
+  * use giftopnm in faxspool (closes: #22135)
+  * add mgetty-fax dependency for ``gs'' (closes: #27336)
+  * include docs from voice section in mgetty-docs (closes: #27718)
+
+ -- Philip Hands <phil@hands.com>  Thu, 19 Nov 1998 14:48:15 +0000
+
+mgetty (1.1.18-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Philip Hands <phil@hands.com>  Mon, 28 Sep 1998 19:41:00 +0100
+
+mgetty (1.1.17-1) unstable; urgency=low
+
+  * New upstream release
+  * add mgetty-docs.post{inst,rm} to call install-info (closes: #22448)
+  * fix /FIDO/ entry in login.config to work with ifcico (closes: #24550)
+  * enable dialin.conf Caller ID (closes: #23652)
+
+ -- Philip Hands <phil@hands.com>  Wed, 26 Aug 1998 18:17:31 +0100
+
+mgetty (1.1.16-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Philip Hands <phil@hands.com>  Tue,  4 Aug 1998 10:44:33 +0100
+
+mgetty (1.1.14-4) unstable; urgency=low
+
+  * Fix several documentation/script mistakes pointed out by The Man
+    Himself -- Gert Doering.
+ 
+ -- Philip Hands <phil@hands.com>  Fri, 19 Jun 1998 22:48:48 +0100
+
+mgetty (1.1.14-3) unstable; urgency=low
+
+  * fix debian/rules so the it does not refer to arch indep stuff in the
+    arch dep section (closes: #22800, #22539)
+  * fix g32pbm reference in new_fax (closes: #22615)
+  * recompile after installing makeinfo (closes: #22448)
+
+ -- Philip Hands <phil@hands.com>  Fri, 15 May 1998 01:14:41 +0100
+
+mgetty (1.1.14-2) frozen unstable; urgency=low
+
+  * fix faxspool locking problem (# 9273)
+
+ -- Philip Hands <phil@hands.com>  Fri, 15 May 1998 01:14:41 +0100
+
+mgetty (1.1.14-1) frozen unstable; urgency=low
+
+  * New upstream release
+  * Add CONFDIR= bit to make install in debian/rules (closes: #20922)
+  * move over to debhelper
+  * stop postinst editing /etc/crontab & /etc/inittab (closes: #20651)
+  * include magic files in /usr/doc/ (closes: #13183)
+  * build mgetty-docs in binary-indep (closes: #16693)
+  * fix FIDO line in /etc/mgetty/login.config (closes: #21031)
+
+ -- Philip Hands <phil@hands.com>  Fri,  3 Apr 1998 10:27:11 +0100
+
+mgetty (1.1.12-1) unstable; urgency=low
+
+  * New upstream release
+  * recompiling seems to have fixed the sendfax segfault problem.
+    (closes: #17825, #18209, #16684)
+  * split viewfax out into mgetty-viewfax (closes: #18194)
+  * exclude .bz2 files from savelog in cron.daily (closes: #16463)
+
+ -- Philip Hands <phil@hands.com>  Fri,  6 Feb 1998 09:45:05 +0000
+
+mgetty (1.1.9-3) unstable; urgency=low
+
+  * ensure HAVE_SIGINTERRUPT gets defined for glibc2, which should stop
+    lockups apparently caused by changes to signal()'s behaviour.
+
+ -- Philip Hands <phil@hands.com>  Sat, 29 Nov 1997 14:30:41 +0000
+
+mgetty (1.1.9-2) unstable; urgency=low
+
+  * Include man1/mgetty-fax.1 in mgetty-fax (was in mgetty-voice briefly)
+  * get rid of viewfax stuff mistakenly included in mgetty-docs (fixes: #11475)
+  * make faxrunqd a conffile (fixes #11476)
+  * fix paths in faxrunqd (fixes: #11477,#12057)
+  
+ -- Philip Hands <phil@hands.com>  Wed, 26 Nov 1997 23:44:57 +0000
+
+mgetty (1.1.9-1) unstable; urgency=low
+
+  * New upstream release
+  * add cron scripts to conffiles (#7384)
+  * fix permissions on some doc files (#11285)
+  * fix permissions for /var/spool/fax/outgoing/locks (#11466)
+
+ -- Philip Hands <phil@hands.com>  Mon,  3 Nov 1997 18:02:06 +0000
+
+mgetty (1.1.8-1) stable; urgency=medium
+
+  * New maintainer
+  * New upstream release (fixes ``become root'' security bug in scripts)
+  * #11488 Fix bug in /etc/cron.daily/mgetty (postinst tidies up after this)
+  * compiled with libc5 (so it can go into bo)
+
+ -- Philip Hands <phil@hands.com>  Thu, 31 Jul 1997 11:42:21 +0100
+
+mgetty (1.1.7-3) unstable; urgency=low
+
+  * fixed it.  :)  recompiled with libc6
+
+ -- Paul Haggart <phaggart@debian.org>  Sat, 21 Jun 1997 19:58:16 -0400
+
+mgetty (1.1.7-2) unstable; urgency=low
+
+  * forced into libc5 until I get around to fixing it
+  * fax.1 manpage renamed to mgetty-fax.1
+  * policy.h: init string changed to "AT" 
+
+ -- Paul Haggart <phaggart@debian.org>  Thu, 12 Jun 1997 15:10:05 -0400
+
+mgetty (1.1.7-1) unstable; urgency=low
+
+  * new maintainer
+  * new upstream release
+  * mgetty-voice added
+  * policy.h, voice/include/paths.h: all log files generated by {m,v}getty 
+    are now located in /var/log/mgetty/*
+  * policy.h: logging to syslog enabled
+  * policy.h: mgetty uses /usr/sbin/sendmail instead of /usr/lib
+
+ -- Paul Haggart <phaggart@debian.org>  Mon,  9 Jun 1997 18:22:44 -0400
+
+mgetty (1.1.2-1) unstable; urgency=low
+
+  * New upstream release
+  * Upgraded from debmake 2.72 to debmake 3.2.1
+  * Closed bug reports filed against an older mgetty that have already
+    been fixed:
+    * #7426 (/var/log/mgetty)
+    * #7497 (permissions)
+    * #7724 (permissions)
+      (fixed permissions on /etc/mgetty/login.config, also mentioned
+      in this one)
+    * #7745 (permissions)
+  * Now only suggests (instead of reccommends) mgetty-fax; closes
+    bug #7700 
+  * Closed bug #7498.  I agree with the upstream author that a modification
+    to PATH is good, but I have changed it to insert the extra directory
+    *after* the user's PATH variable instead of before it.
+
+ -- John Goerzen <jgoerzen@complete.org>  Sun, 2 Mar 1997 17:03:06 -0600
+
+mgetty (1.1.1-1) unstable; urgency=low
+
+  * New upstream release
+  * Bug against previous releases of mgetty closed:
+    #7213
+  * Fixed permissions on /var/spool/fax/outgoing/locks (fixing bug #7231)
+    and /var/spool/fax/outgoing
+  * Daily cron scripts now listed as conffiles (fixes bug #7384)
+
+ -- John Goerzen <jgoerzen@complete.org>  Fri, 14 Feb 1997 21:20:03 -0600
+
+mgetty (1.1.0-2) unstable; urgency=low
+
+  * Added info to README.debian explicitly spelling out how to disable
+    EMSI.
+  * Added symlinks from /usr/doc/mgetty-docs and /usr/doc/mgetty-fax to
+    the mgetty directory, fixing bugs #6305, #6363
+  * Bug #6662 has already been fixed in version 0.99.8-2; now closing it.
+  * Bug #6112 closed: maintainer cannot duplicate it and the submittor
+    hasn't responded to request for more information.  If the submittor
+    (or anyone else) can duplicate it, please send another report to
+    submit@bugs.debian.org and open a new report.
+  * Changed FAXREC_FLOW from FLOW_SOFT to FLOW_BOTH
+  * Changed FAXSEND_FLOW from FLOW_SOFT to FLOW_BOTH
+  * Now compiled by default to **NOT** switch port speed on FAX receive.
+    Added documentation to README.debian explaining how to set it up
+    to revert to the old default behavior.
+  * Bug #6873 closed -- /var/log/mgetty *does* exist and maintainer
+    cannot duplicate the problem.  Submittor of the bug did not elaborate
+    on problem upon request.  Bug will be re-openened if submittor will
+    provide contact me.
+  * Bug #6897 closed -- apparently the problem is the cable and/or
+    the Mac.
+
+ -- John Goerzen <jgoerzen@complete.org>  Wed, 29 Jan 1997 22:36:51 -0600
+
+mgetty (1.1.0-1) unstable; urgency=low
+
+  * Some fixes to the source package; fixes bug #6817
+  * New upstream release
+
+ -- John Goerzen <jgoerzen@complete.org>  Fri, 24 Jan 1997 01:17:30 -0600
+
+mgetty (1.0.0-3) stable unstable; urgency=low
+
+  * Updated the copyright file to reflect the latest copyright/license
+  * Upon feedback from previous maintainer <clameter@debian.org>, reverted
+    to previous directory scheme even though ``dpkg-source -x'' cannot (yet)
+    properly unpack it.  (This particular change has no effect on users
+    using only the binary package.)
+    [there are some directories created beneath the debian directory
+     in the source package]
+
+ -- John Goerzen <jgoerzen@complete.org>  Sat, 18 Jan 1997 00:35:50 -0600
+
+mgetty (1.0.0-2) stable unstable; urgency=low
+
+  * New maintainer: John Goerzen <jgoerzen@complete.org>
+  * Now makes a valid source-package -- no extra directories created
+    Also hacked to work with debstd
+  * Minor modifications to various files in debian directory
+
+ -- John Goerzen <jgoerzen@complete.org>  Fri, 17 Jan 1997 04:04:20 -0600
+
+mgetty (1.0.0-1) stable unstable; urgency=low
+
+  * New upstream non-beta release. Voice Part removed since considered unstable
+
+ -- Christoph Lameter <clameter@debian.org>  Mon, 13 Jan 1997 21:08:12 -0800
+
+mgetty (0.99.9-2) unstable; urgency=low
+
+  * mgetty-fax: rotate sendfax.log weekly.
+
+ -- Christoph Lameter <clameter@debian.org>  Fri, 10 Jan 1997 08:39:00 -0800
+
+mgetty (0.99.9-1) unstable; urgency=low
+
+  * /etc/mgetty/new_fax supplied instead of it being a symlink
+  * allow installation of pbm supplements again since names do not conflict
+    anymore with netbpm.
+  * New upstream release
+
+ -- Christoph Lameter <clameter@debian.org>  Sun, 5 Jan 1997 20:35:21 -0800
+
+mgetty (0.99.8-2) unstable; urgency=low
+
+  * /etc/mgetty/new_fax made a conffile
+  * debian/watch file supplied
+
+ -- Christoph Lameter <clameter@debian.org>  Wed, 25 Dec 1996 14:13:19 -0800
+
+mgetty (0.99.8-1) stable unstable; urgency=low
+
+  * Upstream update
+
+ -- Christoph Lameter <clameter@debian.org>  Tue, 24 Dec 1996 19:34:34 -0800
+
+mgetty (0.99.7-1) stable unstable; urgency=low
+
+  * Changelog renamed to changelog.upstream
+  * Upstream update. Newest Standards.
+  * mgetty-fax: depend on netpbm
+  * mgetty-fax: do not install /usr/bin/g3topbm and pbmtog3
+  * mgetty-fax: remove diversions that made g3topbm/pbmtog3 unusable if
+    netpbm not installed.
+
+ -- Christoph Lameter <clameter@debian.org>  Thu, 19 Dec 1996 13:24:08 -0800
+
+mgetty (0.99.6-1) unstable; urgency=low
+
+  * New upstream release. Note that mgetty contains FIDO dialin support since
+    0.99.3-2
+
+ -- Christoph Lameter <clameter@debian.org>  Sat, 7 Dec 1996 11:09:09 -0800
+
+mgetty (0.99.4-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Christoph Lameter <clameter@debian.org>  Tue, 19 Nov 1996 19:07:01 -0800
+
+mgetty (0.99.3-2) unstable; urgency=low
+
+  * FIDO support enabled. New directive in mgetty.config (patch from Author)
+    which controls the sending of the EMSI string. On by default.
+    Switch it off if you get into problems with ppp connections and have
+    users complain about strange things on the screen.
+  * policy.h was doubled in last release ??
+
+ -- Christoph Lameter <clameter@debian.org>  Fri, 8 Nov 1996 10:19:06 -0800
+
+mgetty (0.99.3-1) unstable; urgency=low
+
+  * allow mgetty-fax to depend on X libraries.
+  * upstream update
+
+ -- Christoph Lameter <clameter@debian.org>  Thu, 7 Nov 1996 12:13:38 -0800
+
+mgetty (0.99.2-7) unstable; urgency=low
+
+  * Split up package in mgetty, mgetty-fax, mgetty-voice, mgetty-docs
+  * /FIDO/ enabled in login.config but still compiled without FIDO support
+    enabled since it generates weird characters on login.
+
+ -- Christoph Lameter <clameter@debian.org>  Wed, 6 Nov 1996 21:46:34 -0800
+
+mgetty (0.99.2-6) unstable; urgency=low
+
+  * viewfax included in distribution
+  * depend on cron
+
+ -- Christoph Lameter <clameter@debian.org>  Thu, 31 Oct 1996 08:21:19 -0800
+
+mgetty (0.99.2-5) unstable; urgency=low
+
+  * bug in postrm script
+
+ -- Christoph Lameter <clameter@debian.org>  Wed, 30 Oct 1996 17:48:35 -0800
+
+mgetty (0.99.2-4) unstable; urgency=low
+
+  * stripped newslock
+  * guina pig for debmake 1.03
+
+ -- Christoph Lameter <clameter@debian.org>  Sat, 26 Oct 1996 19:12:22 -0700
+
+mgetty (0.99.2-3) unstable; urgency=low
+
+  * postinst wrote some stuff to output that it should not have
+
+ -- Christoph Lameter <clameter@debian.org>  Fri, 25 Oct 1996 09:11:26 -0700
+
+mgetty (0.99.2-2) unstable; urgency=low
+
+  * debmake 0.91 gets rid of most scripts
+
+ -- Christoph Lameter <clameter@debian.org>  Tue, 22 Oct 1996 17:09:28 -0700
+
+mgetty (0.99.2-1) unstable; urgency=low
+
+  * New upstream release
+  * include frontends section in /usr/doc/mgetty
+  * include callback binary + manpage
+  * Fixed the echo command problems
+
+ -- Christoph Lameter <clameter@debian.org>  Sat, 19 Oct 1996 14:26:16 -0800
+
+mgetty (0.99-12) unstable; urgency=low
+
+  * debmake bug: scripts not included in -11
+
+ -- Christoph Lameter <clameter@debian.org>  Thu, 17 Oct 1996 06:54:41 -0800
+
+mgetty (0.99-11) unstable; urgency=low
+
+  * Added g3tolj and g3toxwd to distribution
+  * switched to using debmake for generating the package so I dont forget
+    or mess up permissions in the future.
+  * Script to implement log rotation had wrong name and wrong permissions.
+
+ -- Christoph Lameter <clameter@debian.org>  Sat, 12 Oct 1996 21:30:15 -0800
+
+mgetty (0.99-10) unstable; urgency=low
+
+  * Added log rotation
+  * Added changelog.Debian in /usr/doc/mgetty
+
+ -- Christoph Lameter <clameter@debian.org>  Sat, 12 Oct 1996 09:00:00 -0800
+
+mgetty (0.99-9) unstable;urgency=low
+
+  * bug in postinst: wrong location of inittab.DEBIAN
+
+ -- Christoph Lameter <clameter@debian.org>  Mon, 7 Oct 1996 09:00:00 -0800
+
+mgetty (0.99-8) unstable;urgency=low
+
+  * /etc/mgetty/login.config: Disabled /FIDO/ line. Provided a sane pppd    
+    invocation line.
+  * script in /etc/mgetty/new_fax moved to /usr/lib/mgetty+sendfax since
+    dpkg does not seem to allow executable scripts in /etc.
+    /etc/mgetty/new_fax made a symlink to /usr/lib/mgetty+sendfax/new_fax.
+    Change the symlink to a modified script if you need to.
+  * Documentation in README.debian updated.
+
+ -- Christoph Lameter <clameter@debian.org>  Sat, 5 Oct 1996 09:00:00 -0800
+
+mgetty (0.99-7) unstable;urgency=low
+
+  * updated Documentation
+  * Made new_fax executable
+  * Removed the /etc/init.d/fax stuff again since running a perl
+    binary all the time is not very resource friendly. Plus the
+    stopping of that daemon did not work.
+  * Automatically add an entry to crontab to run faxrunq every half hour.
+
+ -- Christoph Lameter <clameter@debian.org>  Thu, 3 Oct 1996 09:00:00 -0800
+
+mgetty (0.99-6) unstable;urgency=low
+
+  * Fax is created with group fax instead of uucp
+  * Diversions added for g3topbm and pbmtog3 for the netpbm package
+  * /etc/init.d/fax script provided for fax queue runs. postinst, postrm
+    modified accordingly
+  * New upstream 0.99 beta release from September 15, 1996 from ftp.leo.org
+  * Installation adds examples to /etc/inittab and also a new documentation
+    file inittab.DEBIAN is included. The mgetty section in /etc/inittab
+    will be removed on purging the packet.
+
+ -- Christoph Lameter <clameter@debian.org>  Tue, 24 Sep 1996 09:00:00 -0800
+
+mgetty (0.99-5) unstable;urgency=low
+
+  * info files, manpages and big doc files gzipped
+  * Added voice.conf file and a lot of information that was missing
+    regarding using mgetty as an answering machine etc. Someone please
+    test the voice part since I dont use that part of mgetty.
+  * Moved faxrunq* to /usr/sbin
+
+ -- Christoph Lameter <clameter@waterf.org>  Fri, 20 Sep 1996 09:00:00 -0800
+
+mgetty (0.99-4) unstable;urgency=low
+
+  * Added Doc on how to do dialup from win95 with mgetty/ppp
+  * New upstream 0.99 beta release from August 07.
+
+ -- Christoph Lameter <clameter@waterf.org>  Sat, 7 Sep 1996 09:00:00 -0800
+
+mgetty (0.99-3) unstable;urgency=high
+
+  * Updated to new standards 2.1.0.0 (big change, please test everything!)
+  * Removes /var/log/mgetty on deinstallation
+  * Fixes permission issue
+  * Available Documentation in /usr/doc/mgetty included
+  * Available Samples in /usr/doc/examples/mgetty included
+  * new_fax script automatically preconfigured
+  * README.debian included with known problems
+  * Sane Makefile behaviour
+  * faxheader and new_fax moved to /etc/mgetty as they are config files
+
+Thy Jul  25 Christoph Lameter <clameter@waterf.org>
+
+	* upgrade to 0.99 version of July 23, 1996
+	* some locations / names of files in voice section
+	were changed and resultet in minor changes to installation procedure
+
+Fri Nov  3 21:53:03 1995  Nils Rennebarth  <nils@nus.pan-net.de>
+
+	* Created a new package
+
+
--- mgetty-1.1.30.orig/debian/policy.h
+++ mgetty-1.1.30/debian/policy.h
@@ -0,0 +1,602 @@
+#ident "@(#)policy.h	4.3 97/06/05 Copyright (c) Gert Doering"
+
+/* this is the file where all configuration defaults for mgetty / sendfax
+ * are specified.
+ *
+ * defaults are used if no values are given in the config file(s).
+ * config file values can be overridden by command line options.
+ *
+ * see mgetty.texi/mgetty.info for a description of the configuration files.
+ */
+
+/* main mgetty configuration file
+ */
+#define MGETTY_CONFIG "mgetty.config"
+
+/* sendfax configuration file
+ *
+ * if path doesn't start with "/", it's relative to CONFDIR (Makefile)
+ * if not defined, no configuration file is read (saves a few kbytes)
+ */
+#define SENDFAX_CONFIG "sendfax.config"
+
+
+/* login dispatcher config file (for mgetty)
+ *
+ * In this file, you can configure which "login" program (default /bin/login)
+ * to call for what user name.
+ *
+ * You could use it to call "uucico" for all users starting with "U*"
+ * (works only with Taylor UUCP 1.04 with my patch), or to call a fido
+ * mailer for fido calls (only if -DFIDO defined)...
+ * See the samples in the example login.config file (built from login.cfg.in).
+ *
+ * WARNING: make sure that this file isn't world-accessable (SECURITY!)
+ *
+ * If you want to call /bin/login in any case, do not define this
+ *
+ * If this doesn't start with "/", it's relative to CONFDIR.
+ */
+#define LOGIN_CFG_FILE "login.config"
+
+/* default login program
+ *
+ * If LOGIN_CFG_FILE is not defined, or does not exist, or doesn't
+ * have a default entry, this program is called for user logins.
+ * Normally, this is "/bin/login", just a few systems put "login"
+ * elsewhere (e.g. Free/NetBSD in "/usr/bin/login").
+ */
+#define DEFAULT_LOGIN_PROGRAM "/bin/login"
+
+
+/* callback config file
+ *
+ * this file controls the operation of the optional "callback" program.
+ * how callback works, is explained in detail in mgetty.texi. You need
+ * to set LOGIN_CFG_FILE (see above) to use callback from mgetty. 
+ *
+ * If this path does not start with "/", it's relative to CONFDIR.
+ */
+#define CALLBACK_CONFIG "callback.config"
+
+
+/* if this file exists, it can be used to control what callers
+ * are allowed in.  If undefined, the functionality is omitted.
+ * It will work only if your modem supports it. Check the modem manual.
+ * For Rockwell-Based modems, add #CID=1 to MODEM_INIT_STRING, for
+ * ZyXELs use S40.2=1.
+ * If the path doesn't start with "/", it's relative to CONFDIR.
+ */
+#define CNDFILE "dialin.config"
+
+
+/* If you want to use /etc/gettydefs to set tty flags, define this
+ * I recommend against it, I suspect some bugs lingering in that code
+ * (and one doesn't really need it in a normal setup anyway).
+ */
+/* #define USE_GETTYDEFS */
+
+/* Name of the "gettydefs" file (used only if USE_GETTYDEFS is set)
+ */
+#define GETTYDEFS "/etc/gettydefs"
+
+/* If no gettydefs "tag" is specified on the command line, use
+ * this setting (from GETTYDEFS) as default (only if compiled with
+ * USE_GETTYDEFS set)
+ */
+#define GETTYDEFS_DEFAULT_TAG "n"
+
+
+/* access modes */
+
+/* user id of the "uucp" user. The tty device will be owned by this user,
+ * so parallel dial-out of uucico will be possible
+ */
+#define DEVICE_OWNER	"root"
+/* group id that the device is chown()ed to. If not defined, the
+ * primary group of "DEVICE_OWNER" is used.
+ */
+#define DEVICE_GROUP	"dialout"
+
+/* access mode for the line while getty has it - it should be accessible
+ * by uucp / uucp, but not by others (imagine someone dialing into your
+ * system and using another modem to dial to another country...)
+ */
+#define FILE_MODE 0660
+
+/* security: optionally, mgetty can system() this, to kill any dangling
+ * processes on the current tty. A %s is replaced with the tty device.
+ * NOT NEEDED on SCO, SunOS 4 or Linux!
+ */
+/* #define EXEC_FUSER "exec fuser -k -f %s >/dev/null 2>&1" */
+
+
+/* logging */
+
+/* system console - if a severe error happens at startup, mgetty writes
+ * a message to this file and aborts
+ * On SCO, this may be /dev/syscon!
+ */
+#define CONSOLE "/dev/console"
+
+/* Name of the mgetty log file
+ * e.g. "/usr/spool/log/mgetty.log.%s" or "/tmp/log_mg.%s"
+ * a "%s" will be replaced by the device name, e.g. "tty2a"
+ *
+ * if the directory does not exist, the log file goes to CONSOLE (!)
+ */
+#define LOG_PATH "/var/log/mgetty/mg_%s.log"
+
+/* Default log error level threshold. Possible error levels are
+ * L_FATAL, L_ERROR, L_WARN, L_AUDIT, L_MESG, L_NOISE, L_JUNK (see mgetty.h)
+ */
+#define LOG_LEVEL L_MESG
+
+/* Whether "\n"s in the modem response should start a new line
+ * in the logfile
+ */
+/* #define LOG_CR_NEWLINE */
+
+/* System administrator - if a severe error happens (lprintf called
+ * with log_level L_FATAL) and writing to CONSOLE is not possible,
+ * the logfile will be mailed to him
+ */
+#define ADMIN	"root"
+
+/* Syslog
+ *
+ * If you want logging messages of type L_AUDIT, L_ERROR and L_FATAL
+ * to go to the "syslog", define this.
+ * mgetty will use the facility "LOG_AUTH", and the priorities
+ * LOG_NOTICE, LOG_ERR and LOG_ALERT, respectively.
+ */
+#define SYSLOG 
+
+/* Syslog facility
+ *
+ * This is the facility mgetty uses for logging. Ususally, this will be
+ * LOG_AUTH, but on some systems, this may not exist, try LOG_DAEMON
+ * instead (or look into the syslog manpage for available options)
+ */
+#define SYSLOG_FC LOG_AUTH
+
+/* login stuff */
+
+/* System name - printed at login prompt
+ * If you do not define this, the uname() call will be used
+ */
+/* #define SYSTEM	"greenie" */
+
+/* Login prompt
+ * The "@", "\\D" and "\\T" escapes will be replaced by SYSTEM, the
+ * current date and time, respectively.
+ * override with "-p <prompt>" switch
+ */
+#define LOGIN_PROMPT	"@ login: "
+
+/* On SVR4, maybe on other systems too, you can cause the 'login' program
+ * to prompt with the same string as mgetty did, instead of the standard
+ * "login:" prompt. The string will be passed to the 'login' program
+ * in the environment variable TTYPROMPT.
+ * This is done by putting "login" into a special (brain-dead) "ttymon"-
+ * compatibility mode. In that mode, mgetty doesn't ask for a login name
+ * at all, so mgetty won't work if you enable that feature and your
+ * login program doesn't support it. (You can see if it doesn't work
+ * if the user gets a double login prompt or none at all).
+ *
+ * This feature automatically disables FIDO and AutoPPP support!
+ *
+ * To use this feature, define ENV_TTYPROMPT.
+ */
+/* #define ENV_TTYPROMPT */
+
+/* Maximum time before login name has to be entered (in seconds)
+ * (after that time a warning will be issued, after that, the call is
+ * dropped). To disable that feature, do not define it.
+ */
+#define MAX_LOGIN_TIME	240
+
+/* nologin file
+ *
+ * If that file exists, a ringing phone won't be answered (see manual).
+ * "%s" will be replaced by the device name.
+ */
+#define NOLOGIN_FILE "/etc/nologin.%s"
+
+
+/* misc */
+
+/* how to find mgetty..
+ *
+ * If you define this, mgetty will create a file with the given name and
+ * put its process ID in it. A "%s" will be replaced by the device id.
+ *
+ * Depending on your system, "/var/run/mgetty.%d" might be a good place.
+ */
+#define MGETTY_PID_FILE	"/var/run/mg-pid.%s"
+
+/* Path for the lock files. A %s will be replaced with the device name,
+ * e.g. tty2a -> /usr/spool/uucp/LCK..tty2a
+ * Make sure that this is the same file that your uucico uses for
+ * locking!
+ */
+
+/* for a few systems, you can just take those defaults and be happy */
+#if defined (SVR4) || defined(sunos4)
+# define LOCK_PATH "/var/spool/locks"
+# define LOCK      "/var/spool/locks/LCK..%s"
+#else
+# ifdef sgi
+#  define LOCK	"/usr/spool/locks/LCK..%s"
+# endif
+# ifdef _AIX
+#  define LOCK	"/etc/locks/LCK..%s"
+# endif
+# ifdef NeXT
+#  define LOCK "/usr/spool/uucp/LCK/LCK..%s"
+# endif
+# ifdef linux
+#  define LOCK	"/var/lock/LCK..%s"
+# endif
+#endif
+
+/* if your system isn't listed above, change that line here */
+#ifndef LOCK
+#define LOCK "/var/lock/LCK..%s"
+#endif
+  
+/* Set this to "1" if your system uses binary lock files (i.e., the pid
+ * as four byte integer in host byte order written to the lock file)
+ * If it is "0", HDB locking will be used - the PID will be written as
+ * 10 byte ascii, with a trailing newline
+ * (Just check "LOCK" while uucico or pcomm or ... are running to find
+ * out what lock files are used on your system)
+ * On NeXT systems, you must set this to "1".
+ */
+#define LOCKS_BINARY 0
+
+/* Lower case locks - change the last character of the device name
+ *                    to lowercase for locking purposes.
+ *
+ * If you're using a SCO Unix system with those "tty1a/tty1A" device
+ * pairs, you'll have to define this.
+ */
+/* #define LOCKS_LOWERCASE */
+
+/* Change _all_ characters to lowercase (currently no system uses this) */
+/* #define LOCKS_ALL_LOWERCASE */
+
+
+/* the default speed used by mgetty - override it with "-s <speed>"
+ *
+ * WARNING: this is a bit tricky, since some modems insist on going to
+ * 19200 bps when in fax mode. So, if fax receiving with a port speed of
+ * something else doesn't work, try experimenting with FAX_RECV_SWITCHBD,
+ * and if that doesn't help, try DEFAULT_PORTSPEED 19200
+ *
+ * WARNING2: Speeds higher than 38400 aren't supported on all platforms,
+ * and sometimes you have to use "50" to get 57600 or so!
+ */
+#define DEFAULT_PORTSPEED	38400
+
+/* the modem initialization string
+ *
+ * the default string should set up most hayes compatible modems into a
+ * fairly sane state (echo on, verbose reports on, quiet off, reset on
+ * DTR toggle on), but it doesn't set any flow control options (because
+ * that's done differently on each modem, look into your manual for commands
+ * like &H3, &K4, \Q6 or similar things) or protocols.
+ *
+ * You can change the initialization sequence with the "init-chat" keyword
+ * in "mgetty.config".
+ *
+ * If you need delays, specify them as "\\d", if you want to send a
+ * backslash ('\'), give it as "\\\\".
+ *
+ * Very IMPORTANT: make sure that the modem assigns the DCD line properly,
+ * usually this is done with the AT&C1 command!
+ *
+ * The modem must answer with "OK" (!!!) - otherwise, use "init-chat".
+ */
+#define MODEM_INIT_STRING	"AT"
+
+/* command termination string
+ *
+ * for most modems, terminating the AT... command with "\r" is
+ * sufficient and "\r\n" also works without doing harm.
+ * Unfortunately, for the Courier HST, you've to use *only* \r,
+ * otherwise ATA won't work (immediate NO CARRIER), and for some
+ * (old) ZyXELs, you have to use \r\n (no OK otherwise).
+ * So, try one, and if it doesn't work, try the other.
+ */
+#define MODEM_CMD_SUFFIX "\r"
+
+/* "keep alive"
+ *
+ * mgetty can periodically check whether the modem is still alive
+ * by issueing an "AT\r" command and checking for the "OK"
+ * Define here, in seconds, how often mgetty should check. For normal
+ * reliable modems, once an hour should be sufficient...
+ * If you use "-1", or don't define this at all, mgetty won't check.
+ */
+#define MODEM_CHECK_TIME 3600
+
+
+/* modem mode
+ *
+ * DEFAULT_MODEMTYPE specifies the default way mgetty+sendfax handle a
+ * faxmodem. You have four choices:
+ *   "data" - data only, no faxing available (for sendfax, equal to "auto")
+ *   "cls2" - use AT+FCLASS=2
+ *   "c2.0" - use AT+FCLASS=2.0
+ *   "auto" - try "2.0", then "2", then fall to "data".
+ *
+ * Normally, you can leave this to "auto", but if you have a modem that
+ * can do class 2.0 and class 2, and 2.0 doesn't work, then you could try
+ * setting it to "cls2".
+ * You can override this define with the "-C <mode>" switch.
+ */
+#define DEFAULT_MODEMTYPE "auto"
+
+
+/* some modems are a little bit slow - after sending a response (OK)
+ * to the host, it will take some time before they can accept the next
+ * command - specify the amount needed in data mode here (in
+ * milliseconds). Normally, 50 ms should be sufficient. (On a slow
+ * machine it may even work without any delay at all)
+ *
+ * Be warned: if your machine isn't able to sleep for less than one
+ * second, this may cause problems.
+ */
+#define DO_CHAT_SEND_DELAY 50
+ /* and this is the delay before sending each command while in fax mode
+  */
+#define FAX_COMMAND_DELAY 50
+
+/* incoming faxes will be chown()ed to this uid and gid.
+ * if FAX_IN_GROUP is undefined, the group of ...OWNER is used.
+ */
+#define FAX_IN_OWNER	"root"
+#define FAX_IN_GROUP	"fax"
+
+/* incoming faxes will be chmod()ed to this mode
+ * (if you do not define this, the file mode will be controlled by
+ * mgetty's umask)
+ */
+#define FAX_FILE_MODE 0660
+
+/* FLOW CONTROL
+ *
+ * There are basically two types of flow control:
+ * - hardware flow control: pull the RTS/CTS lines low to stop the other
+ *   side from spilling out data too fast
+ * - sofware flow control: send an Xoff-Character to tell the other
+ *   side to stop sending, send an Xon to restart
+ * obviously, use of Xon/Xoff has the disadvantage that you cannot send
+ * those characters in your data anymore, but additionally, hardware flow
+ * control is normally faster and more reliable
+ *
+ * mgetty can use multiple flow control variants:
+ * FLOW_NONE  - no flow control at all (absolutely not recommended)
+ * FLOW_HARD  - use RTS/CTS flow control (if available on your machine)
+ * FLOW_SOFT  - use Xon/Xoff flow control, leave HW lines alone
+ * FLOW_BOTH  - use both types simultaneously, if possible
+ *
+ * Note that few operating systems allow both types to be used together.
+ *
+ * mgetty won't (cannot!) notice if your settings don't work, but you'll
+ * see it yourself: you'll experience character losses, garbled faxes,
+ * low data throughput,..., if the flow control settings are wrong
+ *
+ * If in doubt what to use, try both and compare results.
+ * (if you use FAS or SAS with the recommended settings, FLOW_HARD is a
+ * "don't care" since the driver will use RTS/CTS anyway)
+ *
+ * If you use an atypical system, check whether tio_set_flow_control in
+ * tio.c does the right thing for your system.
+ */
+
+/* This is the flow control used for normal data (login) connections
+ * Set it to FLOW_HARD except in very special cases.
+ */
+#define DATA_FLOW	FLOW_HARD
+
+/* This is the flow control used for incoming fax connections
+ * Wrong settings will result in missing lines or erroneous lines
+ * in most of the received faxes.
+ * Most faxmodems expect Xon/Xoff, few honour the RTS line.
+ */
+#define FAXREC_FLOW	FLOW_HARD | FLOW_SOFT
+
+/* And this is for sending faxes
+ *
+ * Wrong settings here will typically result in that the first few
+ * centimeters of a transmitted fax look perfect, and then (the buffer
+ * has filled up), the rest is more or less illegible junk.
+ * For most faxes, this has to be FLOW_SOFT, though the Supra and ZyXEL
+ * modems will (sometimes) do hardware flow control, too. Try it.
+ *
+ * If you see a large number of [11] and [13] characters in the sendfax
+ * log file, your modem is propably doing software flow control - and
+ * you've definitely set FAXSEND_FLOW to FLOW_HARD...
+ *
+ * Some versions of SCO Unix have a "weird" serial driver that will only
+ * do half duplex hardware flow control. You will then run into the problem
+ * that fax sending will time out after the first page sent (no ACK received)
+ * and fail if FLOW_HARD is used. Use FLOW_SOFT instead.
+ */
+#define FAXSEND_FLOW	FLOW_HARD | FLOW_SOFT
+ 
+/* if your faxmodem switches port bit rate just after sending the "+FCON"
+ * message to the host, define this to contain the baudrate used. (Not
+ * important if you have the portspeed set to this value anyway).
+ *
+ * Most Rockwell-based modems need FAX_RECV_SWITCHBD 19200.
+ * ZyXELs do *not* need this, except if explicitely told to do so.
+ *
+ * You can see if this is set wrong if mgetty gets the "+FCON" response,
+ * starts the fax receiver, and times out waiting for OK, receiving
+ * nothing or just junk.
+ */
+/* #define FAX_RECV_SWITCHBD 19200 */
+
+/* some genius at US Robotics obviously decided that the above method
+ * of switching baud rates is broken, and came up with something new
+ * --- broken as well (why bother switching rates at all?) --- this
+ * and other USR Courier Fax follies will be handled by enabling the
+ * following define (if you have an USR faxmodem that does *not* need
+ * this, please send me a mail!)
+ * It seems as if the newest V.34 modems do not need this anymore, please
+ * try it out...
+ */
+/* #define FAX_USRobotics */
+
+/* name of the logfile for outgoing faxes (e.g. /var/log/sendfax.log)
+ */
+#define FAX_LOG		"/var/log/mgetty/fax/sendfax.log"
+
+/* local station ID (your fax number)
+ * 20 character string, most faxmodem allow all ascii characters 32..127,
+ * but some do only allow digits and blank
+ * AT+FLID=? should tell you what's allowed and what not.
+ */
+#define FAX_STATION_ID	" "
+
+/* ------ sendfax-specific stuff follows here -------- */
+
+/* the baudrate used for *sending* faxes. ZyXELs can handle 38400,
+ * SUPRAs (and many other rockwell-based faxmodems) can not.
+ * I recommend 38400, since 19200 may be to slow for 14400 bps faxmodems!
+ */
+#define FAX_SEND_BAUD 38400
+
+/* switch baud rate after +FCLASS=2
+ *
+ * some weird modems require that you initialize the modem with one
+ * baud rate (e.g. 2400 or 9600 for cheap 2400+fax modems, or `smart'
+ * modems that insist on staying locked to 38400 (ELSA!)), but switch
+ * to another baud rate, typically 19200, immediately after receiving
+ * the "AT+FCLASS=2" command.
+ *
+ * If the following is defined, sendfax will switch to the speed given
+ * here after sending AT+FCLASS=2.
+ *
+ * Only try fiddling with this if sendfax times out during modem
+ * initialization, receiving junk instead of "OK" or "ERROR" (logfile!)
+ */
+/* #define FAX_SEND_SWITCHBD 19200 */
+
+/* this is the command to set the modem to use the desired flow control.
+ * For hardware handshake, this could be AT&H3 for the ZyXEL, &K3 for
+ * Rockwell-Based modems or AT\\Q3&S0 for Exar-Based Modems (i.e. some GVC's)
+ * If you don't want extra initalization, do not define it.
+ * Don't forget the "AT"!
+ */
+/* #define FAX_MODEM_HANDSHAKE "AT&H3" */
+
+/* This is the modem command used for dialing. The phone number will
+ * get appended right after the string. Normally, "ATD" or "ATDP" should
+ * suffice, but in some situations (company telephone systems) you might
+ * need something like "ATx0DT0wP" (switch of dial-tone recognition, tone-
+ * dial a "0", wait for dial-tone, pulse dial the rest)
+ */
+#define FAX_DIAL_PREFIX "ATD"
+
+/* When sending a fax, if the other side says "page bad, retrain
+ * requested", sendfax will retry the page. Specifiy here the maximum
+ * number of retries (I recommend 3) before hanging up.
+ *
+ * If you set it to "0", sendfax will *never* retransmit a page (only
+ * do this if you know that your modem returns +FPTS:2 even if the
+ * page arrived properly, but be warned - you wont' be able to react
+ * properly to transmission errors!)
+ *
+ * See also the description of the "max-tries" and "max-tries-continue"
+ * settings in the sendfax config file.
+ */
+#define FAX_SEND_MAX_TRIES 3
+
+/* the device(s) used for faxing
+ * multiple devices can be separated by ":", e.g. "tty1a:tty2a"
+ * (with or without leading /dev/)
+ * If you don't adapt this for your needs, sendfax won't run (you can
+ * set it from the sendfax.config file, though)!
+ */
+#define FAX_MODEM_TTYS	"ttyS1"
+
+/* some modems, notably some GVC modems, all USR models, and the german
+ * telecom approved ZyXEL EG+ have the annoying behaviour of lowering
+ * and raising the DCD line during the pre- and post-page handshake
+ * (when sending faxes).
+ *
+ * If your modem does this, sendfax will terminate immediately after
+ * starting to send the first page, or between the first and second
+ * page, and the fax log file will show something like
+ * "read failed, I/O error".
+ *
+ * If you define this, sendfax will (try to) ignore that line
+ */
+
+/* #define FAX_SEND_IGNORE_CARRIER */
+
+/* Xon or not?
+ *
+ * the first issues of the class 2 drafts required that the program waits
+ * for an Xon character before sending the page data. Later versions
+ * removed that. Sendfax can do both, default is to wait for it.
+ *
+ * If you get an error message "... waiting for XON" when trying to
+ * send a fax, try this one. Some ELSA modems are know to need it.
+ */
+/* #define FAXSEND_NO_XON */
+
+
+/* define mailer that accepts destination on command line and mail text
+ * on stdin. For mailers with user friendly interfaces, (such as mail,
+ * mailx, elm), include an appropriate subject line in the command
+ * definition. If using a mail agent (such as sendmail), that reads
+ * mail headers, define NEED_MAIL_HEADERS.
+ */
+#ifdef SVR4
+# define MAILER		"/usr/bin/mailx -s 'Incoming facsimile message'"
+#else
+# ifdef _AIX
+#  define MAILER	"/usr/sbin/sendmail"
+#  define NEED_MAIL_HEADERS
+# endif
+# ifdef M_UNIX		/* SCO */
+#  define MAILER	"/usr/lib/mail/execmail"
+#  define NEED_MAIL_HEADERS
+# endif
+#endif
+
+#ifndef MAILER
+# define MAILER		"/usr/sbin/sendmail"
+# define NEED_MAIL_HEADERS
+#endif
+
+/* where to send notify mail about incoming faxes to
+ * (remember to create an mail alias if no such user exists!)
+ */
+#define MAIL_TO		"root"
+
+/* after a fax has arrived, mgetty can call a program for further
+ * processing of this fax.
+ *
+ * (e.g.: printing of the fax, sending as MIME mail, displaying in an X
+ * window (the latter one could be tricky) ...)
+ *
+ * It will be called as:
+ * <program> <result code> "<sender_id>" <#pgs> <pg1> <pg2>...
+ * 
+ * Define the name of this program here
+ * If you don't want this type of service, do not define it at all
+ * Absolute path name has to be used here!
+ */
+#define FAX_NOTIFY_PROGRAM "/etc/mgetty/new_fax"
+
+/* default minimum space required on spooling partition for receiving a FAX
+ * (in KILObytes)
+ */
+#define	MINFREESPACE 1024
+
--- mgetty-1.1.30.orig/debian/dirs
+++ mgetty-1.1.30/debian/dirs
@@ -0,0 +1,10 @@
+usr/bin
+usr/sbin
+sbin
+var/spool
+var/log/mgetty
+etc/mgetty
+usr/lib/mgetty-fax
+usr/share/doc/mgetty/voice/examples/perl
+usr/share/man
+var/spool/fax/incoming
--- mgetty-1.1.30.orig/debian/control
+++ mgetty-1.1.30/debian/control
@@ -0,0 +1,69 @@
+Source: mgetty
+Section: comm
+Priority: extra
+Maintainer: Andreas Barth <aba@not.so.argh.org>
+Uploaders: Matthias Urlichs <smurf@smurf.noris.de>
+Build-Depends: debhelper (>= 4.1.42), texi2html, texinfo, tetex-bin, groff, xlibs-dev, patch
+Standards-Version: 3.5.8
+
+Package: mgetty
+Suggests: mgetty-fax 
+Architecture: any 
+Depends: ${shlibs:Depends}, logrotate (>= 3.5.4-1)
+Description: Smart Modem getty replacement
+ Mgetty is a versatile program to handle all aspects of a modem under Unix.  
+ .
+ This package includes basic modem data capabilities.  Install mgetty-fax to 
+ get the additional functionality for fax.  Install mgetty-voice to get the
+ functionality to operate voice modems.  
+ .  
+ Mgetty is also configurable to select programs other than login for special 
+ connections (eg: uucico, fido or other programs) depending on the login 
+ userid. It also supports caller-id if the modem and phone line supply it, 
+ and can deny connections based on originating telephone number.
+
+Package: mgetty-fax
+Architecture: any
+Depends: ${shlibs:Depends}, debconf, cron, mgetty
+Suggests: debianutils (>= 1.6), netpbm, pnmtopng, gs (>= 5.50) | gs-aladdin (>= 5.50) | gs-esp (>= 7.05), mgetty-viewfax (= ${Source-Version})
+Recommends: mime-codecs
+Description: Faxing tools for mgetty
+ The fax subsystem of the mgetty package.
+ .
+ The program 'mgetty' allows you to use a fax modem for receiving faxes 
+ and handling external logins without interfering with outgoing calls.
+ 'sendfax' is a standalone program which sends fax files.
+
+Package: mgetty-viewfax
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Program for displaying Group-3 Fax files under X
+ The program 'viewfax' allows you to view Group-3 fax files in an X window.
+ Group-3 is the "standard" format for faxes.
+
+Package: mgetty-voice
+Architecture: any
+Depends: ${shlibs:Depends}, mgetty (= ${Source-Version})
+Suggests: mgetty-pvftools
+Description: Voicemail handler for mgetty
+ Vgetty allows you to add answering machine / voicemail capability to all 
+ the other normal mgetty functions.
+ .
+ To obtain the pvf tools, please refer to the mgetty-pvftools package.
+
+Package: mgetty-pvftools
+Architecture: any
+Depends: ${shlibs:Depends}
+Conflicts: mgetty-voice (<= 1.1.27-3)
+Description: Programs for listening and manipulating pvf and rmd files
+ This package contains different utilities from the vgetty package which
+ permit to create, listen and manipulate rmd or pvf files. The output
+ format used by vgetty to store its messages is rmd.
+ .
+ You will want to install this package to create your greeting messages.
+
+Package: mgetty-docs
+Architecture: all
+Description: Documentation Package for mgetty
+ Sample files and lots of documentation for mgetty. Additional source code
+ for programs included that allow to set up a user interface for mgetty.
--- mgetty-1.1.30.orig/debian/rules
+++ mgetty-1.1.30/debian/rules
@@ -0,0 +1,236 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+#
+# modifiacations for use as mgetty's rules file
+# Copyright (c) 1998 Philip Hands <phil@hands.com>
+# Taken over in 2001-2003 by Wolfgang Sourdeau <was@debian.org>
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+export DH_COMPAT=3
+
+#PACKAGE   = $(shell perl -e 'print <> =~ /(\S*)\s/' debian/changelog)
+PKG_VER	  = $(shell perl -e 'print <> =~ /\((.*)\)/' debian/changelog)
+#PKG_UPVER = $(shell perl -e 'print <> =~ /\((.*)-[^-]*\)/' debian/changelog)
+
+VFDIR = $(wildcard frontends/X11/viewfax-*)
+
+DEBIAN_DIR = $(shell pwd)/debian
+
+PVFTOOLS = autopvf pvfsine pvffilter rmdtopvf pvfcut pvftormd basictopvf \
+	pvfspeed pvfmix pvfecho pvftovoc pvftoau voctopvf \
+        pvfnoise lintopvf pvffft pvftowav pvftobasic wavtopvf pvfreverse \
+        pvffile rmdfile pvfamp pvftolin   
+
+patchdir = $(DEBIAN_DIR)/patches
+patches = $(shell ls $(patchdir) | sort)
+rev_patches = $(shell ls $(patchdir) | sort -r)
+
+build:
+	dh_testdir
+
+	@for file in $(patches); do \
+		if [ ! -f $(patchdir)/$$file.stamp ]; then \
+			echo Applying $$file...; \
+			patch -p1 < $(patchdir)/$$file; \
+			touch $(patchdir)/$$file.stamp; \
+		fi; \
+	done
+
+	touch start-build
+	-cp $(DEBIAN_DIR)/policy.h $(DEBIAN_DIR)/voice-defs.h .
+
+	$(MAKE)
+	$(MAKE) vgetty
+	cd doc; $(MAKE) manpages mgetty.info $(GCC)
+	cd contrib; $(MAKE) g3toxwd g3tolj
+	cd $(VFDIR); $(MAKE)
+
+	touch build
+
+clean:
+	dh_testdir
+	dh_testroot
+	-if [ -f start-build ]; then \
+	  rm -f start-build; \
+	  rm -f build; \
+	  $(MAKE) clean; \
+	  $(MAKE) fullclean; \
+	  rm -f contrib/g3tolj contrib/g3toxwd; \
+	  rm -f fax/faxq-helper fax/faxq-helper.o \
+	  rm -f policy.h voice-defs.h; \
+	  cd $(VFDIR);$(MAKE) clean; \
+	fi
+	@for file in $(rev_patches); do \
+		if [ -f $(patchdir)/$$file.stamp ]; then \
+			echo Reversing $$file...; \
+			patch -R -p1 < $(patchdir)/$$file; \
+			rm -f $(patchdir)/$$file.stamp; \
+		fi; \
+	done
+
+	dh_clean
+
+binary-indep:  build
+	dh_testdir -i
+	dh_testroot -i
+	dh_clean -i -k
+	dh_installdirs -i
+#	Add here commands to install the files into debian/mgetty
+	$(MAKE) DESTDIR=$(DEBIAN_DIR)/mgetty-docs install.info
+	install -m644 callback/README \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/README.callback
+	install -m644 $(VFDIR)/README \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/README.viewfax
+	install -m644 voice/doc/* \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/voice
+	install -m644 voice/Perl/* \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/voice/examples/perl
+	install -m644 voice/scripts/* \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts
+	cp $(DEBIAN_DIR)/inittab \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/examples/inittab.DEBIAN
+
+#	dh_movefiles -i --sourcedir=debian/mgetty
+	dh_installdocs -i
+#	FAQ
+	cp -a contrib frontends doc/*.txt doc/mgetty.texi doc/modems.db \
+		doc/fhng-codes $(DEBIAN_DIR)/win95.ppp BUGS FTP \
+		README.1st THANKS TODO \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/
+	-rm -f $(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/frontends/X11/viewfax-2.5/*.o \
+	       $(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/frontends/X11/viewfax-2.5/viewfax
+	-rm -f $(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/frontends/X11/viewfax-2.5/COPYING \
+	       $(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/frontends/tcl/faxview-0.2/COPYING
+#	dh_installexamples -i
+	cp -a samples/* \
+		$(DEBIAN_DIR)/mgetty-docs/usr/share/doc/mgetty/examples
+	chmod +x debian/fixpaths.pl
+	debian/fixpaths.pl
+	dh_installmenu -i
+#	dh_installinit -i
+#	dh_installcron -i
+#	dh_installmanpages -i
+	dh_installinfo -i
+	dh_installchangelogs -i
+	dh_compress -i
+	dh_fixperms -i
+	dh_installdeb -i
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i
+
+binary-arch:	build
+#	dh_testversion
+	dh_testdir -a
+	dh_testroot -a
+	dh_clean -a -k
+	dh_installdirs -a
+
+#	Mgetty install
+	mkdir -p $(DEBIAN_DIR)/mgetty/etc/logrotate.d
+	cp $(DEBIAN_DIR)/mgetty.logrotate $(DEBIAN_DIR)/mgetty/etc/logrotate.d/mgetty
+	$(MAKE) install.bin install.man DESTDIR=$(DEBIAN_DIR)/mgetty
+	$(MAKE) vgetty-install DESTDIR=$(DEBIAN_DIR)/mgetty-voice
+	cp voice/ChangeLog \
+		$(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty/changelog.voice
+
+#	Enforce debian standard for location of getty's
+	mv $(DEBIAN_DIR)/mgetty/usr/sbin/?getty \
+		$(DEBIAN_DIR)/mgetty/sbin/
+
+#	And usr/sbin stuff
+	mv $(DEBIAN_DIR)/mgetty/usr/bin/faxrunq \
+		$(DEBIAN_DIR)/mgetty-fax/usr/bin/
+	mv $(DEBIAN_DIR)/mgetty/usr/sbin/faxrunqd \
+		$(DEBIAN_DIR)/mgetty-fax/usr/sbin/
+	mkdir -p $(DEBIAN_DIR)/mgetty-fax/etc/logrotate.d
+	cp $(DEBIAN_DIR)/mgetty-fax.logrotate $(DEBIAN_DIR)/mgetty-fax/etc/logrotate.d/mgetty-fax
+
+#	Separate pvftools from mgetty-voice
+	mkdir -p $(DEBIAN_DIR)/mgetty-pvftools/usr/bin \
+		 $(DEBIAN_DIR)/mgetty-pvftools/usr/share/man/man1
+	mv -f $(DEBIAN_DIR)/mgetty-voice/usr/share/man/man1/pvf.1 \
+	  $(DEBIAN_DIR)/mgetty-pvftools/usr/share/man/man1/; \
+	for i in $(PVFTOOLS); do \
+	   mv -f $(DEBIAN_DIR)/mgetty-voice/usr/bin/$$i \
+	     $(DEBIAN_DIR)/mgetty-pvftools/usr/bin/; \
+	   mv -f $(DEBIAN_DIR)/mgetty-voice/usr/share/man/man1/$$i.1 \
+	     $(DEBIAN_DIR)/mgetty-pvftools/usr/share/man/man1/; \
+	done
+
+#	Contrib stuff
+	install -s contrib/g3toxwd contrib/g3tolj $(DEBIAN_DIR)/mgetty-fax/usr/bin
+	install -p -m644 contrib/g3toxwd.1 contrib/g3tolj.1 $(DEBIAN_DIR)/mgetty-fax/usr/share/man/man1/
+
+#	viewfax
+	mkdir -p $(DEBIAN_DIR)/mgetty-viewfax/usr/share/doc/mgetty-viewfax
+	cd $(VFDIR);$(MAKE) install DESTDIR=../../../debian/mgetty-viewfax
+
+#	callback stuff
+	install -s callback/callback $(DEBIAN_DIR)/mgetty/usr/sbin
+
+#	Setup a default configuration
+	cp *.config $(DEBIAN_DIR)/faxheader $(DEBIAN_DIR)/mgetty/etc/mgetty
+	cp $(DEBIAN_DIR)/issue.mgetty $(DEBIAN_DIR)/mgetty/etc/issue.mgetty
+	install samples/new_fax.mime4 \
+		$(DEBIAN_DIR)/mgetty-fax/etc/mgetty/new_fax
+	mkdir $(DEBIAN_DIR)/mgetty-fax/etc/mgetty/new_fax.d
+	cp voice/voice.conf-dist \
+		$(DEBIAN_DIR)/mgetty-voice/etc/mgetty/voice.conf
+	cp fax/etc-magic \
+		$(DEBIAN_DIR)/mgetty-fax/usr/share/doc/mgetty/fax.magic
+	cp voice/magic.voice \
+		$(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty/voice.magic
+	rm $(DEBIAN_DIR)/mgetty/usr/bin/g3topbm
+
+#	Make appropriate symlinks.
+	ln -s mgetty $(DEBIAN_DIR)/mgetty-fax/usr/share/doc/mgetty-fax
+	ln -s mgetty $(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty-voice
+
+#	move fax.1 manpage to mgetty-fax.1
+	mv $(DEBIAN_DIR)/mgetty/usr/share/man/man1/fax.1 \
+		$(DEBIAN_DIR)/mgetty/usr/share/man/man1/mgetty-fax.1
+
+#	And continue with debian control files
+	dh_movefiles -a --sourcedir=debian/mgetty
+	rm -rf $(DEBIAN_DIR)/mgetty/usr/{info,lib} $(DEBIAN_DIR)/mgetty/var/spool/fax/outgoing
+	dh_installdocs -pmgetty
+	dh_installdocs -pmgetty-viewfax
+	dh_installdocs -pmgetty-voice
+	dh_installdocs -pmgetty-fax
+	dh_installdocs -pmgetty-pvftools
+	-rm -f $(DEBIAN_DIR)/mgetty-fax/usr/share/doc/mgetty/copyright
+	-rm -f $(DEBIAN_DIR)/mgetty-voice/usr/share/doc/mgetty/copyright
+
+# 	chown $(FAX_USER).$(FAX_GROUP) $(DEBIAN_DIR)/mgetty-fax/usr/lib/mgetty-fax/faxq-helper
+# 	chmod 4755 $(DEBIAN_DIR)/mgetty-fax/usr/lib/mgetty-fax/faxq-helper
+
+# 	chown $(FAX_USER).root $(DEBIAN_DIR)/mgetty-fax/var/spool/fax/outgoing
+# 	chmod 700 $(DEBIAN_DIR)/mgetty-fax/var/spool/fax/outgoing
+
+# 	chown $(FAX_USER).root $(DEBIAN_DIR)/mgetty-fax/var/lock/fax
+# 	chmod 755 $(DEBIAN_DIR)/mgetty-fax/var/lock/fax
+
+	dh_installexamples -a
+	dh_installmenu -a
+	dh_installinit -a
+	dh_installmime -a
+	dh_installdebconf -a
+#	dh_installmanpages -a
+	dh_installchangelogs -pmgetty ChangeLog
+	dh_installchangelogs -pmgetty-viewfax $(VFDIR)/ChangeLog $(VFDIR)/README
+	dh_installchangelogs -pmgetty-pvftools voice/ChangeLog
+	dh_strip -a
+	dh_compress -a
+	dh_fixperms -a
+
+	dh_installdeb -a
+	dh_shlibdeps -a
+	dh_gencontrol -a
+#	dh_makeshlibs -a
+	dh_md5sums -a
+	dh_builddeb -a
+
+binary:	binary-indep binary-arch
+.PHONY: binary binary-arch binary-indep clean
--- mgetty-1.1.30.orig/debian/mgetty-fax.logrotate
+++ mgetty-1.1.30/debian/mgetty-fax.logrotate
@@ -0,0 +1,9 @@
+/var/log/mgetty/fax/sendfax.log {
+	daily
+	rotate 7
+	create 640 uucp adm
+	compress
+	delaycompress
+	notifempty
+	missingok
+}
--- mgetty-1.1.30.orig/debian/fixpaths.pl
+++ mgetty-1.1.30/debian/fixpaths.pl
@@ -0,0 +1,35 @@
+#! /usr/bin/perl -w
+
+# fix path/programmname for the list of files
+# /usr/local/bin/perl -> perl
+# /usr/lib/sendmail -> /usr/sbin/sendmail
+# /bin/ksh -> /bin/bash
+# /usr/local/bin/vm -> /usr/bin/vm
+
+@fix=(
+'debian/mgetty-docs/usr/share/doc/mgetty/contrib/faxmail-smail',
+'debian/mgetty-docs/usr/share/doc/mgetty/frontends/faxmail/faxmail',
+'debian/mgetty-docs/usr/share/doc/mgetty/contrib/watchit.pl',
+'debian/mgetty-docs/usr/share/doc/mgetty/frontends/mail2fax/mail2fax.rc',
+'debian/mgetty-docs/usr/share/doc/mgetty/frontends/mmdf-mail2fax/faxgate.pl',
+'debian/mgetty-docs/usr/share/doc/mgetty/examples/fax',
+'debian/mgetty-docs/usr/share/doc/mgetty/examples/new_fax.hpa',
+'debian/mgetty-docs/usr/share/doc/mgetty/examples/new_fax.mime1',
+'debian/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts/button.sh',
+'debian/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts/demo.pl',
+'debian/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts/demo.sh',
+'debian/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts/dtmf.sh',
+'debian/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts/events.sh',
+'debian/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts/message.sh',
+'debian/mgetty-docs/usr/share/doc/mgetty/voice/examples/scripts/vmtest.sh' );
+
+foreach $i (@fix) {
+	print `sed ' \
+		s|/usr/local/bin/perl5|/usr/bin/perl|; \
+		s|/usr/local/bin/perl|/usr/bin/perl|; \
+		s|/usr/lib/sendmail|/usr/sbin/sendmail|; \
+		s|/bin/ksh|/bin/bash|; \
+		s|/usr/local/bin/vm|/usr/bin/vm|; \
+	' < $i > $i.fixed && mv $i.fixed $i`;
+	exit ($? >> 8) if ($? >> 8);
+}
--- mgetty-1.1.30.orig/debian/mgetty-fax.templates
+++ mgetty-1.1.30/debian/mgetty-fax.templates
@@ -0,0 +1,23 @@
+Template: mgetty-fax/new_security_scheme
+Type: text
+Description: Notice: new permission handling
+ Since version 1.1.29, mgetty-fax is using a new security scheme. This
+ implies some changes in the permission hanling of certain files and
+ directories.
+ .
+ A new utility with name faxq-helper has been placed into
+ /usr/lib/mgetty-fax. It is owned by user "uucp" and is setuid.
+ The directory /var/spool/fax/outoing is now owned by uucp as well and is
+ only accessible to that user by default. If you want to modify the permissions of
+ this directory (for example because you trust your users enough to let
+ them read outgoing faxes), please use dpkg-statoverride.
+
+Template: mgetty-fax/start_faxrunqd
+Type: boolean
+Default: true
+Description: Do you want to run faxrunqd during system startup?
+ The mgetty-fax package contains a daemon ("faxrunqd") that can automatically
+ take in charge the sending of the faxes spooled with faxspool.
+ This daemon and the faxrunq utility need /etc/mgetty/faxrunq.config
+ to be configured appropriately in order to run. If you plan
+ to use faxrunqd, please indicate so.
--- mgetty-1.1.30.orig/debian/mgetty-viewfax.copyright
+++ mgetty-1.1.30/debian/mgetty-viewfax.copyright
@@ -0,0 +1,15 @@
+This is the Debian GNU/Linux prepackaged version of viewfax
+Viewfax was written by Frank Cringle (fdc@cliwe.ping.de)
+
+This package was put together by Philip Hands <phil@hands.com>
+from sources found as part of the mgetty tarball found at:
+
+   ftp://alpha.greenie.net/pub/mgetty/source/
+
+viewfax 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.
+
+On Debian GNU/Linux systems, the text of the GPL can be found in
+the directory /usr/share/common-licenses/.
--- mgetty-1.1.30.orig/debian/faxheader
+++ mgetty-1.1.30/debian/faxheader
@@ -0,0 +1,2 @@
+
+      FAX  FROM:  **not configured**       TO: @T@    PAGE: @P@ OF @M@
--- mgetty-1.1.30.orig/debian/mgetty-fax.dirs
+++ mgetty-1.1.30/debian/mgetty-fax.dirs
@@ -0,0 +1,9 @@
+etc/mgetty
+usr/share/doc/mgetty
+usr/share/man/man1
+usr/sbin
+usr/bin
+var/spool/fax/outgoing
+var/lock/fax
+var/log/mgetty/fax
+var/run/mgetty-fax
--- mgetty-1.1.30.orig/debian/mgetty-voice.postrm
+++ mgetty-1.1.30/debian/mgetty-voice.postrm
@@ -0,0 +1,2 @@
+#!/bin/sh
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/mgetty-fax.postinst
+++ mgetty-1.1.30/debian/mgetty-fax.postinst
@@ -0,0 +1,67 @@
+#!/bin/sh -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>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see /usr/share/doc/packaging-manual/
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+# make sure this file exists to prevent someone from doing a symlink exploit
+test -e /var/spool/fax/outgoing/faxqueue_done ||
+  touch /var/spool/fax/outgoing/faxqueue_done
+chown uucp.fax /var/spool/fax/outgoing/faxqueue_done
+
+# ensuring proper permissions
+FAX_USER=uucp
+FAX_GROUP=fax
+
+# conditional stuff
+case "$1" in
+    configure)
+	. /usr/share/debconf/confmodule
+	db_version 2.0
+	    
+	db_get "mgetty-fax/start_faxrunqd"
+
+	if [ "$RET" = "true" ]; then
+	    rm -f /etc/mgetty/.faxrunqd_not_to_be_run
+	else
+	    touch /etc/mgetty/.faxrunqd_not_to_be_run
+	fi
+
+	db_stop
+
+	# ensuring permissions are set correctly
+	chown $FAX_USER.$FAX_GROUP /usr/lib/mgetty-fax/faxq-helper
+	chmod 4755 /usr/lib/mgetty-fax/faxq-helper
+
+#	if ! dpkg-statoverride --list /var/spool/fax/outgoing >/dev/null
+#	    then
+	    dpkg-statoverride --update --force --add $FAX_USER root 0755 /var/spool/fax/outgoing
+#	fi
+    dpkg-statoverride --update --force --add $FAX_USER root 0755 /var/log/mgetty/fax
+    dpkg-statoverride --update --force --add $FAX_USER root 0755 /var/run/mgetty-fax
+
+	chown $FAX_USER.root /var/lock/fax
+	chmod 755 /var/lock/fax
+	;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+	;;
+    *)
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0;
--- mgetty-1.1.30.orig/debian/mgetty-docs.postinst
+++ mgetty-1.1.30/debian/mgetty-docs.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/purge
+++ mgetty-1.1.30/debian/purge
@@ -0,0 +1,2 @@
+/var/log/mgetty
+/etc/mgetty
--- mgetty-1.1.30.orig/debian/watch
+++ mgetty-1.1.30/debian/watch
@@ -0,0 +1,3 @@
+# Site		Directory		Pattern		Version	Script
+alpha.greenie.net /pub/mgetty/source/  mgetty?.*.tar.gz        debian  uupdate
+poseidon.thphy.uni-duesseldorf.de /pub/marc/mgetty vgetty.*
--- mgetty-1.1.30.orig/debian/mgetty-viewfax.dirs
+++ mgetty-1.1.30/debian/mgetty-viewfax.dirs
@@ -0,0 +1,4 @@
+usr/bin
+usr/lib
+usr/share/doc
+usr/share/man/man1
--- mgetty-1.1.30.orig/debian/mgetty-fax.init.d
+++ mgetty-1.1.30/debian/mgetty-fax.init.d
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/faxrunqd
+NAME=faxrunqd
+DESC="Fax Queue Daemon"
+
+test -f $DAEMON || exit 0
+
+check_for_no_start() {
+    # (function copied from ssh init script)
+    # exit if we're trying to start and /etc/mgetty/.faxrunqd_not_to_be_run exists
+    if [ -e /etc/mgetty/.faxrunqd_not_to_be_run ]; then 
+	exit 0
+    fi
+}
+
+case "$1" in
+  start)
+	check_for_no_start
+	if grep -q "^fax-devices" /etc/mgetty/faxrunq.config; then
+	  echo -n "Starting $DESC: "
+	  start-stop-daemon --start --quiet --pidfile /var/run/mgetty-fax/$NAME.pid \
+		--exec $DAEMON -- -D -u uucp -g dialout
+	  echo "$NAME."
+	else
+	  echo "$DESC not yet configured while configured for starting within the debconf database."
+	  echo "Please either edit /etc/mgetty/faxrunq.config or run \"dpkg-reconfigure mgetty-fax\" to fix this problem."
+	  exit 0
+	fi
+	;;
+  stop)
+	echo -n "Stopping $DESC: $NAME."
+	[ -f /var/run/mgetty-fax/$NAME.pid ] && echo || echo " (not running)"
+	start-stop-daemon --stop --quiet --pidfile /var/run/mgetty-fax/$NAME.pid \
+		--oknodo --name $NAME --signal USR2
+	;;
+  #reload)
+	#
+	#	If the daemon can reload its config files on the fly
+	#	for example by sending it SIGHUP, do it here.
+	#
+	#	If the daemon responds to changes in its config file
+	#	directly anyway, make this a do-nothing entry.
+	#
+	# echo "Reloading $DESC configuration files."
+	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
+	#	/var/run/$NAME.pid --exec $DAEMON
+  #;;
+  restart|force-reload)
+	#
+	#	If the "reload" option is implemented, move the "force-reload"
+	#	option to the "reload" entry above. If not, "force-reload" is
+	#	just the same as "restart".
+	#
+	echo -n "Restarting $DESC: "
+	$0 stop
+	sleep 1
+	$0 start
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
--- mgetty-1.1.30.orig/debian/mgetty-viewfax.mime
+++ mgetty-1.1.30/debian/mgetty-viewfax.mime
@@ -0,0 +1,3 @@
+image/fax; viewfax '%s'; test=test -n "$DISPLAY"; description="Fax file"
+image/fax-g3; viewfax '%s'; test=test -n "$DISPLAY"; description="G3-encoded Fax file"
+image/fax-g4; viewfax '%s'; test=test -n "$DISPLAY"; description="G4-encoded Fax file"
--- mgetty-1.1.30.orig/debian/mgetty-viewfax.postinst
+++ mgetty-1.1.30/debian/mgetty-viewfax.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/mgetty-voice.postinst
+++ mgetty-1.1.30/debian/mgetty-voice.postinst
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+
+case "$1" in
+    configure)
+	chown -R root.voice /var/spool/voice/incoming /var/spool/voice/messages
+	chmod 755 /var/spool/voice/messages
+	chmod 775 /var/spool/voice/incoming
+	;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+	;;
+    *)
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0;
--- mgetty-1.1.30.orig/debian/mgetty-voice.dirs
+++ mgetty-1.1.30/debian/mgetty-voice.dirs
@@ -0,0 +1,8 @@
+etc/mgetty
+usr/bin
+usr/sbin
+usr/share/man/man1
+usr/share/man/man8
+usr/share/doc/mgetty
+var/spool/voice/incoming
+var/spool/voice/messages
--- mgetty-1.1.30.orig/debian/win95.ppp
+++ mgetty-1.1.30/debian/win95.ppp
@@ -0,0 +1,47 @@
+Short Guide on How to run a Win95 Connection with PPPD to Debian GNU/Linux
+--------------------------------------------------------------------------
+
+1. Do not mess around with the Win95 configuration.
+   Do not manually configure DNS, Scripts etc.
+   Do not switch on the terminal windows.
+   Accept all defaults or better leave it as
+   it was at installation.
+
+2. You need to have a getty program that supports
+   automatic PPP protocol detection such as mgetty-1.1.x like
+   the one that installed these tips.
+ 
+   You also need to have a pppd that supports remote DNS configuration.
+   The ppp usually coming with Debian has these options beginning
+   with version 2.2.0f-4
+
+   Without the extended ppp you still have to configure the DNS Server
+   on the Win95 wanting to connect to your Debian GNU/Linux Box.
+
+3. Configure PPP on GNU/Linux
+     A) Add a line
+		dns-addr 192.168.1.1
+	to your /etc/ppp/options file. Be sure to replace
+	192.168.1.1 with a valid Name Server IP Address.
+
+     B) Make sure that your /etc/ppp/pap-secrets file is set
+        up correctly. It should allow your users in /etc/passwd
+	to establish ppp connections without a password. pppd will
+	check against /etc/passwd too!
+	If you are having trouble with authentication then remove
+	/etc/ppp/pap-secrets completely and it will usually work.
+	
+	The debian ppp package comes with an example setup for
+	pap-secrets and more instructions.
+
+4. Win95 PPP Dialup
+	Click on Dialup-Connection
+	A. Enter phone number of your GNU/Linux server
+	B. Enter username when prompted
+	C. Enter password when prompted
+
+Win95 should connect to your GNU/Linux PPPD without problems and automatically
+configure all IP-Addresses, Netmasks and DNS Servers. You can immediately
+start Netscape, Internet Explorer or any other TCP/IP tools.
+
+Christoph Lameter, Jan 3, 1995 (clameter@fuller.edu)
--- mgetty-1.1.30.orig/debian/mgetty-fax.files
+++ mgetty-1.1.30/debian/mgetty-fax.files
@@ -0,0 +1,13 @@
+usr/bin/pbm*
+usr/bin/g3*
+usr/bin/fax*
+usr/sbin/sendfax
+usr/share/man/man1/g3*
+usr/share/man/man1/fax*
+usr/share/man/man1/mgetty-fax*
+usr/share/man/man1/cover*
+usr/share/man/man1/pbm*
+usr/share/man/man5
+usr/share/man/man8/*fax*
+etc/mgetty/*fax*
+usr/lib/mgetty-fax
--- mgetty-1.1.30.orig/debian/mgetty-docs.dirs
+++ mgetty-1.1.30/debian/mgetty-docs.dirs
@@ -0,0 +1,4 @@
+usr/share/doc/mgetty/examples
+usr/share/doc/mgetty/voice/examples/perl
+usr/share/doc/mgetty/voice/examples/scripts
+usr/share/info
--- mgetty-1.1.30.orig/debian/mgetty-docs.info
+++ mgetty-1.1.30/debian/mgetty-docs.info
@@ -0,0 +1 @@
+doc/mgetty.info
--- mgetty-1.1.30.orig/debian/mgetty-fax.prerm
+++ mgetty-1.1.30/debian/mgetty-fax.prerm
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+
+action=$1
+version=$2
+
+if [ "$1" = "remove" ]
+then
+  rm -f /etc/mgetty/.faxrunqd_not_to_be_run
+  rm -f /var/spool/fax/outgoing/.last_run
+fi
+
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/mgetty-docs.preinst
+++ mgetty-1.1.30/debian/mgetty-docs.preinst
@@ -0,0 +1,17 @@
+#!/bin/bash
+# The first version of mgetty-doc shipped with a real doc dir
+# rather than a link to mgetty
+REAL_DOC="1.1.14-1"
+case "$1" in
+  upgrade)
+  if /usr/bin/dpkg --compare-versions $2 lt $REAL_DOC &&
+    test -L /usr/doc/mgetty-docs &&
+    expr "`ls -ld /usr/doc/mgetty-docs`" : '.* /usr/doc/mgetty-docs -> mgetty$' >/dev/null
+  then
+    echo "Removing obsolete /usr/doc/mgetty-docs symlink."
+    rm -f /usr/doc/mgetty-docs
+  fi
+  ;;
+esac
+
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/mgetty-fax.config
+++ mgetty-1.1.30/debian/mgetty-fax.config
@@ -0,0 +1,11 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+db_title Configuring mgetty-fax...
+
+db_input "low" mgetty-fax/new_security_scheme || true
+db_go
+
+db_input "medium" mgetty-fax/start_faxrunqd || true
+db_go
--- mgetty-1.1.30.orig/debian/patches/04-new_fax.pbm
+++ mgetty-1.1.30/debian/patches/04-new_fax.pbm
@@ -0,0 +1,8 @@
+--- mgetty-1.1.30.orig/samples/new_fax.pbm	Thu Jan  2 15:40:12 1997
++++ mgetty-1.1.30/samples/new_fax.pbm	Sun Sep 28 16:46:09 2003
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ # From:	michael@hal6000.thp.uni-duisburg.de (Michael Staats)
+ # Subject: Re: Fax notify without in/output redirection?
+ # To:	mgetty@greenie.muc.de
--- mgetty-1.1.30.orig/debian/patches/42-voice_libvoice_detect.c
+++ mgetty-1.1.30/debian/patches/42-voice_libvoice_detect.c
@@ -0,0 +1,28 @@
+--- mgetty-1.1.30.orig/voice/libvoice/detect.c	2002-12-11 22:44:38.000000000 -0800
++++ mgetty-1.1.30/voice/libvoice/detect.c	2003-09-07 14:52:01.000000000 -0700
+@@ -86,6 +86,8 @@
+      {ati, "Venus V.90 USB U052099a", NULL, &Lucent},
+      {ati, "AEIGPM560LKTF1  Voice V2 V92cap", NULL, &V253modem},
+      {ati, "Zoom V.90 PCI I030100gV -H Z207",NULL, &Lucent},
++     {ati, "Zoom V.90 PCI I052099gV -G Z207",NULL, &Lucent},
++     {ati, "Zoom V.90 Serial s052099g -I Z207", NULL, &Lucent},
+      {ati, "28800",                ati6, NULL},
+      {ati, "2886",                 NULL,   &US_Robotics},
+      {ati, "336",                  NULL,   &Rockwell},
+@@ -106,6 +108,7 @@
+      {ati, "3X WYSIWYF 628DBX",    NULL,   &Rockwell},
+      {ati, "56000",                NULL,   &Rockwell},
+      {ati, "5601",                 NULL,   &US_Robotics},
++     {ati, "57600",                NULL,   &Multitech_2834ZDXv},
+      {ati, "961",                  NULL,   &Rockwell},
+      {ati, "Digi RAS modem 56000", NULL,   &Digi_RAS},
+      {ati, "Linux ISDN",           NULL,   &ISDN4Linux},
+@@ -114,6 +117,8 @@
+ 				   NULL, &Multitech_5634ZPX},
+      {ati, "LT V.90 1.0 MT5634ZBAV Serial Data/Fax/Voice Modem Version 4.09a",
+                                    NULL,   &Multitech_5634ZBAV},
++     {ati, "LT V.92 1.0 MT5634ZBAV-V92 Serial Data/Fax/Voice Modem Version 1.25p",
++                                   NULL,   &Multitech_5634ZBAV},
+      {ati4, "33600bps Voice Modem For Italy",
+                                    NULL, &Rockwell},
+      {ati6, "RCV336DPFSP Rev 44BC",
--- mgetty-1.1.30.orig/debian/patches/06-pending-contrib_g3tolj.c
+++ mgetty-1.1.30/debian/patches/06-pending-contrib_g3tolj.c
@@ -0,0 +1,49 @@
+--- mgetty-1.1.27.orig/contrib/g3tolj.c
++++ mgetty-1.1.27/contrib/g3tolj.c
+@@ -57,6 +57,7 @@
+ #include <sys/types.h>
+ #include <ctype.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ typedef unsigned char bit;
+ 
+@@ -303,6 +304,8 @@
+ 
+ #endif	/* _G3_H_ */
+ 
++void skiptoeol (void);
++
+ FILE *
+   pm_openr (name)
+      char *name;
+@@ -552,7 +555,7 @@
+     return (0);
+ }
+ 
+-skiptoeol ()
++void skiptoeol ()
+ {
+     while (rawzeros < 11)
+ 	(void) rawgetbit ();
+@@ -707,9 +710,9 @@
+ 	newpage (fd);
+ };
+ 
+-void main (argc, argv)
+-     int argc;
+-     char *argv[];
++int main (argc, argv)
++    int argc;
++    char *argv[];
+ {
+     int argn, rows, wrows, cols, wcols, row, wrow, col, wcol, i;
+     int vval, hval;
+@@ -864,5 +867,6 @@
+ 	    break;
+     }
+     putrest ();
+-    exit (0);
++
++    return 0;
+ }
--- mgetty-1.1.30.orig/debian/patches/12-fax_faxrunqd.in
+++ mgetty-1.1.30/debian/patches/12-fax_faxrunqd.in
@@ -0,0 +1,178 @@
+--- mgetty-1.1.30/fax/faxrunqd.in.orig	2003-09-13 11:04:12.000000000 +0000
++++ mgetty-1.1.30-5.1/fax/faxrunqd.in	2003-09-13 11:12:47.000000000 +0000
+@@ -13,6 +13,9 @@
+ #
+ # Change Log:
+ #
++# Debian 1.1.30-5.1 2003/07/20  Andreas Barth <aba@not.so.argh.org>
++# Can specify group per commandline.
++#
+ # $Log: faxrunqd.in,v $
+ # Revision 1.63  2002/11/23 16:52:18  gert
+ # make messages more clear, print warning if running as root
+@@ -45,6 +48,11 @@
+ # a "low prio" job for phone number 123 could be attached to a high prio
+ # job to 123, and thus be sent before a high prio job to 456)
+ #
++# Debian 1.1.28-4 2002/11/27 18:32:23 Wolfgang Sourdeau <was@debian.org>
++# Quit quietly when received signal TERM or HUP since it is expected the
++# user knows what is happening already. The quit message is still written
++# into the logfile.
++#
+ # Revision 1.56  2002/01/04 17:52:42  gert
+ # pass sendfax exit code as 2nd argument to success/failure program
+ #
+@@ -55,6 +63,9 @@
+ # Revision 1.54  2001/12/16 14:26:25  gert
+ # stop queue handling if a file named 'stop' exists
+ #
++# Add a -D option to allow for running in the background as a Daemon
++#       Philip Hands <phil@hands.com>
++#
+ # Revision 1.53  2000/08/06 14:28:37  gert
+ # go from using $fax_spool_out/.last_run to VARRUNDIR/faxqueue_done
+ #
+@@ -129,6 +140,8 @@
+ #
+ #
+ require 5.004;
++
++use Fcntl;
+ use POSIX;
+ use IO::Handle;
+ use Getopt::Std;
+@@ -143,10 +156,10 @@
+ $mail='@MAILER@';
+ 
+ $faxrunq_cf='@CONFDIR@/faxrunq.config';
+-$fax_acct='@FAX_SPOOL@/acct.log';
+-$faxrd_log='@FAX_SPOOL@/faxrunqd.log';
++$fax_acct='/var/log/mgetty/fax/acct.log';
++$faxrd_log='/var/log/mgetty/fax/faxrunqd.log';
+ 
+-$faxrd_pid='@FAX_SPOOL_OUT@/faxrunqd.pid';
++$faxrd_pid='/var/run/mgetty-fax/faxrunqd.pid';
+ $last_run='@FAX_SPOOL_OUT@/faxqueue_done';
+ 
+ $policy_config='';
+@@ -189,8 +202,10 @@
+ $opt_V = 0;					# print version number
+ $opt_l = '';					# ttys to use
+ $opt_u = '';					# user id to setuid() to
+-getopts( 'dvVl:u:' ) || 
+-    die "Valid options: -d (debug), -v (verbose), -l tty<n>, -u uid, -V (version)\n";
++$opt_g = '';					# group id to setgid() to
++$opt_D = 0;					# daemon
++getopts( 'DdvVl:u:g:' ) || 
++    die "Valid options: -D (daemon), -d (debug), -v (verbose), -l tty<n>, -u uid, -g uid, -V (version)\n";
+ 
+ if ( $opt_d ) { $opt_v=1; }
+ 
+@@ -201,32 +216,63 @@
+ mgetty+sendfax by Gert Doering
+ $rcs_id
+ 
+-config file read from '$faxrunq_cf'
++config read from '$faxrunq_cf'
+ 
+ EOF
+     exit 0;
+ }
+ 
++$uid=$>;
++$gid=$);
++
+ if ( $opt_u ne '' )	# set user ID to $opt_u
+ {
+-    my ( $uid, $gid ) = ( getpwnam( $opt_u ) )[2,3];
++    ( $uid, $gid ) = ( ( $opt_u =~ /^[0-9]+$/ )
++			    ? getpwuid( $opt_u )
++			    : getpwnam( $opt_u ) )[2,3];
+ 
+     if ( !defined($uid) || !defined($gid) )
+ 		{ die "$0: no such user: '$opt_u'\n"; }
+ 
+     print "change user ID to '$opt_u' (numeric uid: $uid, gid: $gid)\n"
+ 								if $opt_d;
+-    $( = $) = $gid;
+-    $< = $> = $uid;
+-
+-    if ( $> != $uid || $) != $gid )
+-		{ die "$0: can't set uid to $uid / gid to $gid: $!\n"; }
+ }
++
++if ( $opt_g ne '' )
++    {
++	$gid = ( ( $opt_g =~ /^[0-9]+$/ )
++		   ? getgrgid( $opt_g )
++		   : getgrnam( $opt_g ) )[2];
++	die "$0: no such group: '$opt_g'\n" unless defined ($gid);
++    }
++
++$( = $) = $gid;
++$< = $> = $uid;
++
++if ( $> != $uid || $) != $gid )
++	{ die "$0: can't set uid to $uid / gid to $gid: $!\n"; }
++
+ if ( $> == 0 )		# root check
+ {
+     print STDERR "$0: running with root privileges is not recommended\n";
+ }
+ 
++# fork as a daemon if invoked with -D
++if ( $opt_D ) {
++  $pid = fork ;
++  die "Cannot fork: $!" unless defined $pid ;
++  if (0 == $pid) {
++    # Child process: become leader of a new session, lose STDIN, log STDOUT/ERR
++    POSIX::setsid();
++    umask(022);
++    open(STDIN, "/dev/null") ;
++    open(STDOUT, ">&LOG") ;
++    open(STDERR, ">&LOG") ;
++  } else {
++    exit 0;     # parent process
++  }
++}
++
+ #
+ # startup... write PID file, make sure no other faxrunqd runs
+ #
+@@ -262,7 +308,7 @@
+ 
+ $SIG{USR1} = \&signal_handler_USR1;		# roll log file
+ $roll_log_file_requested = 0;
+-$roll_level=3;					# keep 3 old files around
++$roll_level=7;					# keep 7 old files around
+ 
+ $SIG{USR2} = \&signal_handler_USR2;		# graceful exit
+ $graceful_exit_requested = 0;
+@@ -355,7 +401,7 @@
+ #
+ # open log file
+ #
+-open( LOG, ">>$faxrd_log" ) ||
++sysopen( LOG, "$faxrd_log", O_CREAT | O_APPEND | O_WRONLY, 0640 ) ||
+ 	    die "can't write log file '$faxrd_log'";
+ LOG->autoflush(1);
+ print LOG "\n" . localtime() .": faxrunqd starting, pid=$$\n";
+@@ -552,7 +598,7 @@
+ 	$roll_log_file_requested=0;
+ 
+ 	# start new
+-	open( LOG, ">$faxrd_log" ) ||
++	sysopen( LOG, "$faxrd_log", O_CREAT | O_APPEND | O_WRONLY, 0640 ) ||
+ 		    die "can't re-open log file '$faxrd_log'";
+ 	LOG->autoflush(1);
+ 	print LOG localtime() .": -- new log file started --\n";
+@@ -1639,7 +1685,8 @@
+ {
+ my $sig = shift;
+ 
+-    print "\nfaxrunqd: signal handler: got signal $sig, goodbye...\n";
++    print "\nfaxrunqd: signal handler: got signal $sig, goodbye...\n"
++	if ($sig ne 'TERM' && $sig ne 'HUP' && $sig ne 'USR2');
+     print LOG "\nfaxrunqd: signal handler: got signal $sig, goodbye...\n";
+ 
+     # save tty statistics
--- mgetty-1.1.30.orig/debian/patches/51-pending-faxq-time
+++ mgetty-1.1.30/debian/patches/51-pending-faxq-time
@@ -0,0 +1,10 @@
+--- mgetty-1.1.30.orig/fax/faxq.in	Sat Nov 23 19:57:59 2002
++++ mgetty-1.1.30.orig/fax/faxq.in	Sun Sep 28 17:59:40 2003
+@@ -100,6 +100,7 @@
+ 			       }' -`
+ 	$echo "$i:"
+ 	$echo "\tQueued by: $USER"
++	$echo "\t       at: "`find $(dirname $i)/${PAGES%% *} -printf "%Ax %AH:%AM\n"`
+        if [ -z "$VERBTO" ]
+        then
+ 	$echo "\t       to: $PHONE"
--- mgetty-1.1.30.orig/debian/patches/07-pending-contrib_g3toxwd.c
+++ mgetty-1.1.30/debian/patches/07-pending-contrib_g3toxwd.c
@@ -0,0 +1,46 @@
+--- mgetty-1.1.27.orig/contrib/g3toxwd.c
++++ mgetty-1.1.27/contrib/g3toxwd.c
+@@ -26,6 +26,8 @@
+ #include <sys/types.h>
+ #include <ctype.h>
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ 
+ typedef unsigned char bit;
+ 
+@@ -331,6 +333,8 @@
+ 
+ #endif	/* _G3_H_ */
+ 
++void skiptoeol (void);
++
+ FILE *
+   pm_openr (name)
+      char *name;
+@@ -604,7 +608,7 @@
+     return (0);
+ }
+ 
+-skiptoeol ()
++void skiptoeol ()
+ {
+     while (rawzeros < 11)
+ 	(void) rawgetbit ();
+@@ -732,7 +736,7 @@
+ 	putchar (byte);
+ };
+ 
+-void main (argc, argv)
++int main (argc, argv)
+      int argc;
+      char *argv[];
+ {
+@@ -883,5 +887,6 @@
+ 	xwd_writerow (stdout, writerow, wcols);
+ 	wrow++;
+     }
+-    exit (0);
++
++    return 0;
+ }
--- mgetty-1.1.30.orig/debian/patches/52-pending-metamail
+++ mgetty-1.1.30/debian/patches/52-pending-metamail
@@ -0,0 +1,88 @@
+diff -urN mgetty-1.1.30~/samples/new_fax.mime3 mgetty-1.1.30/samples/new_fax.mime3
+--- mgetty-1.1.30~/samples/new_fax.mime3	2003-09-23 22:11:05.000000000 +1000
++++ mgetty-1.1.30/samples/new_fax.mime3	2003-09-23 22:20:41.000000000 +1000
+@@ -13,8 +13,8 @@
+ # image/x-fax-g3; viewfax -geometry +5+23 '%s'; test=test -n "$DISPLAY"
+ # image/x-fax-g3;; print=printfax '%s'
+ #
+-# You need the program mmencode for base64 encoding of the fax data,
+-# which you will find in your metamail distribution.
++# You need the program base64-encode for base64 encoding of the fax data,
++# which you will find in your mime-codecs package.
+ #
+ # (c) 1997-1998 Roland Rosenfeld <roland@spinnaker.rhein.de>
+ #
+@@ -65,7 +65,7 @@
+     echo "" >> $TMPMAIL
+ 
+     # base64 encoder:
+-    mmencode -b $file >> $TMPMAIL
++    base64-encode < $file >> $TMPMAIL
+     
+     echo "" >> $TMPMAIL
+ done
+@@ -75,4 +75,4 @@
+ # Send out the created mail:
+ sendmail $ADMIN < $TMPMAIL
+ 
+-exit 0
+\ No newline at end of file
++exit 0
+diff -urN mgetty-1.1.30~/samples/new_fax.mime4 mgetty-1.1.30/samples/new_fax.mime4
+--- mgetty-1.1.30~/samples/new_fax.mime4	2003-09-23 22:11:05.000000000 +1000
++++ mgetty-1.1.30/samples/new_fax.mime4	2003-09-23 22:21:09.000000000 +1000
+@@ -19,8 +19,8 @@
+ # MIME tools as possible.
+ #
+ # This 'new_fax' only needs ' g32pbm', 'pnmscale' and 'pnmtotiff' from the
+-# 'pbmplus' package, 'mmencode' from the 'multimail' packages, and the rest
+-# is standard Unix tools.
++# 'pbmplus' package, 'base64-encode' from the 'mime-codecs' packages, and
++# the rest is standard Unix tools.
+ # It was tested with thsmail under Linux and PMMail under OS/2 as frontends.
+ 
+ # This script is called when a message was recorded. 
+@@ -50,8 +50,7 @@
+ CAT=cat
+ ECHO=echo
+ G3TOPBM=g32pbm
+-#MMENCODE=mmencode
+-MMENCODE=mimencode
++MMENCODE=base64-encode
+ RM=rm
+ SED=sed
+ SENDMAIL=sendmail
+@@ -136,7 +135,7 @@
+ #
+ 	# Here we do base64 encoding of out TIFF data and add the result
+ 	# into our MIME mail as attachment.
+-	$MMENCODE -b $IMAG_FILE          >> $MIME_MESS 2>> $ERRO_MESS
++	$MMENCODE < $IMAG_FILE          >> $MIME_MESS 2>> $ERRO_MESS
+ #
+ 	# To clean up temporary TIFF data.
+ 	$RM -f $IMAG_FILE
+diff -urN mgetty-1.1.30~/samples/new_fax.tiff mgetty-1.1.30/samples/new_fax.tiff
+--- mgetty-1.1.30~/samples/new_fax.tiff	2003-09-23 22:11:05.000000000 +1000
++++ mgetty-1.1.30/samples/new_fax.tiff	2003-09-23 22:19:32.000000000 +1000
+@@ -12,7 +12,7 @@
+ # script. The following script combines all received pages to one
+ # tiff-file which is sent to all recipients beeing in the alias for fax.
+ # Reading the fax is quite easy with Netscape when the tiffsurf-plugin is
+-# installed.
++# installed.  You need the metamail package for metasend.
+ #
+ # As the script may be usefull for someone I'll post it here. It's quite
+ # short (and perhaps not that elegant...), but for me it works great.
+diff -urN mgetty-1.1.30~/voice/scripts/new_voice.craig_southern mgetty-1.1.30/voice/scripts/new_voice.craig_southern
+--- mgetty-1.1.30~/voice/scripts/new_voice.craig_southern	2003-09-23 22:11:05.000000000 +1000
++++ mgetty-1.1.30/voice/scripts/new_voice.craig_southern	2003-09-23 22:13:28.000000000 +1000
+@@ -50,7 +50,7 @@
+ echo Content-Transfer-Encoding: base64 >> $tempfn
+ echo Content-Disposition: attachment\; filename=\"$pagefn\" >> $tempfn
+ echo "">> $tempfn
+-/usr/bin/mimencode $outputfn >> $tempfn
++/usr/bin/base64-encode < $outputfn >> $tempfn
+ 
+ #rm -f $fn
+ rm -f $outputfn
+
--- mgetty-1.1.30.orig/debian/patches/50-pending-voice-zoom-2949l-c
+++ mgetty-1.1.30/debian/patches/50-pending-voice-zoom-2949l-c
@@ -0,0 +1,145 @@
+--- mgetty-1.1.30.orig/voice/libvoice/Lucent.c	2001-04-13 04:01:44.000000000 -0700
++++ mgetty-1.1.30/voice/libvoice/Lucent.c	2003-09-07 14:58:41.000000000 -0700
+@@ -66,6 +66,7 @@
+ 
+ static int Lucent_set_compression (int *compression, int *speed, int *bits)
+      {
++     char buffer[VOICE_BUF_LEN];
+      reset_watchdog();
+ 
+      if (*compression == 0)
+@@ -86,7 +87,8 @@
+ 			  return(FAIL); 
+ 		 }
+ 
+-               if (voice_command("AT+VSM=128", "OK") != VMA_USER_1)
++	       sprintf(buffer, "AT+VSM=128,%d", *speed);
++               if (voice_command(buffer, "OK") != VMA_USER_1)
+                     return(FAIL);
+ 
+                break;
+@@ -100,8 +102,8 @@
+ 			  return(FAIL); 
+ 		 }
+ 	       
+-
+-               if (voice_command("AT+VSM=129", "OK") != VMA_USER_1)
++	       sprintf(buffer, "AT+VSM=129,%d", *speed);
++               if (voice_command(buffer, "OK") != VMA_USER_1)
+                     return(FAIL);
+ 
+                break;
+@@ -115,8 +117,8 @@
+ 			  return(FAIL); 
+ 		 }
+ 
+-
+-               if (voice_command("AT+VSM=130,8000", "OK") != VMA_USER_1)
++	       sprintf(buffer, "AT+VSM=130,%d", *speed);
++               if (voice_command(buffer, "OK") != VMA_USER_1)
+                     return(FAIL);
+ 
+                break;
+@@ -130,24 +132,27 @@
+ 				  voice_modem_name, *speed);
+ 		return(FAIL); 
+ 	      }
+-               if (voice_command("AT+VSM=131,8000", "OK") != VMA_USER_1)
+-                    return(FAIL);
+-
+-               break;
++	    sprintf(buffer, "AT+VSM=131,%d", *speed);
++	    if (voice_command(buffer, "OK") != VMA_USER_1)
++	      return(FAIL);
++	    
++	    break;
+ 
+ 	  case 5:
+ 	    *bits = 4;
+ 
+-	    if ( *speed != 8000 )
++	    if ((*speed != 8000) && (*speed != 7200) && (*speed != 11025))
+ 	      {
+ 		lprintf(L_WARN, "%s: Illegal sample rate (%d)", 
+ 				  voice_modem_name, *speed);
+ 		return(FAIL); 
+ 	      }
+-               if (voice_command("AT+VSM=132,8000", "OK") != VMA_USER_1)
+-                    return(FAIL);
+ 
+-               break;
++	    sprintf(buffer, "AT+VSM=132,%d", *speed);
++	    if (voice_command(buffer, "OK") != VMA_USER_1)
++	      return(FAIL);
++	    
++	    break;
+ 
+           default:
+                lprintf(L_WARN, "%s: Illegal voice compression method (%d)",
+--- mgetty-1.1.30.orig/voice/pvftools/pvftormd.c	2002-11-19 07:39:34.000000000 -0800
++++ mgetty-1.1.30/voice/pvftools/pvftormd.c	2003-09-07 14:11:26.000000000 -0700
+@@ -535,12 +535,13 @@
+           {
+           header_out.bits = 4;
+ 
+-          if (header_in.speed != 8000) 
++	  if ((header_in.speed != 7200)  && (header_in.speed != 8000) &&
++	      (header_in.speed != 11025))
+              {
+                 fprintf(stderr, "%s: Unsupported sample speed (%d)\n",
+                  program_name, header_in.speed);
+                 fprintf(stderr,
+-                 "%s: The Lucent only supports 8000 samples/second\n",
++		 "%s: The Lucent only supports 7.2k, 8k and 11.025k samples/second\n",
+                  program_name);
+                 fclose(fd_out);
+
+--- mgetty-1.1.30.orig/voice/libvoice/V253modem.c	2002-11-25 13:14:51.000000000 -0800
++++ mgetty-1.1.30/voice/libvoice/V253modem.c	2003-09-11 08:40:51.000000000 -0700
+@@ -177,26 +177,26 @@
+        case 2:       /*  2bit ADPCM for some ELSA-modems */
+        {
+          *bits = 2;
+-         if (voice_command("AT+VSM=140,7200", "OK")!= VMA_USER_1)
+-         {
++	 sprintf(buffer, "AT+VSM=140,%d", *speed);
++	 if (voice_command(buffer, "OK") != VMA_USER_1)
++	 {
+          /* there are two diffrent implementations trying one first,
+             if this fails we try the other one later */
+-           Kompressionmethod = 129;
+-         }
+-         else
+-         {
+-           Kompressionmethod = 140;
+-         }
+-         *speed=7200;
++	   Kompressionmethod = 129;
++	 }
++	 else
++	 {
++	   Kompressionmethod = 140;
++	 }
+          break;
+         }
+        case 4:           /* 4bit ADPCM for some ELSA-modems */
+        {
+-         if (voice_command("AT+VSM=141,7200", "OK")!= VMA_USER_1)
++	 sprintf(buffer, "AT+VSM=141,%d", *speed);
++         if (voice_command(buffer, "OK")!= VMA_USER_1)
+          {
+          /* there are two diffrent implementations trying one first,
+             if this fails we try the other one later */
+-
+            Kompressionmethod = 131;
+          }
+          else
+@@ -204,7 +204,6 @@
+            Kompressionmethod = 141;
+          }
+          *bits=4;
+-         *speed=7200;
+          break;
+        }
+        case 5:
+ 
--- mgetty-1.1.30.orig/debian/patches/43-moreinfo-cnd.c_bug112163
+++ mgetty-1.1.30/debian/patches/43-moreinfo-cnd.c_bug112163
@@ -0,0 +1,36 @@
+--- mgetty-1.1.30.orig/cnd.c	2002-11-05 16:43:04.000000000 -0500
++++ mgetty-1.1.30/cnd.c	2003-04-28 00:07:35.000000000 -0400
+@@ -94,6 +94,9 @@
+     /* Swedish Telia/ZyXEL Omni 52k - Torulf Lundgren, torulf@upsys.se */
+     {"Diverting number:",       &CallerId},
+ 
++    /* FALCOM A2D gsm modem              */
++    {"+CLIP: ",              &CallerId},
++
+     {NULL}
+ };
+     
+@@ -163,6 +166,23 @@
+ 		    if ( *p == '\'' || *p == '\"' || !isprint(*p) ) *p = ' ';
+ 		    p++;
+ 		}
++
++		if ( strcmp(cp->string,"+CLIP: ") == 0 ) {
++		  char *q ;
++
++		  p = *(cp->variable) ;
++		  q = *(cp->variable) ;
++		  /* strip non digit charaters */
++		  while( ! isdigit(*p) ) p++;
++		  /* shift only digit characters */
++		  while( isdigit(*p) ) {
++		    *q=*p ;
++		    p++ ;
++		    q++ ;
++		  }
++		  *q = 0;
++		}
++
+ 	    }
+ 	    lprintf(L_JUNK, "CND: found: %s", *(cp->variable));
+ 	    return;
--- mgetty-1.1.30.orig/debian/patches/01-adjust-path
+++ mgetty-1.1.30/debian/patches/01-adjust-path
@@ -0,0 +1,113 @@
+--- mgetty-1.1.27.orig/frontends/winword2/WinFaxServ.pl
++++ mgetty-1.1.27/frontends/winword2/WinFaxServ.pl
+@@ -11,8 +11,8 @@
+ # notice if redistributing.
+ #
+ 
+-$MAILER="/usr/lib/sendmail";
+-$DIR="/usr/spool/fax/winword";
++$MAILER="/usr/sbin/sendmail";
++$DIR="/var/spool/fax/winword";
+ 
+ open(LOG, ">>/usr/adm/errors");
+ select LOG; $| = 1;select STDOUT;
+--- mgetty-1.1.27.orig/voice/scripts/new_voice.craig_southern
++++ mgetty-1.1.27/voice/scripts/new_voice.craig_southern
+@@ -43,7 +43,7 @@
+ outputfn=$fn.$extension
+ 
+ # convert file into correct format
+-/usr/local/bin/rmdtopvf $fn | /usr/local/bin/pvftowav 2>/dev/null > $outputfn
++/usr/bin/rmdtopvf $fn | /usr/bin/pvftowav 2>/dev/null > $outputfn
+ 
+ echo --$seperator >> $tempfn
+ echo Content-Type: $contenttype\; name=\"$pagefn\" >> $tempfn
+--- mgetty-1.1.27.orig/samples/new_fax.all/new_fax
++++ mgetty-1.1.27/samples/new_fax.all/new_fax
+@@ -1,4 +1,4 @@
+-#!/bin/ksh
++#!/bin/sh
+ #
+ # Written 1996 by Darko Krizic
+ #
+@@ -6,10 +6,11 @@
+ # mgetty from Gert Doering. See the README file for more information.
+ 
+ # Do the settings here
+-home=/usr/local/newfax			# The home directory
+-config=$home/faxlist			# The configuration file
+-from="Fax Subsystem <faxadmin@xplor.ipf.de>"	# From this user
+-log=/var/log/faxlog			# logfile
++home=/etc/mgetty/newfax.d/		# The home directory
++config=/etc/mgetty/faxlist			# The configuration file
++this_host=`hostname`
++from="Fax Subsystem <faxmaster@$this_host>"	# From this user
++log=/var/log/mgetty/faxlog		# logfile
+ 
+ # Usually nothing to configure beyond this line
+ PATH=/usr/bin:/bin:/usr/local/bin:/usr/bin/X11
+--- mgetty-1.1.27.orig/login.cfg.in
++++ mgetty-1.1.27/login.cfg.in
+@@ -30,7 +30,7 @@
+ #  (Big advantage: tuucp can use the same passwd file for serial dial-in 
+ #   and tcp dial-in [uucico running as in.uucpd]). Works from 1.05 up.
+ #
+-#U*	uucp	@	/usr/lib/uucp/uucico -l -u @
++#U*	uucp	@	/usr/sbin/uucico -l -u @
+ 
+ #
+ # Use this one for fido calls (login name /FIDO/ is handled specially)
+@@ -39,7 +39,7 @@
+ #  mgetty has to be compiled with "-DFIDO", otherwise a fido call won't
+ #  be detected.
+ #
+-#/FIDO/	uucp	fido	/usr/local/lib/fnet/ifcico @
++#/FIDO/	uucp	fido	/usr/lib/fnet/ifcico @
+ 
+ #
+ # Automatic PPP startup on receipt of LCP configure request (AutoPPP).
+@@ -57,7 +57,7 @@
+ #
+ #  NOTE4: max. 9 arguments allowed.
+ #
+-#/AutoPPP/ -	a_ppp	/usr/sbin/pppd auth -chap +pap login debug
++/AutoPPP/ -	a_ppp	/usr/sbin/pppd auth -chap +pap login debug
+ 
+ #
+ #
+--- mgetty-1.1.30.old/faxrunq.config	1998-11-12 10:26:00.000000000 -0500
++++ mgetty-1.1.30/faxrunq.config	2003-07-01 19:14:55.000000000 -0400
+@@ -42,7 +42,7 @@
+ #delete-sent-jobs y
+ 
+ #  accounting log file (default: see beginning of faxrunq/faxrunqd script)
+-#acct-log /var/log/acct.log
++#acct-log /var/log/mgetty/fax/acct.log
+ 
+ # The following options are for faxrunqd only:
+ 
+@@ -51,11 +51,11 @@
+ #fax-devices ttyS0:ttyS1
+ 
+ #  log file for faxrunqd (default: see beginning of faxrunqd script)
+-#faxrunqd-log /var/log/faxrunqd.log
++#faxrunqd-log /var/log/mgetty/fax/faxrunqd.log
+ 
+ #  number of logfiles to keep around when rolling (default: 3)
+ #faxrunqd-keep-logs 5
+ 
+ #  configuration file for policy routing, see faxrunqd man page for
+ #  details (default: none, i.e. don't use policy routing)
+-#policy-config /usr/local/lib/mgetty+sendfax/policy.config
++#policy-config /etc/mgetty/policy.config
+--- mgetty-1.1.27.orig/callback/README
++++ mgetty-1.1.27/callback/README
+@@ -5,7 +5,7 @@
+ #
+ # callback experiments
+ #
+-cback-gert	-	-	/usr/local/sbin/callback -S 11223344
++cback-gert	-	-	/usr/sbin/callback -S 11223344
+ 
+ to call you back on "11223344" upon entering of a login name of
+ "cback-gert". If you don't specify a number on the command line,
--- mgetty-1.1.30.orig/debian/patches/02-pending-fix-includes
+++ mgetty-1.1.30/debian/patches/02-pending-fix-includes
@@ -0,0 +1,49 @@
+--- mgetty-1.1.27.orig/g3/g3cat.c
++++ mgetty-1.1.27/g3/g3cat.c
+@@ -21,6 +21,7 @@
+ #endif
+ #include <unistd.h>
+ #include <fcntl.h>
++#include <string.h>
+ 
+ extern int	optind;
+ extern char *	optarg;
+--- mgetty-1.1.27.orig/compat/newslock.c
++++ mgetty-1.1.27/compat/newslock.c
+@@ -6,6 +6,7 @@
+  * TAKEN UNMODIFIED FROM C-NEWS BY Geoffrey Collyer AND Henry Spencer
+  */
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ 
+ int
+--- mgetty-1.1.27.orig/voice/libmgsm/code.c
++++ mgetty-1.1.27/voice/libmgsm/code.c
+@@ -8,13 +8,14 @@
+ 
+ #include  "config.h"
+ 
+-
+ #ifdef    HAS_STDLIB_H
+ #include  <stdlib.h>
+ #else
+ #    include "proto.h"
+      extern char    * memcpy P((char *, char *, int));
+ #endif
++
++#include <string.h>
+ 
+ #include  "private.h"
+ #include  "gsm.h"
+--- mgetty-1.1.27.orig/voice/libutil/test_wildmat.c
++++ mgetty-1.1.27/voice/libutil/test_wildmat.c
+@@ -3,6 +3,8 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ 
+ extern int wildmat(char *text, char *p, int length);
+ 
--- mgetty-1.1.30.orig/debian/patches/47-doc_mgetty.texi-in
+++ mgetty-1.1.30/debian/patches/47-doc_mgetty.texi-in
@@ -0,0 +1,14 @@
+--- mgetty-1.1.30.old/doc/mgetty.texi-in	2002-11-17 16:19:45.000000000 -0500
++++ mgetty-1.1.30/doc/mgetty.texi-in	2003-07-05 22:23:20.000000000 -0400
+@@ -7,6 +7,11 @@
+ @finalout
+ 
+ @ifinfo
++@dircategory Communication
++@direntry
++* Mgetty: (mgetty).				     A smart modem replacement for getty.
++@end direntry
++
+ This is the online documentation for the mgetty + sendfax
+ package.
+ 
--- mgetty-1.1.30.orig/debian/patches/36-voice_voice.conf-dist
+++ mgetty-1.1.30/debian/patches/36-voice_voice.conf-dist
@@ -0,0 +1,11 @@
+--- mgetty-1.1.30.orig/voice/voice.conf-dist	2002-12-15 14:43:49.000000000 -0500
++++ mgetty-1.1.30/voice/voice.conf-dist	2003-04-27 23:53:14.000000000 -0400
+@@ -51,7 +51,7 @@
+ #
+ 
+ phone_owner root
+-phone_group phone
++phone_group voice
+ phone_mode 0660
+ 
+ #
--- mgetty-1.1.30.orig/debian/patches/44-pending-faxexpand.h_bug169455
+++ mgetty-1.1.30/debian/patches/44-pending-faxexpand.h_bug169455
@@ -0,0 +1,24 @@
+--- mgetty-1.1.28.old/frontends/X11/viewfax-2.5/faxexpand.h	2000-08-26 07:08:22.000000000 -0400
++++ mgetty-1.1.28/frontends/X11/viewfax-2.5/faxexpand.h	2002-11-27 01:01:19.000000000 -0500
+@@ -17,6 +17,12 @@
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ 
++/* Wed, 27 Nov 2002 00:59:35 -0500, Wolfgang Sourdeau
++   <Wolfgang@Contre.COM>:
++   - member "vres" of struct pagenode explicitly declared as "signed
++     char" instead of "char" for platforms where char is unsigned.
++ */
++
+ #include <limits.h>
+ 
+ #if ULONG_MAX == 4294967295UL
+@@ -69,7 +75,7 @@
+     char inverse;		/* black <=> white */
+     char lsbfirst;		/* bit order is lsb first */
+     char orient;		/* orientation - upsidedown, landscape, mirrored */
+-    char vres;			/* vertical resolution: 1 = fine  */
++    signed char vres;			/* vertical resolution: 1 = fine  */
+     void (*expander)(struct pagenode *, drawfunc);
+     void *extra;		/* used for Ximage */
+ };
--- mgetty-1.1.30.orig/debian/patches/41-ugly-redo-ring.c_bug128668
+++ mgetty-1.1.30/debian/patches/41-ugly-redo-ring.c_bug128668
@@ -0,0 +1,27 @@
+--- mgetty-1.1.30.orig/ring.c	Thu Dec  5 21:29:10 2002
++++ mgetty-1.1.30/ring.c	Mon Sep 29 20:30:23 2003
+@@ -219,6 +219,8 @@
+ char	buf[BUFSIZE], ch, *p;
+ int	i, w, r;
+ int	rc = SUCCESS;
++boolean got_name = FALSE;
++boolean got_nmbr = FALSE;
+ boolean	got_dle;		/* for <DLE><char> events (voice mode) */
+ 
+     lprintf( L_MESG, "wfr: waiting for ``RING''" );
+@@ -321,7 +324,14 @@
+ 	 * instead of waiting for the next "real" RING
+ 	 * (but don't do this for V253 DRON/DROF modems!)
+ 	 */
+-	if ( strncmp( buf, "NMBR", 4 ) == 0 && drox_count == 0 ) { break; }
++	if ( strncmp( buf, "NMBR", 4 ) == 0 && drox_count == 0 ) { got_nmbr = TRUE; }
++ 	if ( strncmp( buf, "NAME", 4 ) == 0 ) { got_name = TRUE; }
++
++ 	if ( got_nmbr && got_name ) break;	/* got both name & number */
++
++ 	/* special case -> break; do not expect caller name */
++ 	if ( got_nmbr && CallerId[0] == 'P' ) break; /* private */
++ 	if ( got_nmbr && CallerId[0] == 'O' ) break; /* out of area */
+ 
+ 	/* V.253 ring cadences */
+ 	if ( strncmp( buf, "DRON", 4 ) == 0 ||
--- mgetty-1.1.30.orig/debian/patches/24-voice_include_paths.h
+++ mgetty-1.1.30/debian/patches/24-voice_include_paths.h
@@ -0,0 +1,15 @@
+--- mgetty-1.1.27.orig/voice/include/paths.h
++++ mgetty-1.1.27/voice/include/paths.h
+@@ -19,10 +19,10 @@
+  * the device name.
+  */
+ 
+-#define VGETTY_LOG_PATH "/var/log/vgetty.%s"
++#define VGETTY_LOG_PATH "/var/log/mgetty/vg_%s.log"
+ 
+ /*
+  * Filename of the logfile for vm.
+  */
+ 
+-#define VM_LOG_PATH "/var/log/vm.log"
++#define VM_LOG_PATH "/var/log/mgetty/vm.log"
--- mgetty-1.1.30.orig/debian/patches/00-g3_Makefile
+++ mgetty-1.1.30/debian/patches/00-g3_Makefile
@@ -0,0 +1,11 @@
+--- mgetty-1.1.27.orig/g3/Makefile
++++ mgetty-1.1.27/g3/Makefile
+@@ -5,7 +5,7 @@
+ #
+ 
+ CC=gcc
+-CFLAGS=-O2 -I.. -g
++CFLAGS=-O2 -I.. #-g
+ 
+ G3_PROGRAMS=pbm2g3 g3cat g32pbm
+ 
--- mgetty-1.1.30.orig/debian/patches/40-locks.c_bug153394
+++ mgetty-1.1.30/debian/patches/40-locks.c_bug153394
@@ -0,0 +1,60 @@
+--- mgetty-1.1.28.old/locks.c	2001-01-06 12:46:34.000000000 -0500
++++ mgetty-1.1.28/locks.c	2002-08-03 16:25:02.000000000 -0400
+@@ -394,9 +394,42 @@
+ 
+ #else	/* not SVR4 */ 
+ 
++static char * unslash_name _P1 ( (device),
++				 char *device )
++{
++    char *lock_device, *ldev_begin, *ldevice_orig;
++
++    ldevice_orig = malloc( strlen (device) + 1 );
++    sprintf( ldevice_orig, "%s", device );
++
++    lock_device = strchr( ldevice_orig, '/' );
++    while (lock_device)
++      {
++	*lock_device = '_';
++	lock_device = strchr( lock_device, '/' );
++      }
++
++    if ( *ldevice_orig == '_' )
++      {
++	lock_device = strchr( ldevice_orig + 1, '_' );
++	if (! lock_device)
++	  lock_device = ldevice_orig;
++	lock_device++;
++      }
++    else
++      lock_device = ldevice_orig;
++
++    ldev_begin = malloc( strlen( lock_device ) + 1 );
++    sprintf( ldev_begin, "%s", lock_device );
++    free( ldevice_orig );
++
++    return ldev_begin;
++}
++
+ static char * get_lock_name _P2( (lock_name, device),
+ 			  char * lock_name, char * device )
+ {
++    char *lock;
+ #ifdef LOCKS_LOWERCASE
+     /* sco locking convention -> change all device names to lowercase */
+ 
+@@ -425,10 +458,10 @@
+ #endif	/* LOCKS_LOWERCASE */
+ 
+     /* throw out all directory prefixes */
+-    if ( strchr( device, '/' ) != NULL )
+-        device = strrchr( device, '/' ) +1;
+-    
+-    sprintf( lock_name, LOCK, device);
++
++    lock = unslash_name ( device );
++    sprintf( lock_name, LOCK, lock );
++    free ( lock );
+ 
+     return lock_name;
+ }
--- mgetty-1.1.30.orig/debian/patches/09-doc_Makefile
+++ mgetty-1.1.30/debian/patches/09-doc_Makefile
@@ -0,0 +1,91 @@
+--- mgetty-1.1.28.copy/doc/Makefile	1997-11-27 15:33:26.000000000 -0500
++++ mgetty-1.1.28/doc/Makefile	2002-07-30 03:27:31.000000000 -0400
+@@ -4,6 +4,8 @@
+ #
+ 
+ NROFF=nroff
++
++INSTALL=install
+ #
+ #
+ MAN1PAGES=g32pbm.1 g3cat.1 pbm2g3.1 fax.1 \
+@@ -12,11 +14,11 @@
+ MAN5PAGES=faxqueue.5
+ MAN8PAGES=sendfax.8 mgetty.8 callback.8 faxrunqd.8
+ MANSRC=$(MAN1PAGES) $(MAN4PAGES) $(MAN5PAGES) $(MAN8PAGES)
+-MAN1DIR=/usr/local/man/man1
+-MAN4DIR=/usr/local/man/man4
+-MAN5DIR=/usr/local/man/man5
+-MAN8DIR=/usr/local/man/man8
+-INFODIR=/usr/local/info
++MAN1DIR=$(PREFIX)/usr/share/man/man1
++MAN4DIR=$(PREFIX)/usr/share/man/man4
++MAN5DIR=$(PREFIX)/usr/share/man/man5
++MAN8DIR=$(PREFIX)/usr/share/man/man8
++INFODIR=$(PREFIX)/usr/share/info
+ 
+ #
+ # formatted man pages
+@@ -26,18 +28,19 @@
+ 
+ all:
+ 
+-doc-all: mgetty.asc mgetty.info mgetty.dvi mgetty.ps fmt-manpages $(MANSRC) 
++doc-all: mgetty.info mgetty.dvi mgetty.ps fmt-manpages $(MANSRC) # mgetty.asc
+ 
+ manpages: $(MANSRC)
+ 
+ fmt-manpages:
+ 	-$(MAKE) `for i in $(MANSRC) ; do echo \`expr $$i : "\([^.]*\)"\`.man ; done `
+ 
+-mgetty.asc: mgetty.ms
+-	-$(NROFF) -ms mgetty.ms >mgetty.asc
++# commented out since I couldn't find texi2roff
++#mgetty.asc: mgetty.ms
++#	-$(NROFF) -ms mgetty.ms >mgetty.asc
+ 
+-mgetty.ms: mgetty.texi
+-	-texi2roff -ms <mgetty.texi >mgetty.ms
++#mgetty.ms: mgetty.texi
++#	-texi2roff -ms <mgetty.texi >mgetty.ms
+ 
+ mgetty.html: mgetty.texi
+ 	-texi2html -verbose mgetty.texi
+@@ -62,10 +65,12 @@
+ 
+ fullclean: clean
+ 	rm -f mgetty.ps mgetty.dvi mgetty.aux mgetty.info* mgetty.ms \
+-	      *.man *.[1-9] mgetty.texi
++	      *.man *.[1-9] mgetty.texi # mgetty.asc
++
++install: install.man install.info
+ 
+-install: $(MANSRC) mgetty.info
+-	-mkdir `dirname $(MAN1DIR)` $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR) 2>/dev/null
++install.man: $(MANSRC)
++	-mkdir -p `dirname $(MAN1DIR)` $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR) 2>/dev/null
+ 	for i in $(MAN1PAGES) ; do \
+ 		$(INSTALL) -m 644 $$i $(MAN1DIR) ; \
+ 	done
+@@ -78,8 +83,10 @@
+ 	for i in $(MAN8PAGES) ; do \
+ 		$(INSTALL) -m 644 $$i $(MAN8DIR) ; \
+ 	done
++
++install.info:
+ 	if [ -f mgetty.info ] ; then\
+-	    test -d $(INFODIR) || mkdir $(INFODIR) 2>/dev/null ; \
++	    test -d $(INFODIR) || mkdir -p $(INFODIR) 2>/dev/null ; \
+ 	    for i in mgetty.info* ; do \
+ 		$(INSTALL) -m 644 $$i $(INFODIR) ; \
+ 	    done ; \
+@@ -92,8 +99,8 @@
+ ../mgetty0$(VS)doc.tar.gz: doc-all mgetty.html
+ 	gtar cvvf ../mgetty0$(VS)doc.tar mgetty.texi mgetty.info* \
+ 				         mgetty.dvi mgetty.ps \
+-				         mgetty.ms mgetty.asc \
+ 					 mgetty.html *.man
++#				         mgetty.ms mgetty.asc
+ 	gzip -f -9 -v ../mgetty0$(VS)doc.tar
+ 
+ # explicit man page dependencies
--- mgetty-1.1.30.orig/debian/patches/23-samples_new_fax.mime4
+++ mgetty-1.1.30/debian/patches/23-samples_new_fax.mime4
@@ -0,0 +1,77 @@
+--- mgetty-1.1.30.old/samples/new_fax.mime4	1999-04-17 06:38:50.000000000 -0400
++++ mgetty-1.1.30/samples/new_fax.mime4	2003-07-01 23:45:07.000000000 -0400
+@@ -37,13 +37,14 @@
+ PATH=/usr/sbin:/usr/local/bin:/usr/bin:/bin:$PATH
+ 
+ # Select image type by uncommenting one of the following lines:
+-#PBMTOX=pnmtopng 	; MIME_TYPE="image/png"               ; FILE_EXTN=png
+-PBMTOX=ppmtogif 	; MIME_TYPE="image/gif"               ; FILE_EXTN=gif
++PBMTOX=pnmtopng 	; MIME_TYPE="image/png"               ; FILE_EXTN=png
++#PBMTOX=ppmtogif 	; MIME_TYPE="image/gif"               ; FILE_EXTN=gif
+ #PBMTOX=pnmtotiff 	; MIME_TYPE="image/tiff"              ; FILE_EXTN=tif
+ # PBM files may be huge
+ #PBMTOX=cat       	; MIME_TYPE="image/x-portable-bitmap" ; FILE_EXTN=pbm
+ # compressed PBM files
+ #PBMTOX=gzip       	; MIME_TYPE="application/octet-stream"; FILE_EXTN=pbm.gz
++#PBMTOX=NONE       	; MIME_TYPE="image/fax-g3"; FILE_EXTN=g3
+ 
+ # The binaries we need; please check carefully !!!
+ BASENAME=basename
+@@ -63,14 +64,23 @@
+ 
+ # Some miscellaneous data and filenames.
+ TMP=/tmp
+-MAIL_MESS=$TMP/MESS_$$
+-ERRO_MESS=$TMP/ERRO_$$
+-IMAG_FILE=$TMP/TIFF_$$
+-MIME_MESS=$TMP/MAIL_$$
++MAIL_MESS=`/bin/tempfile -pMESS_`
++ERRO_MESS=`/bin/tempfile -pERRO_`
++IMAG_FILE=`/bin/tempfile -pTIFF_`
++MIME_MESS=`/bin/tempfile -pMAIL_`
++if [ ! -f $MAIL_MESS ] ||\
++    [ ! -f $ERRO_MESS ] ||\
++    [ ! -f $IMAG_FILE ] ||\
++    [ ! -f $MIME_MESS ]
++then
++  echo "Could not create one of the temporary files. Aborting...";
++  exit 1;
++fi
++
+ umask 077
+ 
+ # Clean up from previous invocations and trap errors
+-$RM -f $MAIL_MESS $ERRO_MESS $IMAG_FILE $MIME_MESS
++# $RM -f $MAIL_MESS $ERRO_MESS $IMAG_FILE $MIME_MESS
+ trap "$RM -f $MAIL_MESS $ERRO_MESS $IMAG_FILE $MIME_MESS; exit" 0 1 2 15
+ 
+ # Essential lines to put into the header of a MIME mail.
+@@ -86,7 +96,7 @@
+ ATTACHMENT_ENDLINE="--attachment--"
+ 
+ # Now we build our MIME mailheader using commandline arguments.
+-$ECHO "Subject: incoming FAX from $2 with $3 pages" >  $MAIL_MESS
++$ECHO "Subject: incoming FAX from $2 with $3 pages" >> $MAIL_MESS
+ $ECHO "$HEADERLINE_1"                               >> $MAIL_MESS
+ $ECHO "$HEADERLINE_2"                               >> $MAIL_MESS
+ $ECHO ""                                            >> $MAIL_MESS
+@@ -109,6 +119,9 @@
+ #
+ for i in $@
+ do
++if [ "$PBMTOX" = "NONE" ]; then
++	IMAG_FILE=$i
++else
+ 	# We use the second character in the filename to identify the
+ 	# resolution of our incoming fax, so we can easily scale the fax for
+ 	# display on a screen.
+@@ -126,7 +139,8 @@
+ 	# handle standard input correctly.
+ 	$CAT $i                                        2>> $ERRO_MESS \
+ 	| $G3TOPBM $STRETCH                            2>> $ERRO_MESS \
+-	| $PBMTOX                        >> $IMAG_FILE 2>> $ERRO_MESS
++	| $PBMTOX                        > $IMAG_FILE 2>> $ERRO_MESS
++fi
+ #
+ 	# Now we put the header for each attachment into our MIME mail.
+ 	$ECHO "$ATTACHMENT_HEADERLINE_1" >> $MIME_MESS
--- mgetty-1.1.30.orig/debian/patches/26-voice_libpvf_usr.c
+++ mgetty-1.1.30/debian/patches/26-voice_libpvf_usr.c
@@ -0,0 +1,16 @@
+--- mgetty-1.1.27.orig/voice/libpvf/usr.c
++++ mgetty-1.1.27/voice/libpvf/usr.c
+@@ -103,9 +103,13 @@
+          }
+        }
+        gsm_encode(r, s, d);
++#if defined(old_USR_GSM_with_head_and_tail_bytes)
+        fwrite((char *)gsm_head, 2, 1, fd_out);
++#endif
+        fwrite((char *)d, sizeof(d), 1, fd_out);
++#if defined(old_USR_GSM_with_head_and_tail_bytes)
+        fwrite((char *)gsm_tail, 3, 1, fd_out);
++#endif
+      }
+      gsm_destroy(r);
+      return(OK);
--- mgetty-1.1.30.orig/debian/patches/03-callback_Makefile
+++ mgetty-1.1.30/debian/patches/03-callback_Makefile
@@ -0,0 +1,20 @@
+--- mgetty-1.1.27.orig/callback/Makefile
++++ mgetty-1.1.27/callback/Makefile
+@@ -5,7 +5,7 @@
+ #
+ 
+ CC=gcc
+-CFLAGS=-O2 -I.. -g
++CFLAGS=-O2 -I..
+ 
+ zigzag:
+ 	cd .. ; $(MAKE) call-back
+@@ -40,7 +40,7 @@
+ # install programs
+ #
+ install: all
+-	$(INSTALL) -s -m 700 -o root callback $(SBINDIR)
++	$(INSTALL) -s -m 755 -o root callback $(SBINDIR)
+ 	$(INSTALL) -s -m 4711 -o root ct $(BINDIR)
+ 
+ # source modules
--- mgetty-1.1.30.orig/debian/patches/10-doc_faxrunqd.8in
+++ mgetty-1.1.30/debian/patches/10-doc_faxrunqd.8in
@@ -0,0 +1,60 @@
+--- mgetty-1.1.30.old/doc/faxrunqd.8in	2002-11-23 11:47:17.000000000 -0500
++++ mgetty-1.1.30/doc/faxrunqd.8in	2003-07-15 16:08:22.000000000 -0400
+@@ -3,7 +3,7 @@
+ .SH NAME
+ faxrunqd \- daemon to send fax jobs queued by faxspool(1)
+ .SH SYNOPSIS
+-.B faxrunqd [-v] [-d] [-l <ttys>] [-u <user>] [-V]
++.B faxrunqd [-v] [-d] [-D] [-l <ttys>] [-u <user or uid>] [ -g <group or gid> ] [-V]
+ .SH DESCRIPTION
+ Runs in the background, and regularily checks the fax queue set up by
+ faxspool(1).  Sends all jobs that are due, records results, and takes
+@@ -59,7 +59,7 @@
+ would do (send a mail, delete the JOB directory, execute a named program,
+ etc.).  Both programs are fully compatible in this respect.
+ 
+-.B faxrunqd [-v] [-d] [-l <ttys>] [-u <user>] [-V]
++.B faxrunqd [-v] [-d] [-D] [-l <ttys>] [-u <user or uid>] [ -g <group or gid> ] [-V]
+ .SH OPTIONS
+ .TP
+ .B -v
+@@ -67,17 +67,22 @@
+ .I faxrunqd
+ to write progress information to the log file.
+ .TP
++.B -D
++Tells
++.I faxrunqd
++to run in the background, as a daemon.
++.TP
+ .B -d
+ Tells
+ .I faxrunqd
+ to write debugging information to stdout and the log file (usually used
+-together with -v)
++together with -v).
+ .TP
+ .B -l <ttyS>
+ Specifies the list of modem devices to use.  Multiple devices are
+ separated with ':', e.g. '-l ttyS0:ttyS1'.
+ .TP
+-.B -u <user>
++.B -u <user or uid>
+ .I faxrunqd
+ can now (since 1.1.29) run as unprivileged user.  If you start it as root
+ from /etc/inittab or from one of the /etc/rc* scripts, it's strongly
+@@ -86,7 +91,13 @@
+ .I faxrunqd
+ drop all its privileges at startup, and run as the specified user.  Running
+ .I faxrunqd
+-as root user might lead to security problems - don't do it.
++as root user might lead to security problems - don't do it. This
++parameter takes either a uid or a username as argument.
++.TP
++.B -g <group or gid>
++.I Same effect as above but for the group id. Indicates the group which
++should own the fax files. This parameter takes either a gid or a
++groupname as argument.
+ .TP
+ .B -V
+ print version number and exit
--- mgetty-1.1.30.orig/debian/patches/39-mgetty.cfg.in
+++ mgetty-1.1.30/debian/patches/39-mgetty.cfg.in
@@ -0,0 +1,12 @@
+--- mgetty-1.1.27.orig/mgetty.cfg.in
++++ mgetty-1.1.27/mgetty.cfg.in
+@@ -20,6 +20,9 @@
+ # access the modem(s) with @SPEED@ bps
+ speed @SPEED@
+ 
++# use an alternate issue file, to avoid being bitten by linuxlogo
++issue-file /etc/issue.mgetty
++
+ #  use these options to make the /dev/tty-device owned by "uucp.uucp" 
+ #  and mode "rw-rw-r--" (0664). *LEADING ZERO NEEDED!*
+ #port-owner uucp
--- mgetty-1.1.30.orig/debian/patches/45-logfile.c
+++ mgetty-1.1.30/debian/patches/45-logfile.c
@@ -0,0 +1,52 @@
+--- mgetty-1.1.30.orig/logfile.c	2002-11-25 08:08:26.000000000 -0500
++++ mgetty-1.1.30/logfile.c	2003-04-28 00:08:35.000000000 -0400
+@@ -56,10 +56,14 @@
+ /* Most systems have these variables but do not declare them. On many
+    of those systems that _do_ declare them, it won't hurt */
+ 
+-extern int sys_nerr;
+-#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
+-extern char *sys_errlist[];
+-#endif
++/* commented in by was@debian.org on Wed, 27 Nov 2002 01:15:11 -0500
++   because sys_nerr and sys_errlist are deprecated. strerror() is used
++   instead below.*/
++
++/* extern int sys_nerr; */
++/* #if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__) */
++/* extern char *sys_errlist[]; */
++/* #endif */
+ 
+ /* Interactive Unix is a little bit braindead - does not have atexit(),
+  */
+@@ -209,6 +213,7 @@
+ va_list pvar;
+ int     errnr;
+ char * p;
++char *error_string;
+ static int first_open = TRUE;
+ 
+     if ( level > log_level )	/* log level high enough? */
+@@ -325,12 +330,20 @@
+     }
+     else		/* ERROR or FATAL */
+     {
++        error_string = strerror (errnr);
++	if ( error_string == NULL )
++	{
++            if ( errno == EINVAL )
++	        error_string = "<error not in list>";
++	    else
++	        error_string = "<error calling strerror()>";
++	}
++
+ 	fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: %s",
+ 		             tm->tm_mon+1,  tm->tm_mday,
+ 			     tm->tm_hour, tm->tm_min, tm->tm_sec,
+ 		             log_infix, ws,
+-			     ( errnr <= sys_nerr ) ? sys_errlist[errnr]:
+-			     "<error not in list>" );
++			     strerror (errnr));
+ #ifdef SYSLOG
+ 	syslog( level == L_FATAL? LOG_ALERT: LOG_ERR, "%s: %m", ws );
+ #endif
--- mgetty-1.1.30.orig/debian/patches/37-Makefile
+++ mgetty-1.1.30/debian/patches/37-Makefile
@@ -0,0 +1,141 @@
+--- mgetty-1.1.30.orig/Makefile	2002-12-16 08:08:23.000000000 -0500
++++ mgetty-1.1.30/Makefile	2003-04-28 00:25:24.000000000 -0400
+@@ -107,7 +107,7 @@
+ # prompt first. Don't forget to activate the /AutoPPP/ line in login.config!
+ #
+ #CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL
+-CFLAGS=-O2 -Wall -pipe
++CFLAGS=-O2 -Wall -pipe -DAUTO_PPP -DFIDO
+ #CFLAGS=-O -DSVR4
+ #CFLAGS=-O -DSVR4 -DSVR42
+ #CFLAGS=-O -DUSE_POLL
+@@ -169,7 +169,7 @@
+ #
+ # if your systems doesn't have one, use the shell script that I provide
+ # in "inst.sh" (taken from X11R5). Needed on IRIX5.2
+-INSTALL=install -c -o bin -g bin
++INSTALL=install -c
+ #INSTALL=install -c -o root -g wheel		# NeXT/BSD
+ #INSTALL=/usr/ucb/install -c -o bin -g bin	# AIX, Solaris 2.x
+ #INSTALL=installbsd -c -o bin -g bin		# OSF/1, AIX 4.1, 4.2
+@@ -177,11 +177,11 @@
+ #
+ # prefix, where most (all?) of the stuff lives, usually /usr/local or /usr
+ #
+-prefix=/usr/local
++prefix=$(DESTDIR)/usr
+ #
+ # prefix for all the spool directories (usually /usr/spool or /var/spool)
+ #
+-spool=/var/spool
++spool=$(DESTDIR)/var/spool
+ #
+ # where the mgetty + sendfax binaries live (used for "make install")
+ #
+@@ -193,11 +193,11 @@
+ #
+ # where the font+coverpage files go
+ #
+-LIBDIR=$(prefix)/lib/mgetty+sendfax
++LIBDIR=$(prefix)/lib/mgetty-fax
+ #
+ # where the configuration files (*.config, aliases, fax.allow/deny) go to
+ #
+-CONFDIR=$(prefix)/etc/mgetty+sendfax
++CONFDIR=$(DESTDIR)/etc/mgetty
+ #CONFDIR=/etc/default/
+ #
+ #
+@@ -220,31 +220,33 @@
+ # (it's possible to run faxrunq(d) as root, but the FAX_OUT_USER 
+ #  MUST NOT BE root or any other privileged account).
+ #
+-FAX_OUT_USER=fax
++FAX_OUT_USER=uucp
+ #
+ #
+ # Where section 1 manual pages should be placed
+-MAN1DIR=$(prefix)/man/man1
++MAN1DIR=$(prefix)/share/man/man1
+ #
+ # Where section 4 manual pages (mgettydefs.4) should be placed
+-MAN4DIR=$(prefix)/man/man4
++MAN4DIR=$(prefix)/share/man/man4
+ #
+ # Section 5 man pages (faxqueue.5)
+-MAN5DIR=$(prefix)/man/man5
++MAN5DIR=$(prefix)/share/man/man5
+ #
+ # Section 8 man pages (sendfax.8)
+-MAN8DIR=$(prefix)/man/man8
++MAN8DIR=$(prefix)/share/man/man8
+ #
+ # Where the GNU Info-Files are located
+ #
+-INFODIR=$(prefix)/info
++INFODIR=$(prefix)/share/info
+ #
+ #
+ # A shell that understands bourne-shell syntax
+ #  Usually this will be /bin/sh or /usr/bin/sh, but bash or ksh are fine.
+ #  (on some ultrix systems, you may need /bin/sh5 here)
+ #
+-SHELL=/bin/sh
++# On Debian GNU/Linux, bash is a required package so we can use it to solve
++# bug #149851.
++SHELL=/bin/bash
+ #
+ # If you have problems with the awk-programs in the fax/ shell scripts,
+ # try using "nawk" or "gawk" (or whatever works...) here
+@@ -274,7 +276,7 @@
+ # please use the "mg.echo" program provided in the compat/ subdirectory.
+ # Set ECHO="mg.echo" and INSTALL_MECHO to mg.echo
+ #
+-ECHO="echo"
++ECHO="echo -e"
+ #
+ # INSTALL_MECHO=mg.echo
+ 
+@@ -284,7 +286,7 @@
+ 
+ # To maintain security, I recommend creating a new group for
+ # users who are allowed to manipulate the recorded voice messages.
+-PHONE_GROUP=phone
++PHONE_GROUP=voice
+ PHONE_PERMS=770
+ 
+ # Add -DNO_STRSTR to CFLAGS if you don't have strstr().
+@@ -594,7 +596,7 @@
+ 	-test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
+ 	-mv -f $(SBINDIR)/mgetty $(SBINDIR)/mgetty.old
+ 	-mv -f $(SBINDIR)/sendfax $(SBINDIR)/sendfax.old
+-	$(INSTALL) -s -m 700 mgetty $(SBINDIR)
++	$(INSTALL) -s -m 755 mgetty $(SBINDIR)
+ 	$(INSTALL) -s -m 755 sendfax $(SBINDIR)
+ #
+ # data files + directories
+@@ -663,12 +665,15 @@
+ #
+ # documentation
+ #
+-install.doc:
+-	cd doc ; $(MAKE) install INSTALL="$(INSTALL)" \
++install.man:
++	cd doc ; $(MAKE) install.man INSTALL="$(INSTALL)" \
+ 				MAN1DIR=$(MAN1DIR) \
+ 				MAN4DIR=$(MAN4DIR) \
+ 				MAN5DIR=$(MAN5DIR) \
+-				MAN8DIR=$(MAN8DIR) \
++				MAN8DIR=$(MAN8DIR)
++
++install.info:
++	cd doc ; $(MAKE) install.info INSTALL="$(INSTALL)" \
+ 				INFODIR=$(INFODIR)
+ 
+ #
+@@ -736,3 +741,5 @@
+   conf_sf.h 
+ tio.o : tio.c mgetty.h ugly.h tio.h 
+ utmp.o : utmp.c mgetty.h ugly.h mg_utmp.h 
++
++.PHONY: install install.bin install.man install.info
--- mgetty-1.1.30.orig/debian/patches/13-fax_faxspool.in
+++ mgetty-1.1.30/debian/patches/13-fax_faxspool.in
@@ -0,0 +1,237 @@
+--- mgetty-1.1.30.orig/fax/faxspool.in	2002-11-23 10:14:57.000000000 -0500
++++ mgetty-1.1.30/fax/faxspool.in	2003-04-27 23:48:56.000000000 -0400
+@@ -70,7 +70,7 @@
+ FAX_SPOOL=@FAX_SPOOL@
+ FAX_SPOOL_OUT=@FAX_SPOOL_OUT@
+ FAX_SEQ=$FAX_SPOOL_OUT/.Sequence
+-FAX_SEQ_LOCKDIR=$FAX_SPOOL_OUT/locks
++FAX_SEQ_LOCKDIR=/var/lock/fax
+ FAX_SEQ_LOCK=$FAX_SEQ_LOCKDIR/LCK..seq
+ LAST_RUN=@FAX_SPOOL_OUT@/faxqueue_done
+ 
+@@ -145,7 +145,7 @@
+ #
+ fs_cvt_pbm()
+ {
+-    pbm2g3 $1 >$2.001
++    pbm2g3 "$1" >"$2".001
+ }
+ 
+ #
+@@ -153,7 +153,7 @@
+ #
+ fs_cvt_pgm()
+ {
+-    pgmtopbm $1 | pbm2g3 >$2.001
++    pgmtopbm "$1" | pbm2g3 >"$2".001
+ }
+ 
+ #
+@@ -161,7 +161,7 @@
+ #
+ fs_cvt_ppm()
+ {
+-    ppmtopgm $1 | pgmtopbm | pbm2g3 >$2.001
++    ppmtopgm "$1" | pgmtopbm | pbm2g3 >"$2".001
+ }
+ 
+ #
+@@ -171,7 +171,7 @@
+ #
+ fs_cvt_g3()
+ {
+-    g3cat $1 >$2.001
++    g3cat "$1" >"$2".001
+ }
+ 
+ #
+@@ -183,14 +183,14 @@
+ fs_cvt_xwd()
+ {
+     REDUCE="cat"
+-    test X$3 = X-n && REDUCE="pnmscale -yscale 0.5"
++    test X"$3" = X-n && REDUCE="pnmscale -yscale 0.5"
+ 
+-    xwdtopnm $1 |\
++    xwdtopnm "$1" |\
+ 	pnmscale -xysize 1728 2000 |\
+ 	$REDUCE |\
+ 	ppmtopgm |\
+ 	pgmtopbm |\
+-	pbm2g3 >$2.001
++	pbm2g3 >"$2".001
+ }
+ 
+ #
+@@ -201,14 +201,14 @@
+ fs_cvt_gif()
+ {
+     REDUCE="cat"
+-    test X$3 = X-n && REDUCE="pnmscale -yscale 0.5"
++    test X"$3" = X-n && REDUCE="pnmscale -yscale 0.5"
+ 
+-    giftoppm $1 |\
++    giftopnm "$1" |\
+ 	pnmscale -xysize 1728 2000 |\
+ 	$REDUCE |\
+ 	ppmtopgm |\
+ 	pgmtopbm |\
+-	pbm2g3 >$2.001
++	pbm2g3 >"$2".001
+ }
+ 
+ #
+@@ -219,14 +219,14 @@
+ fs_cvt_tif()
+ {
+     REDUCE="cat"
+-    test X$3 = X-n && REDUCE="pnmscale -yscale 0.5"
++    test X"$3" = X-n && REDUCE="pnmscale -yscale 0.5"
+ 
+-    tifftopnm $1 |\
++    tifftopnm "$1" |\
+ 	pnmscale -xysize 1728 2000 |\
+ 	$REDUCE |\
+ 	ppmtopgm |\
+ 	pgmtopbm |\
+-	pbm2g3 >$2.001
++	pbm2g3 >"$2".001
+ }
+ 
+ #
+@@ -235,11 +235,11 @@
+ #
+ fs_cvt_lj()
+ {
+-    if [ X$3 = X-n ]
++    if [ X"$3" = X-n ]
+     then
+-        hp2log3 -r$2 <$1
++        hp2log3 -r"$2" <"$1"
+     else
+-        hp2hig3 -r$2 <$1
++        hp2hig3 -r"$2" <"$1"
+     fi
+ }
+ 
+@@ -251,10 +251,10 @@
+ fs_cvt_ps()
+ {
+     driver="$GS_DRIVER_HI"
+-    test X$3 = X-n && driver="$GS_DRIVER_LO"
++    test X"$3" = X-n && driver="$GS_DRIVER_LO"
+ 
+-    cat $1 |
+-	gs $driver -sOutputFile=$2%03d -dNOPAUSE -q -dSAFER -
++    cat "$1" |
++	gs $driver -sOutputFile="$2"%03d -dNOPAUSE -q -dSAFER -
+ }
+        
+ #
+@@ -268,19 +268,19 @@
+ # via Ghostscript:
+ 
+     driver="$GS_DRIVER_HI"
+-    test X$3 = X-n && driver="$GS_DRIVER_LO"
++    test X"$3" = X-n && driver="$GS_DRIVER_LO"
+ 
+-    gs $driver -sOutputFile=$2%03d -dNOPAUSE \
+-			-- gslp.ps -fCourier-Bold10 -B $1
++    gs $driver -sOutputFile="$2"%03d -dNOPAUSE \
++			-- gslp.ps -fCourier-Bold10 -B "$1"
+ 
+ #####
+ # via hp2pbm:
+ # (convert "LF" to "CR+LF" via awk)
+ 
+ #    pgm=hp2hig3
+-#    test X$3 = X-n && pgm=hp2log3
++#    test X"$3" = X-n && pgm=hp2log3
+ #
+-#    $AWK '{ printf "%s\r\n", $0 }' $1 | $pgm -r$2
++#    $AWK '{ printf "%s\r\n", $0 }' "$1" | $pgm -r"$2"
+ 
+ #####
+ # via pbmtext (not really recommended):
+@@ -288,13 +288,13 @@
+ 
+ ## Select appropriate font
+ #    font=$PBMFONT_BODY_F
+-#    test X$3 = X-n && font=$PBMFONT_BODY_N
++#    test X"$3" = X-n && font=$PBMFONT_BODY_N
+ # Determine how many pages text will be split in to.  Uses default pagelen.
+-#    nr=`pgx < $1`
++#    nr=`pgx < "$1"`
+ # Convert each page into a separate G3 file.  Uses default pagelen (60).
+ #    page=1
+ #    while [ $page -le $nr ]; do
+-#	pgx $page < $1 | pbmtext -font $font | pbm2g3 >$2.$page
++#	pgx $page < "$1" | pbmtext -font $font | pbm2g3 >"$2".$page
+ #	page=`expr $page + 1`
+ #    done
+ }
+@@ -306,7 +306,7 @@
+ #
+ fs_cvt_dvi()
+ {
+-    if [ X$3 = X-n ]
++    if [ X"$3" = X-n ]
+     then 
+ 	driver="$GS_DRIVER_LO" ; dvipscfg="-P dfaxlo"
+     else
+@@ -316,18 +316,18 @@
+ # if you do not have the dfaxlo(w)/dfaxhigh dvips modes configured, 
+ # remove "$dvipscfg" from the dvips command line below [or configure them!]
+ 
+-    dvips $dvipscfg $1 -o \
+-        !"gs $driver -sOutputFile=$2%03d -dNOPAUSE -dSAFER -q -"
++    dvips $dvipscfg "$1" -o \
++        !"gs $driver -sOutputFile="$2"%03d -dNOPAUSE -dSAFER -q -"
+ 
+ # for those that only have the old "dvialw":
+ #
+ #	dvialw <$file |
+-#	    gs $driver -sOutputFile=$2%03d -dNOPAUSE -dSAFER -q -
++#	    gs $driver -sOutputFile="$2"%03d -dNOPAUSE -dSAFER -q -
+ 
+ # for those that have dvi2ps and not dvips:
+ #
+ #	dvi2ps -r -q $q |
+-#	    gs $driver -sOutputFile=$2%03d -dNOPAUSE -dSAFER -q -
++#	    gs $driver -sOutputFile="$2"%03d -dNOPAUSE -dSAFER -q -
+ 
+ }
+ 
+@@ -341,11 +341,11 @@
+ fs_cvt_pdf()
+ {
+     driver="$GS_DRIVER_HI"
+-    test X$3 = X-n && driver="$GS_DRIVER_LO"
++    test X"$3" = X-n && driver="$GS_DRIVER_LO"
+ 
+-    cat $1 |
++    cat "$1" |
+ 	acroread -toPostScript |
+-	gs $driver -sOutputFile=$2%03d -dNOPAUSE -q -dSAFER -
++	gs $driver -sOutputFile="$2"%03d -dNOPAUSE -q -dSAFER -
+ }
+ 
+ 
+@@ -487,7 +487,7 @@
+ 	    then
+ 		user="$2"
+ 	    else
+-		$echo "not authorized to use \`\`-u $2'' switch." >&2
++		$echo "not authorized to use \`\`-u "$2"'' switch." >&2
+ 		exit 3
+ 	    fi
+ 	    shift ; shift
+@@ -547,7 +547,7 @@
+     exit 3
+ fi
+ 
+-phone=$1 ; shift
++phone="$1" ; shift
+ if expr "$phone" : "[-0-9TtPpWw,;]*$" >/dev/null ; then :
+ else
+     alias="$phone"
--- mgetty-1.1.30.orig/debian/patches/14-frontends_X11_viewfax-2.5_Makefile
+++ mgetty-1.1.30/debian/patches/14-frontends_X11_viewfax-2.5_Makefile
@@ -0,0 +1,60 @@
+--- mgetty-1.1.28.old/frontends/X11/viewfax-2.5/Makefile	2002-08-03 17:26:26.000000000 -0400
++++ mgetty-1.1.28/frontends/X11/viewfax-2.5/Makefile	2002-08-03 17:30:26.000000000 -0400
+@@ -21,15 +21,15 @@
+ 
+ ####### Site-specific definitions #######
+ # Destination directories and installation program for make install
+-BINDIR = /usr/local/bin
+-LIBDIR = /usr/local/lib
+-MANDIR	= /usr/local/man/man1
+-INSTALL = /usr/ucb/install
++BINDIR = $(DESTDIR)/usr/bin
++DOCDIR = $(DESTDIR)/usr/share/doc/mgetty-viewfax
++MANDIR	= $(DESTDIR)/usr/share/man/man1
++INSTALL = /usr/bin/install
+ RM = rm -f
+ # Location of help file
+-HELP = \"$(LIBDIR)/viewfax.tif\"
++HELP = \"$(DOCDIR)/viewfax.tif\"
+ # optimisation level, debug etc
+-OPT = -g -O2 -Wno-uninitialized -ansi -pedantic
++OPT = -O2 -Wno-uninitialized -ansi -pedantic
+ # C compiler and libraries
+ # vanilla sysv
+ #CC = cc
+@@ -43,22 +43,22 @@
+ #LIBS =
+ # sun solaris2 with gcc on supersparc:
+ CC = gcc
+-CFLAGS = -Wall $(OPT) -DHELPFILE=$(HELP) -msupersparc -I/usr/openwin/include
+-LDFLAGS = $(OPT) -L/usr/openwin/lib -R/usr/openwin/lib
++CFLAGS = -Wall $(OPT) -DHELPFILE=$(HELP) -I/usr/openwin/include
++LDFLAGS = $(OPT) -L/usr/X11R6/lib -lX11
+ LIBS =
+ 
+ ####### End of configurable definitions #######
+ OBJS = viewfax.o faxinput.o faxinit.o faxexpand.o
+ 
+ viewfax:	$(OBJS)
+-	$(CC) $(LDFLAGS) -o viewfax $(OBJS) -lX11 $(LIBS)
++	$(CC) $(LDFLAGS) -o viewfax $(OBJS) $(LIBS)
+ 
+ g3hack:		g3hack.c
+ 
+ install: viewfax
+ 	$(INSTALL) -s -m 755 viewfax $(BINDIR)
+ 	$(INSTALL) -m 644 viewfax.man $(MANDIR)/viewfax.1
+-	$(INSTALL) -m 644 viewfax.tif $(LIBDIR)
++	$(INSTALL) -m 644 viewfax.tif $(DOCDIR)/
+ 
+ D = viewfax-$(VERS)
+ FILES = $D/README $D/COPYING $D/ChangeLog $D/Imakefile $D/Makefile \
+@@ -75,7 +75,7 @@
+ 
+ shar:;	(cd ..; shar -a -n$D -M -sfdc@cliwe.ping.de -c -o $D/part -l64 $(FILES))
+ 
+-clean:;	$(RM) *.o *~ core
++clean:;	$(RM) *.o *~ core viewfax
+ 
+ viewfax.o:	faxexpand.h
+ faxinput.o:	faxexpand.h
--- mgetty-1.1.30.orig/debian/copyright
+++ mgetty-1.1.30/debian/copyright
@@ -0,0 +1,32 @@
+This is the Debian GNU/Linux prepackaged version of mgetty+sendfax
+Mgetty was written by Gert Doering <gert@greenie.muc.de>
+or <gert@space.net>
+
+You can find the source here:
+
+  ftp://alpha.greenie.net/pub/mgetty/source/
+
+This package was originally put together by:
+    Nils Rennebarth <nils@nus.pan-net.de>
+and was subsequently been maintained by:
+    Christoph Lameter, John Goerzen, and briefly Paul Haggart
+at which point Philip Hands <phil@hands.com> took over (Mid 1997).
+
+Since version 1.1.22, mgetty (and vgetty) is distributed under the GNU
+GPL. On Debian GNU/Linux systems, the text of the GPL can be found in
+the directory /usr/share/common-licenses/.
+
+In the frontends directories (/usr/share/doc/mgetty/frontends/...):
+  viewfax-2.5:
+    Copyright (C) 1990, 1995  Frank D. Cringle <fdc@cliwe.ping.de>
+    Distributed under the GNU GPL (see above)
+
+  faxview-0.2:
+    Copyright (C) 1994--1996 Ralph Schleicher <rs@purple.in-ulm.de>
+    Distributed under the GNU GPL (see above)
+
+  the "rs" utilities for Emacs:
+    Copyright (C) 1995 Ralph Schleicher
+    Distributed under the GNU GPL (see above)
+
+  Many others whose distribution terms are explained in their source code...
--- mgetty-1.1.30.orig/debian/mgetty-fax.preinst
+++ mgetty-1.1.30/debian/mgetty-fax.preinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+action=$1
+version=$2
+
+case $action in
+  upgrade|install )
+    if [ -n "$version" ] && dpkg --compare-versions "$version" lt 1.1.28-1
+    then
+      # Log files should go in /var/log/mgetty
+      if [ -f /var/log/acct.log ]; then
+	  echo "Moving /var/log/acct.log to /var/log/mgetty..."
+	  mv /var/log/acct.log /var/log/mgetty/
+      fi
+      if [ -f /var/log/faxrunqd.log ]; then
+	  echo "Moving /var/log/faxrunqd.log to /var/log/mgetty..."
+	  mv /var/log/faxrunqd.log /var/log/mgetty/
+      fi
+    fi
+  ;;
+esac
+
+#DEBHELPER#
+
--- mgetty-1.1.30.orig/debian/voice-defs.h
+++ mgetty-1.1.30/debian/voice-defs.h
@@ -0,0 +1,2 @@
+/* auto-generated from voice/include/default.h */
+#define VOICE_DIR "/var/spool/voice"
--- mgetty-1.1.30.orig/debian/mgetty-viewfax.postrm
+++ mgetty-1.1.30/debian/mgetty-viewfax.postrm
@@ -0,0 +1,2 @@
+#!/bin/sh
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/mgetty-fax.postrm
+++ mgetty-1.1.30/debian/mgetty-fax.postrm
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/inittab
+++ mgetty-1.1.30/debian/inittab
@@ -0,0 +1,15 @@
+# The following are examples on how to use mgetty for your modem lines.
+
+# Standard case: Full featured mgetty controlled from /etc/mgetty/mgetty.config
+#s0:23:respawn:/sbin/mgetty ttyS0
+
+# A modem that does only data. Modems often have trouble distinguishing data
+# calls from fax call. You might want to use this with those troublesome modems.
+#s1:23:respawn:/sbin/mgetty -D ttyS1
+
+# A special modem that displays a different issue file.
+#s2:23:respawn:/sbin/mgetty -i /etc/issue.special ttyS2
+
+# A modem that only supports 19200 baud and we would like it to only pick up
+# after the 4th ring.
+#s3:23:respawn:/sbin/mgetty -n4 -s19200 -D ttyS3
--- mgetty-1.1.30.orig/debian/mgetty-docs.prerm
+++ mgetty-1.1.30/debian/mgetty-docs.prerm
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+#DEBHELPER#
--- mgetty-1.1.30.orig/debian/mgetty-voice.files
+++ mgetty-1.1.30/debian/mgetty-voice.files
@@ -0,0 +1 @@
+usr/share/man/man1
--- mgetty-1.1.30.orig/debian/mgetty.postinst
+++ mgetty-1.1.30/debian/mgetty.postinst
@@ -0,0 +1,53 @@
+#!/bin/sh -e
+
+chmod 0600 /etc/mgetty/login.config
+
+case "$1" in
+    configure)
+	if [ -n "$2" ] && dpkg --compare-versions "$2" lt "1.1.27-4.1"
+	    then
+		( for pidfile in /var/run/mg-pid* /var/run/mgetty*
+		    do
+		      PID=`cat $pidfile`
+		      kill $PID
+		    done ) || true
+	fi
+
+	# Remove old style of crontab insertion if present
+	if grep -qs '^#-- mgetty begin$' /etc/crontab
+	    then
+	    TMP=/etc/crontab.tmp
+	    awk 'BEGIN {found=0}
+    /^#-- mgetty begin$/ {found = 1}
+    /^#-- mgetty end$/ {found = -1}
+    {if (!found) print}
+    {if (found == -1) found=0}
+    END {if (found) exit 1}' /etc/crontab >$TMP &&
+	    if [ -s $TMP ]
+		then
+		mv -f $TMP /etc/crontab
+	    fi
+	fi
+
+	if [ -f /etc/cron.daily/mgetty ]; then
+		rm -f /etc/cron.daily/mgetty
+	fi
+
+# Tidy up after cron.daily bug
+	if expr "$OLD_VER" : "1.[01].[0-8]-" >/dev/null
+	    then
+	    echo -n "removing debris from /var/log/mgetty ..."
+	    find /var/log/mgetty -type f -name '*.[0-9].*[0-9]*' -print0 | \
+		perl -n0e unlink
+	    echo done.
+	fi
+	;;
+    abort-upgrade|abort-remove|abort-deconfigure)
+	;;
+    *)
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0;
--- mgetty-1.1.30.orig/debian/issue.mgetty
+++ mgetty-1.1.30/debian/issue.mgetty
@@ -0,0 +1 @@
+Debian GNU/\s \P \S (\I)
--- mgetty-1.1.30.orig/debian/mgetty.logrotate
+++ mgetty-1.1.30/debian/mgetty.logrotate
@@ -0,0 +1,9 @@
+/var/log/mgetty/*.log {
+	daily
+	rotate 7
+	create 640 root adm
+	compress
+	delaycompress
+	notifempty
+	missingok
+}
