summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-dialup/mgetty
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-dialup/mgetty')
-rw-r--r--net-dialup/mgetty/Manifest1
-rw-r--r--net-dialup/mgetty/files/Lucent.c.patch17
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.36-callback.patch26
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.36-gentoo.patch170
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.36-nofax.patch110
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.36-qa-fixes.patch175
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.36-tmpfile.patch33
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.37-gentoo.patch172
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.37-nofax.patch110
-rw-r--r--net-dialup/mgetty/files/mgetty-1.1.37-qa-fixes.patch175
-rw-r--r--net-dialup/mgetty/metadata.xml11
-rw-r--r--net-dialup/mgetty/mgetty-1.1.37-r1.ebuild164
12 files changed, 1164 insertions, 0 deletions
diff --git a/net-dialup/mgetty/Manifest b/net-dialup/mgetty/Manifest
new file mode 100644
index 000000000000..6140bbf22a72
--- /dev/null
+++ b/net-dialup/mgetty/Manifest
@@ -0,0 +1 @@
+DIST mgetty1.1.37-Jun05.tar.gz 1057939 SHA256 6ff8cbc4f8aacd3dd7f247ff96715141bc6173745ea916dd98b8381a85ecdf0e SHA512 577d740c7d209b830bf8e783bf71edb666cb8bbfe8e7dceaa51dda6095d88724715394bcbd24eacfb1c377999f5779b547a7ec79cd9cdc13de6de18c4d857188 WHIRLPOOL f00d22ab213cd00f392ead46804ad1c3b192ae816b7518f1a73b4d65c180ba78fb2f193ceacf1f5aa88aeca4431eecb87e0960f0b6196a7e00247690083e937e
diff --git a/net-dialup/mgetty/files/Lucent.c.patch b/net-dialup/mgetty/files/Lucent.c.patch
new file mode 100644
index 000000000000..35b4b3e0b612
--- /dev/null
+++ b/net-dialup/mgetty/files/Lucent.c.patch
@@ -0,0 +1,17 @@
+diff -Nru mgetty-1.1.31.orig/voice/libvoice/Lucent.c mgetty-1.1.31/voice/libvoice/Lucent.c
+--- mgetty-1.1.31.orig/voice/libvoice/Lucent.c 2004-11-20 16:13:01.000000000 -0500
++++ mgetty-1.1.31/voice/libvoice/Lucent.c 2004-11-20 16:39:11.000000000 -0500
+@@ -96,6 +96,13 @@
+ if (voice_command("AT+VLS=0", "OK") != VMA_USER_1)
+ lprintf(L_WARN, "can't deselect all input/output devices");
+
++ /* the Lucent chips DO support Caller ID, this command is OK */
++ /* Just borrowed from the V253modem.c file */
++ /* enable callerid (if supported) and setformat */
++ if (voice_command("AT+VCID=1", "OK") != VMA_USER_1)
++ lprintf(L_WARN, "can't set caller ID output");
++ /* mgetty supports formated callerid output */
++
+ voice_modem_state = IDLE;
+ return(OK);
+ }
diff --git a/net-dialup/mgetty/files/mgetty-1.1.36-callback.patch b/net-dialup/mgetty/files/mgetty-1.1.36-callback.patch
new file mode 100644
index 000000000000..fcd4e0e2cd48
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.36-callback.patch
@@ -0,0 +1,26 @@
+diff -Nru mgetty-1.1.36.orig/Makefile mgetty-1.1.36/Makefile
+--- mgetty-1.1.36.orig/Makefile 2007-09-14 22:15:02.000000000 +0300
++++ mgetty-1.1.36/Makefile 2007-09-14 22:15:37.000000000 +0300
+@@ -164,7 +164,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
+@@ -693,6 +693,13 @@
+
+ install-vgetty: vgetty-install
+
++install-callback:
++ cd callback; $(MAKE) CFLAGS="$(CFLAGS)" CC="$(CC)" LDFLAGS="$(LDFLAGS)" \
++ BINDIR="$(BINDIR)" SBINDIR="$(SBINDIR)" LIBDIR="$(LIBDIR)" \
++ CONFDIR="$(CONFDIR)" MAN1DIR="$(MAN1DIR)" MAN8DIR="$(MAN8DIR)" INSTALL="$(INSTALL)" \
++ LN="$(LN)" MV="$(MV)" RM="$(RM)" \
++ LIBS="$(LIBS)" install
++
+ ## test suite
+ test: bin-all
+ for D in g3 t ; do \
diff --git a/net-dialup/mgetty/files/mgetty-1.1.36-gentoo.patch b/net-dialup/mgetty/files/mgetty-1.1.36-gentoo.patch
new file mode 100644
index 000000000000..12de205d76c7
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.36-gentoo.patch
@@ -0,0 +1,170 @@
+diff -Nru mgetty-1.1.36.orig/callback/Makefile mgetty-1.1.36/callback/Makefile
+--- mgetty-1.1.36.orig/callback/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.36/callback/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -37,7 +37,7 @@
+ # install programs
+ #
+ install: all
+- $(INSTALL) -s -m 700 -o root callback $(SBINDIR)
+- $(INSTALL) -s -m 4711 -o root ct $(BINDIR)
++ $(INSTALL) -m 700 -o root callback $(SBINDIR)
++ $(INSTALL) -m 4711 -o root ct $(BINDIR)
+
+ # source modules
+diff -Nru mgetty-1.1.36.orig/doc/mgetty.texi-in mgetty-1.1.36/doc/mgetty.texi-in
+--- mgetty-1.1.36.orig/doc/mgetty.texi-in 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.36/doc/mgetty.texi-in 2007-09-14 23:02:58.000000000 +0300
+@@ -19,6 +19,11 @@
+ Copyright @copyright{} 1993-2005 Gert Doering
+ @end ifinfo
+
++@dircategory User
++@direntry
++* MGETTY: (mgetty). Modem+Voice+Fax utilities
++@end direntry
++
+ @titlepage
+ @sp 6
+ @center @titlefont{mgetty+sendfax}
+diff -Nru mgetty-1.1.36.orig/fax/faxspool.in mgetty-1.1.36/fax/faxspool.in
+--- mgetty-1.1.36.orig/fax/faxspool.in 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.36/fax/faxspool.in 2007-09-14 23:02:58.000000000 +0300
+@@ -380,7 +380,7 @@
+
+ #
+ # convert pdf data
+-# needs GNU GhostScript and Adobe acroread installed.
++# needs GNU GhostScript installed.
+ # For driver selection, see definition of GS_DRIVER_{HI,LO} above.
+ #
+ # contributed by mfvm@gmx.de (Michael Fischer v. Mollard)
+@@ -391,7 +391,7 @@
+ test X$3 = X-n && driver="$GS_DRIVER_LO"
+
+ cat $1 |
+- acroread -toPostScript |
++ pdf2ps -sOutputFile=- - |
+ gs $driver -sOutputFile=$2%03d -dNOPAUSE -q -dSAFER -
+ }
+
+diff -Nru mgetty-1.1.36.orig/frontends/X11/viewfax/Makefile mgetty-1.1.36/frontends/X11/viewfax/Makefile
+--- mgetty-1.1.36.orig/frontends/X11/viewfax/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.36/frontends/X11/viewfax/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -61,7 +61,7 @@
+ g3hack: g3hack.c
+
+ install: viewfax
+- $(INSTALL) -s -m 755 viewfax $(BINDIR)
++ $(INSTALL) -m 755 viewfax $(BINDIR)
+ $(INSTALL) -m 644 viewfax.man $(MANDIR)/viewfax.1
+ $(INSTALL) -m 644 viewfax.tif $(LIBDIR)
+
+diff -Nru mgetty-1.1.36.orig/g3/Makefile mgetty-1.1.36/g3/Makefile
+--- mgetty-1.1.36.orig/g3/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.36/g3/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -37,13 +37,13 @@
+ # install programs
+ #
+ for f in $(G3_PROGRAMS) ; do \
+- $(INSTALL) -s -m 755 $$f $(BINDIR) ; \
++ $(INSTALL) -m 755 $$f $(BINDIR) ; \
+ done
+ #
+ # make symlink for "g3topbm" (so third-party fax viewers won't fail)
+-#
+- -cd $(BINDIR) ; \
+- test -x g3topbm || ln -s g32pbm g3topbm
++# Note for Gentoo: following lines will create collision with netpbm if netpbm is installed after
++# -cd $(BINDIR) ; \
++# test -x g3topbm || ln -s g32pbm g3topbm
+
+
+ # test suite
+diff -Nru mgetty-1.1.36.orig/Makefile mgetty-1.1.36/Makefile
+--- mgetty-1.1.36.orig/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.36/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -275,7 +275,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
+
+@@ -584,10 +584,8 @@
+ $(INSTALL) -m 755 newslock $(BINDIR)
+
+ -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 sendfax $(SBINDIR)
++ $(INSTALL) -m 700 mgetty $(SBINDIR)
++ $(INSTALL) -m 755 sendfax $(SBINDIR)
+ #
+ # data files + directories
+ #
+@@ -649,7 +647,7 @@
+ if [ ! -z "$(INSTALL_MECHO)" ] ; then \
+ cd compat ; \
+ $(CC) $(CFLAGS) -o mg.echo mg.echo.c && \
+- $(INSTALL) -s -m 755 mg.echo $(BINDIR) ; \
++ $(INSTALL) -m 755 mg.echo $(BINDIR) ; \
+ fi
+
+ #
+diff -Nru mgetty-1.1.36.orig/mgetty.cfg.in mgetty-1.1.36/mgetty.cfg.in
+--- mgetty-1.1.36.orig/mgetty.cfg.in 2003-11-17 21:09:41.000000000 +0200
++++ mgetty-1.1.36/mgetty.cfg.in 2007-09-14 23:02:58.000000000 +0300
+@@ -20,16 +20,16 @@
+ # access the modem(s) with @SPEED@ bps
+ speed @SPEED@
+
+-# use these options to make the /dev/tty-device owned by "uucp.uucp"
++# use these options to make the /dev/tty-device owned by "fax.fax"
+ # and mode "rw-rw-r--" (0664). *LEADING ZERO NEEDED!*
+-#port-owner uucp
+-#port-group uucp
++#port-owner fax
++#port-group fax
+ #port-mode 0664
+
+-# use these options to make incoming faxes owned by "root.uucp"
++# use these options to make incoming faxes owned by "root.fax"
+ # and mode "rw-r-----" (0640). *LEADING ZERO NEEDED!*
+ #fax-owner root
+-#fax-group uucp
++#fax-group fax
+ #fax-mode 0640
+
+
+diff -Nru mgetty-1.1.36.orig/voice/Makefile mgetty-1.1.36/voice/Makefile
+--- mgetty-1.1.36.orig/voice/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.36/voice/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -85,6 +85,7 @@
+ @echo ""
+ $(INSTALL) -m 700 vgetty/vgetty $(SBINDIR)
+ $(INSTALL) -m 755 vm/vm $(BINDIR)
++ $(INSTALL) -m 644 voice.conf-dist $(CONFDIR)/voice.conf
+ for i in $(PVFTOOLS); \
+ do \
+ $(INSTALL) -m 755 pvftools/$$i $(BINDIR); \
+diff -Nru mgetty-1.1.36.orig/voice/voice.conf-dist mgetty-1.1.36/voice/voice.conf-dist
+--- mgetty-1.1.36.orig/voice/voice.conf-dist 2005-03-19 18:10:20.000000000 +0200
++++ mgetty-1.1.36/voice/voice.conf-dist 2007-09-14 23:02:58.000000000 +0300
+@@ -47,11 +47,11 @@
+ voice_dir /var/spool/voice
+
+ #
+-# incoming messages are owned by "root.phone" and mode "rw-rw----" (0660)
++# incoming messages are owned by "fax:fax" and mode "rw-rw----" (0660)
+ #
+
+-phone_owner root
+-phone_group phone
++phone_owner fax
++phone_group fax
+ phone_mode 0660
+
+ #
diff --git a/net-dialup/mgetty/files/mgetty-1.1.36-nofax.patch b/net-dialup/mgetty/files/mgetty-1.1.36-nofax.patch
new file mode 100644
index 000000000000..a65f867edf64
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.36-nofax.patch
@@ -0,0 +1,110 @@
+diff -Nru mgetty-1.1.36.orig/doc/Makefile mgetty-1.1.36/doc/Makefile
+--- mgetty-1.1.36.orig/doc/Makefile 2007-11-25 09:31:56.000000000 +0200
++++ mgetty-1.1.36/doc/Makefile 2007-11-25 09:28:02.000000000 +0200
+@@ -6,11 +6,10 @@
+ NROFF=nroff
+ #
+ #
+-MAN1PAGES=g32pbm.1 g3cat.1 pbm2g3.1 sff2g3.1 fax.1 \
+- faxspool.1 faxrunq.1 faxq.1 faxrm.1 coverpg.1
++MAN1PAGES=
+ MAN4PAGES=mgettydefs.4
+-MAN5PAGES=faxqueue.5
+-MAN8PAGES=sendfax.8 mgetty.8 callback.8 faxrunqd.8 faxq-helper.8
++MAN5PAGES=
++MAN8PAGES=mgetty.8 callback.8
+ MANSRC=$(MAN1PAGES) $(MAN4PAGES) $(MAN5PAGES) $(MAN8PAGES)
+ MAN1DIR=/usr/local/man/man1
+ MAN4DIR=/usr/local/man/man4
+diff -Nru mgetty-1.1.36.orig/Makefile mgetty-1.1.36/Makefile
+--- mgetty-1.1.36.orig/Makefile 2007-11-25 09:31:58.000000000 +0200
++++ mgetty-1.1.36/Makefile 2007-11-25 09:34:45.000000000 +0200
+@@ -317,7 +317,7 @@
+
+ all: bin-all doc-all
+
+-bin-all: mgetty sendfax newslock sedscript subdirs call-back
++bin-all: mgetty newslock sedscript subdirs call-back
+
+ # a few C files need extra compiler arguments
+
+@@ -362,9 +362,7 @@
+ # subdirectories...
+
+ subdirs: sedscript
+- cd g3 ; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+ cd tools ; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+- cd fax ; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" "FAX_SPOOL_OUT=$(FAX_SPOOL_OUT)" "FAX_OUT_USER=$(FAX_OUT_USER)" "CONFDIR=$(CONFDIR)" all
+
+ call-back:
+ @$(MAKE) mgetty
+@@ -585,7 +583,6 @@
+
+ -test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
+ $(INSTALL) -m 700 mgetty $(SBINDIR)
+- $(INSTALL) -m 755 sendfax $(SBINDIR)
+ #
+ # data files + directories
+ #
+@@ -597,12 +594,8 @@
+ $(INSTALL) -o root -m 600 login.config $(CONFDIR)/
+ test -f $(CONFDIR)/mgetty.config || \
+ $(INSTALL) -o root -m 600 mgetty.config $(CONFDIR)/
+- test -f $(CONFDIR)/sendfax.config || \
+- $(INSTALL) -o root -m 644 sendfax.config $(CONFDIR)/
+ test -f $(CONFDIR)/dialin.config || \
+ $(INSTALL) -o root -m 600 dialin.config $(CONFDIR)/
+- test -f $(CONFDIR)/faxrunq.config || \
+- $(INSTALL) -o root -m 644 faxrunq.config $(CONFDIR)/
+ #
+ # test for outdated stuff
+ #
+@@ -614,34 +607,6 @@
+ echo "" ;\
+ fi
+ #
+-# fax spool directories
+-#
+- test -d $(spool) || \
+- ( ./mkidirs $(spool) && chmod 755 $(spool) )
+- test -d $(FAX_SPOOL) || \
+- ( ./mkidirs $(FAX_SPOOL) && \
+- chown $(FAX_OUT_USER) $(FAX_SPOOL) && \
+- chmod 755 $(FAX_SPOOL) )
+- test -d $(FAX_SPOOL_IN) || \
+- ( ./mkidirs $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
+- test -d $(FAX_SPOOL_OUT) || \
+- ./mkidirs $(FAX_SPOOL_OUT)
+- chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
+- chmod 755 $(FAX_SPOOL_OUT)
+-#
+-# g3 tool programs
+-#
+- cd g3 ; $(MAKE) install INSTALL="$(INSTALL)" \
+- BINDIR=$(BINDIR) \
+- LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
+-#
+-# fax programs / scripts / font file
+-#
+- cd fax ; $(MAKE) install INSTALL="$(INSTALL)" \
+- FAX_OUT_USER=$(FAX_OUT_USER) \
+- BINDIR=$(BINDIR) SBINDIR=$(SBINDIR) \
+- LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
+-#
+ # compatibility
+ #
+ if [ ! -z "$(INSTALL_MECHO)" ] ; then \
+diff -Nru mgetty-1.1.36.orig/t/Makefile mgetty-1.1.36/t/Makefile
+--- mgetty-1.1.36.orig/t/Makefile 2006-09-26 01:32:10.000000000 +0300
++++ mgetty-1.1.36/t/Makefile 2007-11-25 09:32:28.000000000 +0200
+@@ -8,8 +8,8 @@
+ CFLAGS=-O2 -I.. -g #-DT_LOG_VERBOSE
+
+ TEST_PROGRAMS=t_config t_ring
+-TEST_HELP_PGM=t_g3f_c
+-TEST_SCRIPTS=t_echo t_trap t_g3file
++TEST_HELP_PGM=
++TEST_SCRIPTS=t_echo t_trap
+
+ test: $(TEST_PROGRAMS) $(TEST_HELP_PGM)
+ @for f in $(TEST_PROGRAMS) ; \
diff --git a/net-dialup/mgetty/files/mgetty-1.1.36-qa-fixes.patch b/net-dialup/mgetty/files/mgetty-1.1.36-qa-fixes.patch
new file mode 100644
index 000000000000..69ae072fd696
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.36-qa-fixes.patch
@@ -0,0 +1,175 @@
+diff -Nru mgetty-1.1.36.orig/doc/Makefile mgetty-1.1.36/doc/Makefile
+--- mgetty-1.1.36.orig/doc/Makefile 2006-02-22 18:35:02.000000000 +0100
++++ mgetty-1.1.36/doc/Makefile 2009-08-31 20:31:01.000000000 +0200
+@@ -63,7 +63,7 @@
+ *.man *.[1-9] mgetty.texi
+
+ install: $(MANSRC) mgetty.info
+- -mkdir `dirname $(MAN1DIR)` $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR) 2>/dev/null
++ mkdir -p $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR)
+ for i in $(MAN1PAGES) ; do \
+ $(INSTALL) -m 644 $$i $(MAN1DIR) ; \
+ done
+@@ -120,16 +120,16 @@
+ #
+ .SUFFIXES: .1in .4in .5in .8in .1 .4 .5 .8
+
+-.1in.1:
++.1in.1: ../sedscript
+ ../sedscript <$< >$*.1
+
+-.4in.4:
++.4in.4: ../sedscript
+ ../sedscript <$< >$*.4
+
+-.5in.5:
++.5in.5: ../sedscript
+ ../sedscript <$< >$*.5
+
+-.8in.8:
++.8in.8: ../sedscript
+ ../sedscript <$< >$*.8
+
+ #
+diff -Nru mgetty-1.1.36.orig/fax/Makefile mgetty-1.1.36/fax/Makefile
+--- mgetty-1.1.36.orig/fax/Makefile 2006-02-22 18:25:30.000000000 +0100
++++ mgetty-1.1.36/fax/Makefile 2009-08-31 20:31:01.000000000 +0200
+@@ -36,7 +36,7 @@
+ @cd .. ; $(MAKE) sedscript
+
+ faxq-helper: faxq-helper.o
+- $(CC) $(CFLAGS) -o faxq-helper faxq-helper.o
++ $(CC) $(LDLAGS) -o faxq-helper faxq-helper.o
+
+ faxq-helper.o: faxq-helper.c ../sedscript
+ $(CC) $(CFLAGS) -DFAX_SPOOL_OUT=\"$(FAX_SPOOL_OUT)\" \
+diff -Nru mgetty-1.1.36.orig/fax_lib.h mgetty-1.1.36/fax_lib.h
+--- mgetty-1.1.36.orig/fax_lib.h 2007-06-15 08:44:36.000000000 +0200
++++ mgetty-1.1.36/fax_lib.h 2009-08-31 20:31:01.000000000 +0200
+@@ -41,6 +41,7 @@
+ int fax_set_fdcc _PROTO(( int fd, int fine, int maxsp, int minsp ));
+ int fax_set_bor _PROTO(( int fd, int bit_order ));
+ int fax_set_flowcontrol _PROTO(( int fd, int hw_flow ));
++void fax_init_swaptable _PROTO(( int direct, unsigned char byte_tab[] ));
+ int mdm_identify _PROTO(( int fd ));
+ void fax2_incoming_nsf _PROTO(( char * nsf_hex ));
+ void fax1_incoming_nsf _PROTO(( uch * nsf_bin, int len ));
+diff -Nru mgetty-1.1.36.orig/frontends/www/Makefile mgetty-1.1.36/frontends/www/Makefile
+--- mgetty-1.1.36.orig/frontends/www/Makefile 2006-02-22 18:25:32.000000000 +0100
++++ mgetty-1.1.36/frontends/www/Makefile 2009-08-31 20:31:01.000000000 +0200
+@@ -125,12 +125,12 @@
+ #
+ .SUFFIXES: .in .cgi .html
+
+-.in.cgi:
++.in.cgi: ../../sedscript
+ rm -f $*.cgi
+ ../../sedscript <$< >$*.cgi
+ chmod +x $*.cgi
+
+-.in.html:
++.in.html: ../../sedscript
+ rm -f $*.html
+ ../../sedscript <$< | \
+ sed -e "s!@CGI_HREF@!$(CGI_HREF)!" >$*.html
+diff -Nru mgetty-1.1.36.orig/logfile.c mgetty-1.1.36/logfile.c
+--- mgetty-1.1.36.orig/logfile.c 2005-11-26 14:48:16.000000000 +0100
++++ mgetty-1.1.36/logfile.c 2009-08-31 20:31:01.000000000 +0200
+@@ -58,10 +58,10 @@
+ /* Most systems have these variables but do not declare them. On many
+ of those systems that _do_ declare them, it won't hurt */
+
+-#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
++/*#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
+ extern int sys_nerr;
+ extern char *sys_errlist[];
+-#endif
++#endif*/
+
+ /* Interactive Unix is a little bit braindead - does not have atexit(),
+ */
+@@ -211,6 +211,7 @@
+ va_list pvar;
+ int errnr;
+ char * p;
++char *error_string;
+ static int first_open = TRUE;
+
+ if ( level > log_level ) /* log level high enough? */
+@@ -327,12 +328,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
+diff -Nru mgetty-1.1.36.orig/Makefile mgetty-1.1.36/Makefile
+--- mgetty-1.1.36.orig/Makefile 2009-08-31 20:30:33.000000000 +0200
++++ mgetty-1.1.36/Makefile 2009-08-31 20:32:08.000000000 +0200
+@@ -361,7 +361,7 @@
+
+ # subdirectories...
+
+-subdirs:
++subdirs: sedscript
+ cd g3 ; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+ cd tools ; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+ cd fax ; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" "FAX_SPOOL_OUT=$(FAX_SPOOL_OUT)" "FAX_OUT_USER=$(FAX_OUT_USER)" "CONFDIR=$(CONFDIR)" all
+@@ -617,15 +617,15 @@
+ # fax spool directories
+ #
+ test -d $(spool) || \
+- ( mkdir $(spool) && chmod 755 $(spool) )
++ ( ./mkidirs $(spool) && chmod 755 $(spool) )
+ test -d $(FAX_SPOOL) || \
+- ( mkdir $(FAX_SPOOL) && \
++ ( ./mkidirs $(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) )
++ ( ./mkidirs $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
+ test -d $(FAX_SPOOL_OUT) || \
+- mkdir $(FAX_SPOOL_OUT)
++ ./mkidirs $(FAX_SPOOL_OUT)
+ chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
+ chmod 755 $(FAX_SPOOL_OUT)
+ #
+diff -Nru mgetty-1.1.36.orig/t/t_g3f_c.c mgetty-1.1.36/t/t_g3f_c.c
+--- mgetty-1.1.36.orig/t/t_g3f_c.c 2007-05-05 14:03:03.000000000 +0200
++++ mgetty-1.1.36/t/t_g3f_c.c 2009-08-31 20:31:01.000000000 +0200
+@@ -19,6 +19,7 @@
+ #include "fax_lib.h"
+
+ #include <stdio.h>
++#include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+ #include <stdlib.h>
+diff -Nru mgetty-1.1.36.orig/t/t_ring.c mgetty-1.1.36/t/t_ring.c
+--- mgetty-1.1.36.orig/t/t_ring.c 2005-03-23 10:56:21.000000000 +0100
++++ mgetty-1.1.36/t/t_ring.c 2009-08-31 20:31:01.000000000 +0200
+@@ -24,6 +24,7 @@
+
+ #include "mgetty.h"
+ #include <stdio.h>
++#include <string.h>
+ #include <signal.h>
+ #include <errno.h>
+ #ifdef T_LOG_VERBOSE
diff --git a/net-dialup/mgetty/files/mgetty-1.1.36-tmpfile.patch b/net-dialup/mgetty/files/mgetty-1.1.36-tmpfile.patch
new file mode 100644
index 000000000000..68f6f58868d7
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.36-tmpfile.patch
@@ -0,0 +1,33 @@
+diff -Nru mgetty-1.1.36.orig/fax/faxspool.in mgetty-1.1.36/fax/faxspool.in
+--- mgetty-1.1.36.orig/fax/faxspool.in 2008-12-09 23:12:31.000000000 +0000
++++ mgetty-1.1.36/fax/faxspool.in 2008-12-09 23:13:28.000000000 +0000
+@@ -675,9 +675,8 @@
+ if [ x$file = x- ]
+ then
+ $echo "spooling $file (stdin)..."
+- trap "rm /tmp/faxsp.$$" 0
+- cat - >/tmp/faxsp.$$
+- file=/tmp/faxsp.$$
++ file=$spooldir/faxsp
++ cat - > $file
+ else
+ $echo "spooling $file..."
+ fi
+@@ -924,7 +923,7 @@
+ then
+ $echo "\nnothing to do (no cover page, no data)." >&2
+ cd $FAX_SPOOL_OUT
+- rmdir $spooldir
++ rm -rf $spooldir
+ exit 52
+ fi
+
+@@ -965,7 +964,7 @@
+ # clean up
+ rm $job.q
+ cd ..
+-rmdir $spooldir
++rm -rf $spooldir
+
+ if [ -z "`find $LAST_RUN -ctime -1 -print 2>/dev/null`" ]
+ then
diff --git a/net-dialup/mgetty/files/mgetty-1.1.37-gentoo.patch b/net-dialup/mgetty/files/mgetty-1.1.37-gentoo.patch
new file mode 100644
index 000000000000..8f0c004d6011
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.37-gentoo.patch
@@ -0,0 +1,172 @@
+diff -Nru mgetty-1.1.37.orig/callback/Makefile mgetty-1.1.37/callback/Makefile
+--- mgetty-1.1.37.orig/callback/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.37/callback/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -37,7 +37,7 @@
+ # install programs
+ #
+ install: all
+- $(INSTALL) -s -m 700 -o root callback $(SBINDIR)
+- $(INSTALL) -s -m 4711 -o root ct $(BINDIR)
++ $(INSTALL) -m 700 -o root callback $(SBINDIR)
++ $(INSTALL) -m 4711 -o root ct $(BINDIR)
+
+ # source modules
+diff -Nru mgetty-1.1.37.orig/doc/mgetty.texi-in mgetty-1.1.37/doc/mgetty.texi-in
+--- mgetty-1.1.37.orig/doc/mgetty.texi-in 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.37/doc/mgetty.texi-in 2007-09-14 23:02:58.000000000 +0300
+@@ -19,6 +19,11 @@
+ Copyright @copyright{} 1993-2005 Gert Doering
+ @end ifinfo
+
++@dircategory User
++@direntry
++* MGETTY: (mgetty). Modem+Voice+Fax utilities
++@end direntry
++
+ @titlepage
+ @sp 6
+ @center @titlefont{mgetty+sendfax}
+diff -Nru mgetty-1.1.37.orig/fax/faxspool.in mgetty-1.1.37/fax/faxspool.in
+--- mgetty-1.1.37.orig/fax/faxspool.in 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.37/fax/faxspool.in 2007-09-14 23:02:58.000000000 +0300
+@@ -390,7 +390,7 @@
+
+ #
+ # convert pdf data
+-# needs GNU GhostScript and Adobe acroread installed.
++# needs GNU GhostScript installed.
+ # For driver selection, see definition of GS_DRIVER_{HI,LO} above.
+ #
+ # contributed by mfvm@gmx.de (Michael Fischer v. Mollard)
+@@ -401,7 +401,7 @@
+ test X$3 = X-n && driver="$GS_DRIVER_LO"
+
+ cat $1 |
+- acroread -toPostScript |
++ pdf2ps -sOutputFile=- - |
+ gs $driver -sOutputFile=$2%03d -dNOPAUSE -q -dSAFER -
+ }
+
+diff -Nru mgetty-1.1.37.orig/frontends/X11/viewfax/Makefile mgetty-1.1.37/frontends/X11/viewfax/Makefile
+--- mgetty-1.1.37.orig/frontends/X11/viewfax/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.37/frontends/X11/viewfax/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -61,7 +61,7 @@
+ g3hack: g3hack.c
+
+ install: viewfax
+- $(INSTALL) -s -m 755 viewfax $(BINDIR)
++ $(INSTALL) -m 755 viewfax $(BINDIR)
+ $(INSTALL) -m 644 viewfax.man $(MANDIR)/viewfax.1
+ $(INSTALL) -m 644 viewfax.tif $(LIBDIR)
+
+diff -Nru mgetty-1.1.37.orig/g3/Makefile mgetty-1.1.37/g3/Makefile
+--- mgetty-1.1.37.orig/g3/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.37/g3/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -37,13 +37,13 @@
+ # install programs
+ #
+ for f in $(G3_PROGRAMS) ; do \
+- $(INSTALL) -s -m 755 $$f $(BINDIR) ; \
++ $(INSTALL) -m 755 $$f $(BINDIR) ; \
+ done
+ #
+ # make symlink for "g3topbm" (so third-party fax viewers won't fail)
+-#
+- -cd $(BINDIR) ; \
+- test -x g3topbm || ln -s g32pbm g3topbm
++# Note for Gentoo: following lines will create collision with netpbm if netpbm is installed after
++# -cd $(BINDIR) ; \
++# test -x g3topbm || ln -s g32pbm g3topbm
+
+
+ # test suite
+diff -Nru mgetty-1.1.37.orig/Makefile mgetty-1.1.37/Makefile
+--- mgetty-1.1.37.orig/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.37/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -282,7 +282,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
+
+@@ -596,12 +596,8 @@
+ $(INSTALL) -m 755 newslock $(BINDIR)
+
+ -test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
+- if [ -f $(SBINDIR)/mgetty ] ; then \
+- mv -f $(SBINDIR)/mgetty $(SBINDIR)/mgetty.old ; fi
+- if [ -f $(SBINDIR)/sendfax ] ; then \
+- mv -f $(SBINDIR)/sendfax $(SBINDIR)/sendfax.old ; fi
+- $(INSTALL) -s -m 700 mgetty $(SBINDIR)
+- $(INSTALL) -s -m 755 sendfax $(SBINDIR)
++ $(INSTALL) -m 700 mgetty $(SBINDIR)
++ $(INSTALL) -m 755 sendfax $(SBINDIR)
+ #
+ # data files + directories
+ #
+@@ -663,7 +661,7 @@
+ if [ ! -z "$(INSTALL_MECHO)" ] ; then \
+ cd compat ; \
+ $(CC) $(CFLAGS) -o mg.echo mg.echo.c && \
+- $(INSTALL) -s -m 755 mg.echo $(BINDIR) ; \
++ $(INSTALL) -m 755 mg.echo $(BINDIR) ; \
+ fi
+
+ #
+diff -Nru mgetty-1.1.37.orig/mgetty.cfg.in mgetty-1.1.37/mgetty.cfg.in
+--- mgetty-1.1.37.orig/mgetty.cfg.in 2003-11-17 21:09:41.000000000 +0200
++++ mgetty-1.1.37/mgetty.cfg.in 2007-09-14 23:02:58.000000000 +0300
+@@ -20,16 +20,16 @@
+ # access the modem(s) with @SPEED@ bps
+ speed @SPEED@
+
+-# use these options to make the /dev/tty-device owned by "uucp.uucp"
++# use these options to make the /dev/tty-device owned by "fax.fax"
+ # and mode "rw-rw-r--" (0664). *LEADING ZERO NEEDED!*
+-#port-owner uucp
+-#port-group uucp
++#port-owner fax
++#port-group fax
+ #port-mode 0664
+
+-# use these options to make incoming faxes owned by "root.uucp"
++# use these options to make incoming faxes owned by "root.fax"
+ # and mode "rw-r-----" (0640). *LEADING ZERO NEEDED!*
+ #fax-owner root
+-#fax-group uucp
++#fax-group fax
+ #fax-mode 0640
+
+
+diff -Nru mgetty-1.1.37.orig/voice/Makefile mgetty-1.1.37/voice/Makefile
+--- mgetty-1.1.37.orig/voice/Makefile 2007-09-14 23:03:32.000000000 +0300
++++ mgetty-1.1.37/voice/Makefile 2007-09-14 23:02:58.000000000 +0300
+@@ -85,6 +85,7 @@
+ @echo ""
+ $(INSTALL) -m 700 vgetty/vgetty $(SBINDIR)
+ $(INSTALL) -m 755 vm/vm $(BINDIR)
++ $(INSTALL) -m 644 voice.conf-dist $(CONFDIR)/voice.conf
+ for i in $(PVFTOOLS); \
+ do \
+ $(INSTALL) -m 755 pvftools/$$i $(BINDIR); \
+diff -Nru mgetty-1.1.37.orig/voice/voice.conf-dist mgetty-1.1.37/voice/voice.conf-dist
+--- mgetty-1.1.37.orig/voice/voice.conf-dist 2005-03-19 18:10:20.000000000 +0200
++++ mgetty-1.1.37/voice/voice.conf-dist 2007-09-14 23:02:58.000000000 +0300
+@@ -47,11 +47,11 @@
+ voice_dir /var/spool/voice
+
+ #
+-# incoming messages are owned by "root.phone" and mode "rw-rw----" (0660)
++# incoming messages are owned by "fax:fax" and mode "rw-rw----" (0660)
+ #
+
+-phone_owner root
+-phone_group phone
++phone_owner fax
++phone_group fax
+ phone_mode 0660
+
+ #
diff --git a/net-dialup/mgetty/files/mgetty-1.1.37-nofax.patch b/net-dialup/mgetty/files/mgetty-1.1.37-nofax.patch
new file mode 100644
index 000000000000..6636526b691e
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.37-nofax.patch
@@ -0,0 +1,110 @@
+diff -Nru mgetty-1.1.37.orig/doc/Makefile mgetty-1.1.37/doc/Makefile
+--- mgetty-1.1.37.orig/doc/Makefile 2007-11-25 09:31:56.000000000 +0200
++++ mgetty-1.1.37/doc/Makefile 2007-11-25 09:28:02.000000000 +0200
+@@ -6,11 +6,10 @@
+ NROFF=nroff
+ #
+ #
+-MAN1PAGES=g32pbm.1 g3cat.1 pbm2g3.1 sff2g3.1 fax.1 \
+- faxspool.1 faxrunq.1 faxq.1 faxrm.1 coverpg.1
++MAN1PAGES=
+ MAN4PAGES=mgettydefs.4
+-MAN5PAGES=faxqueue.5
+-MAN8PAGES=sendfax.8 mgetty.8 callback.8 faxrunqd.8 faxq-helper.8
++MAN5PAGES=
++MAN8PAGES=mgetty.8 callback.8
+ MANSRC=$(MAN1PAGES) $(MAN4PAGES) $(MAN5PAGES) $(MAN8PAGES)
+ MAN1DIR=/usr/local/man/man1
+ MAN4DIR=/usr/local/man/man4
+diff -Nru mgetty-1.1.37.orig/Makefile mgetty-1.1.37/Makefile
+--- mgetty-1.1.37.orig/Makefile 2007-11-25 09:31:58.000000000 +0200
++++ mgetty-1.1.37/Makefile 2007-11-25 09:34:45.000000000 +0200
+@@ -324,7 +324,7 @@
+
+ all: bin-all doc-man-only
+
+-bin-all: mgetty sendfax newslock sedscript subdirs call-back
++bin-all: mgetty newslock sedscript subdirs call-back
+
+ # a few C files need extra compiler arguments
+
+@@ -369,9 +369,7 @@
+ # subdirectories...
+
+ subdirs: sedscript
+- cd g3 && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+ cd tools && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+- cd fax && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" "FAX_SPOOL_OUT=$(FAX_SPOOL_OUT)" "FAX_OUT_USER=$(FAX_OUT_USER)" "CONFDIR=$(CONFDIR)" all
+
+ call-back:
+ @$(MAKE) mgetty
+@@ -597,7 +595,6 @@
+
+ -test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
+ $(INSTALL) -m 700 mgetty $(SBINDIR)
+- $(INSTALL) -m 755 sendfax $(SBINDIR)
+ #
+ # data files + directories
+ #
+@@ -609,12 +606,8 @@
+ $(INSTALL) -o root -m 600 login.config $(CONFDIR)/
+ test -f $(CONFDIR)/mgetty.config || \
+ $(INSTALL) -o root -m 600 mgetty.config $(CONFDIR)/
+- test -f $(CONFDIR)/sendfax.config || \
+- $(INSTALL) -o root -m 644 sendfax.config $(CONFDIR)/
+ test -f $(CONFDIR)/dialin.config || \
+ $(INSTALL) -o root -m 600 dialin.config $(CONFDIR)/
+- test -f $(CONFDIR)/faxrunq.config || \
+- $(INSTALL) -o root -m 644 faxrunq.config $(CONFDIR)/
+ #
+ # test for outdated stuff
+ #
+@@ -626,34 +626,6 @@
+ echo "" ;\
+ fi
+ #
+-# fax spool directories
+-#
+- test -d $(spool) || \
+- ( ./mkidirs $(spool) && chmod 755 $(spool) )
+- test -d $(FAX_SPOOL) || \
+- ( ./mkidirs $(FAX_SPOOL) && \
+- chown $(FAX_OUT_USER) $(FAX_SPOOL) && \
+- chmod 755 $(FAX_SPOOL) )
+- test -d $(FAX_SPOOL_IN) || \
+- ( ./mkidirs $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
+- test -d $(FAX_SPOOL_OUT) || \
+- ./mkidirs $(FAX_SPOOL_OUT)
+- chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
+- chmod 755 $(FAX_SPOOL_OUT)
+-#
+-# g3 tool programs
+-#
+- cd g3 && $(MAKE) install INSTALL="$(INSTALL)" \
+- BINDIR=$(BINDIR) \
+- LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
+-#
+-# fax programs / scripts / font file
+-#
+- cd fax && $(MAKE) install INSTALL="$(INSTALL)" \
+- FAX_OUT_USER=$(FAX_OUT_USER) \
+- BINDIR=$(BINDIR) SBINDIR=$(SBINDIR) \
+- LIBDIR=$(LIBDIR) CONFDIR=$(CONFDIR)
+-#
+ # compatibility
+ #
+ if [ ! -z "$(INSTALL_MECHO)" ] ; then \
+diff -Nru mgetty-1.1.37.orig/t/Makefile mgetty-1.1.37/t/Makefile
+--- mgetty-1.1.37.orig/t/Makefile 2006-09-26 01:32:10.000000000 +0300
++++ mgetty-1.1.37/t/Makefile 2007-11-25 09:32:28.000000000 +0200
+@@ -8,8 +8,8 @@
+ CFLAGS=-O2 -I.. -g #-DT_LOG_VERBOSE
+
+ TEST_PROGRAMS=t_config t_ring
+-TEST_HELP_PGM=t_g3f_c
+-TEST_SCRIPTS=t_echo t_trap t_g3file
++TEST_HELP_PGM=
++TEST_SCRIPTS=t_echo t_trap
+
+ test: $(TEST_PROGRAMS) $(TEST_HELP_PGM)
+ @for f in $(TEST_PROGRAMS) ; \
diff --git a/net-dialup/mgetty/files/mgetty-1.1.37-qa-fixes.patch b/net-dialup/mgetty/files/mgetty-1.1.37-qa-fixes.patch
new file mode 100644
index 000000000000..e803b4243155
--- /dev/null
+++ b/net-dialup/mgetty/files/mgetty-1.1.37-qa-fixes.patch
@@ -0,0 +1,175 @@
+diff -Nru mgetty-1.1.37.orig/doc/Makefile mgetty-1.1.37/doc/Makefile
+--- mgetty-1.1.37.orig/doc/Makefile 2006-02-22 18:35:02.000000000 +0100
++++ mgetty-1.1.37/doc/Makefile 2009-08-31 20:31:01.000000000 +0200
+@@ -64,7 +64,7 @@
+
+ install: $(MANSRC) mgetty.info
+ for D in `dirname $(MAN1DIR)` $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR) ; do \
+- if [ ! -d $$D ] ; then mkdir $$D || exit 1 ; fi ; \
++ if [ ! -d $$D ] ; then mkdir -p $$D || exit 1 ; fi ; \
+ done
+ for i in $(MAN1PAGES) ; do \
+ $(INSTALL) -m 644 $$i $(MAN1DIR) ; \
+@@ -122,16 +122,16 @@
+ #
+ .SUFFIXES: .1in .4in .5in .8in .1 .4 .5 .8
+
+-.1in.1:
++.1in.1: ../sedscript
+ ../sedscript <$< >$*.1
+
+-.4in.4:
++.4in.4: ../sedscript
+ ../sedscript <$< >$*.4
+
+-.5in.5:
++.5in.5: ../sedscript
+ ../sedscript <$< >$*.5
+
+-.8in.8:
++.8in.8: ../sedscript
+ ../sedscript <$< >$*.8
+
+ #
+diff -Nru mgetty-1.1.37.orig/fax/Makefile mgetty-1.1.37/fax/Makefile
+--- mgetty-1.1.37.orig/fax/Makefile 2006-02-22 18:25:30.000000000 +0100
++++ mgetty-1.1.37/fax/Makefile 2009-08-31 20:31:01.000000000 +0200
+@@ -36,7 +36,7 @@
+ @cd .. ; $(MAKE) sedscript
+
+ faxq-helper: faxq-helper.o
+- $(CC) $(CFLAGS) -o faxq-helper faxq-helper.o
++ $(CC) $(LDLAGS) -o faxq-helper faxq-helper.o
+
+ faxq-helper.o: faxq-helper.c ../sedscript
+ $(CC) $(CFLAGS) -DFAX_SPOOL_OUT=\"$(FAX_SPOOL_OUT)\" \
+diff -Nru mgetty-1.1.37.orig/fax_lib.h mgetty-1.1.37/fax_lib.h
+--- mgetty-1.1.37.orig/fax_lib.h 2007-06-15 08:44:36.000000000 +0200
++++ mgetty-1.1.37/fax_lib.h 2009-08-31 20:31:01.000000000 +0200
+@@ -41,6 +41,7 @@
+ int fax_set_fdcc _PROTO(( int fd, int fine, int maxsp, int minsp ));
+ int fax_set_bor _PROTO(( int fd, int bit_order ));
+ int fax_set_flowcontrol _PROTO(( int fd, int hw_flow ));
++void fax_init_swaptable _PROTO(( int direct, unsigned char byte_tab[] ));
+ int mdm_identify _PROTO(( int fd ));
+ void fax2_incoming_nsf _PROTO(( char * nsf_hex ));
+ void fax1_incoming_nsf _PROTO(( uch * nsf_bin, int len ));
+diff -Nru mgetty-1.1.37.orig/frontends/www/Makefile mgetty-1.1.37/frontends/www/Makefile
+--- mgetty-1.1.37.orig/frontends/www/Makefile 2006-02-22 18:25:32.000000000 +0100
++++ mgetty-1.1.37/frontends/www/Makefile 2009-08-31 20:31:01.000000000 +0200
+@@ -125,12 +125,12 @@
+ #
+ .SUFFIXES: .in .cgi .html
+
+-.in.cgi:
++.in.cgi: ../../sedscript
+ rm -f $*.cgi
+ ../../sedscript <$< >$*.cgi
+ chmod +x $*.cgi
+
+-.in.html:
++.in.html: ../../sedscript
+ rm -f $*.html
+ ../../sedscript <$< | \
+ sed -e "s!@CGI_HREF@!$(CGI_HREF)!" >$*.html
+diff -Nru mgetty-1.1.37.orig/logfile.c mgetty-1.1.37/logfile.c
+--- mgetty-1.1.37.orig/logfile.c 2005-11-26 14:48:16.000000000 +0100
++++ mgetty-1.1.37/logfile.c 2009-08-31 20:31:01.000000000 +0200
+@@ -58,10 +58,10 @@
+ /* Most systems have these variables but do not declare them. On many
+ of those systems that _do_ declare them, it won't hurt */
+
+-#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
++/*#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
+ extern int sys_nerr;
+ extern char *sys_errlist[];
+-#endif
++#endif*/
+
+ /* Interactive Unix is a little bit braindead - does not have atexit(),
+ */
+@@ -211,6 +211,7 @@
+ va_list pvar;
+ int errnr;
+ char * p;
++char *error_string;
+ static int first_open = TRUE;
+
+ if ( level > log_level ) /* log level high enough? */
+@@ -327,12 +328,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
+diff -Nru mgetty-1.1.37.orig/Makefile mgetty-1.1.37/Makefile
+--- mgetty-1.1.37.orig/Makefile 2009-08-31 20:30:33.000000000 +0200
++++ mgetty-1.1.37/Makefile 2009-08-31 20:32:08.000000000 +0200
+@@ -368,7 +368,7 @@
+
+ # subdirectories...
+
+-subdirs:
++subdirs: sedscript
+ cd g3 && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+ cd tools && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" all
+ cd fax && $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS) -I.." "LDFLAGS=$(LDFLAGS)" "LIBS=$(LIBS)" "FAX_SPOOL_OUT=$(FAX_SPOOL_OUT)" "FAX_OUT_USER=$(FAX_OUT_USER)" "CONFDIR=$(CONFDIR)" all
+@@ -633,15 +633,15 @@
+ # fax spool directories
+ #
+ test -d $(spool) || \
+- ( mkdir $(spool) && chmod 755 $(spool) )
++ ( ./mkidirs $(spool) && chmod 755 $(spool) )
+ test -d $(FAX_SPOOL) || \
+- ( mkdir $(FAX_SPOOL) && \
++ ( ./mkidirs $(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) )
++ ( ./mkidirs $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
+ test -d $(FAX_SPOOL_OUT) || \
+- mkdir $(FAX_SPOOL_OUT)
++ ./mkidirs $(FAX_SPOOL_OUT)
+ chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
+ chmod 755 $(FAX_SPOOL_OUT)
+ #
+diff -Nru mgetty-1.1.37.orig/t/t_g3f_c.c mgetty-1.1.37/t/t_g3f_c.c
+--- mgetty-1.1.37.orig/t/t_g3f_c.c 2007-05-05 14:03:03.000000000 +0200
++++ mgetty-1.1.37/t/t_g3f_c.c 2009-08-31 20:31:01.000000000 +0200
+@@ -19,6 +19,7 @@
+ #include "fax_lib.h"
+
+ #include <stdio.h>
++#include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+ #include <stdlib.h>
+diff -Nru mgetty-1.1.37.orig/t/t_ring.c mgetty-1.1.37/t/t_ring.c
+--- mgetty-1.1.37.orig/t/t_ring.c 2005-03-23 10:56:21.000000000 +0100
++++ mgetty-1.1.37/t/t_ring.c 2009-08-31 20:31:01.000000000 +0200
+@@ -24,6 +24,7 @@
+
+ #include "mgetty.h"
+ #include <stdio.h>
++#include <string.h>
+ #include <signal.h>
+ #include <errno.h>
+ #ifdef T_LOG_VERBOSE
diff --git a/net-dialup/mgetty/metadata.xml b/net-dialup/mgetty/metadata.xml
new file mode 100644
index 000000000000..54960dabdfbf
--- /dev/null
+++ b/net-dialup/mgetty/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-dialup</herd>
+<longdescription>Suite of programs that allows you to take full advantage of your voice/fax modem.
+mgetty is capable of handling data, fax and voice calls without interfering with outgoing calls.</longdescription>
+<use>
+ <flag name='fax'>Enables fax support</flag>
+ <flag name='fidonet'>Enables FidoNet support</flag>
+</use>
+</pkgmetadata>
diff --git a/net-dialup/mgetty/mgetty-1.1.37-r1.ebuild b/net-dialup/mgetty/mgetty-1.1.37-r1.ebuild
new file mode 100644
index 000000000000..eca4b48304df
--- /dev/null
+++ b/net-dialup/mgetty/mgetty-1.1.37-r1.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic toolchain-funcs user
+
+DESCRIPTION="fax and voice modem programs"
+SRC_URI="ftp://mgetty.greenie.net/pub/mgetty/source/1.1/${PN}${PV}-Jun05.tar.gz"
+HOMEPAGE="http://mgetty.greenie.net/"
+
+DEPEND="doc? ( virtual/latex-base virtual/texi2dvi )
+ >=sys-apps/sed-4
+ sys-apps/groff
+ dev-lang/perl
+ sys-apps/texinfo
+ virtual/awk
+ fax? (
+ !net-misc/efax
+ !net-misc/hylafax
+ )"
+RDEPEND="${DEPEND}
+ fax? ( media-libs/netpbm app-text/ghostscript-gpl )"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ~ppc64 sparc x86"
+IUSE="doc +fax fidonet"
+
+pkg_setup() {
+ enewgroup fax
+ enewuser fax -1 -1 /dev/null fax
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-gentoo.patch"
+ epatch "${FILESDIR}/${P}-qa-fixes.patch"
+ epatch "${FILESDIR}/${PN}-1.1.36-callback.patch" # add callback install to Makefile
+ epatch "${FILESDIR}/Lucent.c.patch" # Lucent modem CallerID patch - bug #80366
+ use fax || epatch "${FILESDIR}/${P}-nofax.patch" # don't install fax related files - bug #195467
+ epatch "${FILESDIR}/${PN}-1.1.36-tmpfile.patch" # fix security bug 235806
+
+ sed -e 's:var/log/mgetty:var/log/mgetty/mgetty:' \
+ -e 's:var/log/sendfax:var/log/mgetty/sendfax:' \
+ -e 's:\/\* \(\#define CNDFILE "dialin.config"\) \*\/:\1:' \
+ -e 's:\(\#define FAX_NOTIFY_PROGRAM\).*:\1 "/etc/mgetty+sendfax/new_fax":' \
+ policy.h-dist > policy.h || die 'creating policy.h failed'
+
+ sed -i -e 's:/usr/local/lib/mgetty+sendfax:/etc/mgetty+sendfax:' faxrunq.config || die 'changing mgetty config dir failed'
+ sed -i -e 's:/usr/local/bin/g3cat:/usr/bin/g3cat:' faxrunq.config fax/faxspool.rules || die 'changing g3cat path failed'
+
+ sed -e "/^doc-all:/s/mgetty.asc mgetty.info mgetty.dvi mgetty.ps/mgetty.info/" \
+ -i doc/Makefile || die 'first sed on doc/Makefile failed'
+ if use doc; then
+ sed -i \
+ -e "s/^doc-all:/doc-all: mgetty.ps/" \
+ -e "s/^all:/all: doc-all/" \
+ doc/Makefile || die 'second sed on doc/Makefile failed'
+ fi
+
+ # Support user's CFLAGS and LDFLAGS.
+ sed -e "s/\$(CFLAGS) -o newslock/${CFLAGS} ${LDFLAGS} -Wall -o newslock/" \
+ -e "s/\$(LDLAGS)/${LDFLAGS}/" -i {,fax/}Makefile || die
+}
+
+src_compile() {
+ use fidonet && append-cppflags "-DFIDO"
+ append-cppflags "-DAUTO_PPP"
+ # bug #299421
+ VARTEXFONTS="${T}"/fonts emake -j1 prefix=/usr \
+ CC="$(tc-getCC)" \
+ CONFDIR=/etc/mgetty+sendfax \
+ CFLAGS="${CFLAGS} ${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ all vgetty
+}
+
+src_install () {
+ # parallelization issue: vgetty-install target fails if install target
+ # isn't finished
+ local targets
+ for targets in install "vgetty-install install-callback"; do
+ emake prefix="${D}/usr" \
+ INFODIR="${D}/usr/share/info" \
+ CONFDIR="${D}/etc/mgetty+sendfax" \
+ MAN1DIR="${D}/usr/share/man/man1" \
+ MAN4DIR="${D}/usr/share/man/man4" \
+ MAN5DIR="${D}/usr/share/man/man5" \
+ MAN8DIR="${D}/usr/share/man/man8" \
+ SBINDIR="${D}/usr/sbin" \
+ BINDIR="${D}/usr/bin" \
+ VOICE_DIR="${D}/var/spool/voice" \
+ PHONE_GROUP=fax \
+ PHONE_PERMS=755 \
+ spool="${D}/var/spool" \
+ ${targets}
+ done
+
+ keepdir /var/log/mgetty
+
+ #Install mgetty into /sbin (#119078)
+ dodir /sbin && \
+ mv "${D}"/usr/sbin/mgetty "${D}"/sbin && \
+ dosym /sbin/mgetty /usr/sbin/mgetty || die "failed to install /sbin/mgetty"
+ #Don't install ct (#106337)
+ rm "${D}"/usr/bin/ct || die "failed to remove useless ct program"
+
+ dodoc BUGS ChangeLog README.1st Recommend THANKS TODO \
+ doc/*.txt doc/modems.db
+ doinfo doc/mgetty.info
+
+ docinto vgetty
+ dodoc voice/{Readme,Announce,ChangeLog,Credits}
+
+ if use doc; then
+ dodoc doc/mgetty.ps
+ fi
+
+ docinto vgetty/doc
+ dodoc voice/doc/*
+
+ if use fax; then
+ mv samples/new_fax.all samples_new_fax.all || die "move failed."
+ docinto samples
+ dodoc samples/*
+
+ docinto samples/new_fax
+ dodoc samples_new_fax.all/*
+ fi
+
+ if ! use fax; then
+ insinto /usr/share/${PN}/frontends
+ doins -r frontends/{voice,network}
+ else
+ insinto /usr/share/${PN}
+ doins -r frontends
+ fi
+ insinto /usr/share/${PN}
+ doins -r patches
+ insinto /usr/share/${PN}/voice
+ doins -r voice/{contrib,Perl,scripts}
+
+ diropts -m 0750 -o fax -g fax
+ dodir /var/spool/voice
+ keepdir /var/spool/voice/incoming
+ keepdir /var/spool/voice/messages
+ if use fax; then
+ dodir /var/spool/fax
+ dodir /var/spool/fax/outgoing
+ keepdir /var/spool/fax/outgoing/locks
+ keepdir /var/spool/fax/incoming
+ fi
+}
+
+pkg_postinst() {
+ elog "Users who wish to use the fax or voicemail capabilities must be members"
+ elog "of the group fax in order to access files"
+ elog
+ elog "If you want to grab voice messages from a remote location, you must save"
+ elog "the password in /var/spool/voice/.code file"
+ echo
+ ewarn "/var/spool/voice/.code and /var/spool/voice/messages/Index"
+ ewarn "are not longer created by this automatically!"
+}