Signed-off-by: Josef Holzmayr <[email protected]>
---
 patches/mgetty_1.1.36/mgetty_fix_environment.diff |  195 +++++++++++++++++++++
 patches/mgetty_1.1.36/series                      |    1 +
 rules/mgetty.make                                 |    7 -
 3 files changed, 196 insertions(+), 7 deletions(-)
 create mode 100644 patches/mgetty_1.1.36/mgetty_fix_environment.diff

diff --git a/patches/mgetty_1.1.36/mgetty_fix_environment.diff 
b/patches/mgetty_1.1.36/mgetty_fix_environment.diff
new file mode 100644
index 0000000..a9d5d6e
--- /dev/null
+++ b/patches/mgetty_1.1.36/mgetty_fix_environment.diff
@@ -0,0 +1,195 @@
+Subject: [mgetty] fix environment in Makefiles
+From: Josef Holzmayr <[email protected]>
+
+mgetty has several environment variables hardcoded in its makefiles.
+Instead of tweaking them via sed in mgetty.make, we set them as a patch:
+CFLAGS+=-DAUTO_PPP
+CC (gets unset)
+LDFLAGS (gets unset)
+LIBS (gets unset)
+prefix=/usr
+CONFDIR=/etc/mgetty+sendfax
+
+Signed-off-by: Josef Holzmayr <[email protected]>
+
+---
+diff -urN mgetty-1.1.36/callback/Makefile mgetty-1.1.36-fix/callback/Makefile
+--- mgetty-1.1.36/callback/Makefile    2006-02-22 17:50:49.000000000 +0100
++++ mgetty-1.1.36-fix/callback/Makefile        2009-09-29 16:03:10.000000000 
+0200
+@@ -4,8 +4,8 @@
+ # SCCS: %W% %E% Copyright (c) Gert Doering
+ #
+ 
+-CC=gcc
+-CFLAGS=-O2 -I.. -g
++
++CFLAGS+=-DAUTO_PPP
+ 
+ zigzag:
+       cd .. ; $(MAKE) call-back
+diff -urN mgetty-1.1.36/contrib/next-login/Makefile 
mgetty-1.1.36-fix/contrib/next-login/Makefile
+--- mgetty-1.1.36/contrib/next-login/Makefile  1996-05-26 18:23:06.000000000 
+0200
++++ mgetty-1.1.36-fix/contrib/next-login/Makefile      2009-09-29 
16:03:10.000000000 +0200
+@@ -17,7 +17,7 @@
+ # from @(#)Makefile   5.3 (Berkeley) 5/9/89
+ #
+ 
+-CFLAGS=        -O -bsd -DORIGINAL -DFIX8BIT
++CFLAGS+=-DAUTO_PPP
+ LIBC= /lib/libsys_s.a
+ SRCS= login.c setenv.c
+ OBJS= login.o setenv.o
+diff -urN mgetty-1.1.36/contrib/ptylogin/Makefile 
mgetty-1.1.36-fix/contrib/ptylogin/Makefile
+--- mgetty-1.1.36/contrib/ptylogin/Makefile    1999-01-16 18:17:05.000000000 
+0100
++++ mgetty-1.1.36-fix/contrib/ptylogin/Makefile        2009-09-29 
16:03:10.000000000 +0200
+@@ -17,10 +17,10 @@
+ #  * $Id: Makefile,v 1.1 1999/01/16 17:17:05 gert Exp $
+ #  */
+ 
+-CFLAGS=-Wall
+-LDFLAGS=
+-LIBS=-lbsd
+-CC=gcc
++CFLAGS+=-DAUTO_PPP
++
++
++
+ 
+ SOURCE=ptylogin.c
+ EXECUTABLE=ptylogin
+diff -urN mgetty-1.1.36/fax/Makefile mgetty-1.1.36-fix/fax/Makefile
+--- mgetty-1.1.36/fax/Makefile 2006-02-22 18:25:30.000000000 +0100
++++ mgetty-1.1.36-fix/fax/Makefile     2009-09-29 16:03:10.000000000 +0200
+@@ -4,8 +4,8 @@
+ # SCCS: $Id: Makefile,v 4.9 2006/02/22 17:25:30 gert Exp $ Copyright (c) Gert 
Doering
+ #
+ 
+-CC=gcc
+-CFLAGS=-O2 -I.. -Wall
++
++CFLAGS+=-DAUTO_PPP
+ 
+ FAX_SCRIPTS=faxspool faxrunq faxq faxrm 
+ 
+diff -urN mgetty-1.1.36/frontends/X11/viewfax/Makefile 
mgetty-1.1.36-fix/frontends/X11/viewfax/Makefile
+--- mgetty-1.1.36/frontends/X11/viewfax/Makefile       2004-11-14 
21:38:24.000000000 +0100
++++ mgetty-1.1.36-fix/frontends/X11/viewfax/Makefile   2009-09-29 
16:03:10.000000000 +0200
+@@ -47,10 +47,10 @@
+ #LDFLAGS = $(OPT) -L/usr/openwin/lib -R/usr/openwin/lib
+ #LIBS =
+ # linux
+-CC = gcc
+-CFLAGS = $(OPT) -DHELPFILE=$(HELP)
+-LDFLAGS = $(OPT) -L/usr/X11R6/lib
+-LIBS =
++
++CFLAGS+=-DAUTO_PPP
++
++
+ 
+ ####### End of configurable definitions #######
+ OBJS = viewfax.o faxinput.o faxinit.o faxexpand.o
+diff -urN mgetty-1.1.36/g3/Makefile mgetty-1.1.36-fix/g3/Makefile
+--- mgetty-1.1.36/g3/Makefile  2006-02-22 18:25:34.000000000 +0100
++++ mgetty-1.1.36-fix/g3/Makefile      2009-09-29 16:03:10.000000000 +0200
+@@ -4,8 +4,8 @@
+ # SCCS: $Id: Makefile,v 4.7 2006/02/22 17:25:34 gert Exp $ Copyright (c) Gert 
Doering
+ #
+ 
+-CC=gcc
+-CFLAGS=-O2 -I.. -g 
++
++CFLAGS+=-DAUTO_PPP
+ 
+ G3_PROGRAMS=pbm2g3 g3cat g32pbm sff2g3
+ 
+diff -urN mgetty-1.1.36/Makefile mgetty-1.1.36-fix/Makefile
+--- mgetty-1.1.36/Makefile     2007-06-15 13:15:56.000000000 +0200
++++ mgetty-1.1.36-fix/Makefile 2009-09-29 16:03:10.000000000 +0200
+@@ -4,7 +4,7 @@
+ #
+ # 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".).
+-CC=gcc
++
+ #CC=cc
+ #
+ #### C Compiler Flags ####
+@@ -102,7 +102,7 @@
+ #         USTAT         - ustat(), no statfs etc.
+ #
+ #CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL
+-CFLAGS=-O2 -Wall -pipe
++CFLAGS+=-DAUTO_PPP
+ #CFLAGS=-O -DSVR4
+ #CFLAGS=-O -DSVR4 -DSVR42
+ #CFLAGS=-O -DUSE_POLL
+@@ -143,8 +143,8 @@
+ #     "utmp.o: unresolved symbol _login"
+ # For Linux, add "-lutil" if the linker complains about "updwtmp".
+ #
+-LDFLAGS=
+-LIBS=
++
++
+ #LIBS=-lprot -lsocket                         # SCO Unix
+ #LIBS=-lsocket
+ #LIBS=-lbsd                                   # OSF/1
+@@ -172,7 +172,7 @@
+ #
+ # prefix, where most (all?) of the stuff lives, usually /usr/local or /usr
+ #
+-prefix=/usr/local
++prefix=/usr
+ #
+ # prefix for all the spool directories (usually /usr/spool or /var/spool)
+ #
+@@ -192,7 +192,7 @@
+ #
+ # where the configuration files (*.config, aliases, fax.allow/deny) go to
+ #
+-CONFDIR=$(prefix)/etc/mgetty+sendfax
++CONFDIR=/etc/mgetty+sendfax
+ #CONFDIR=/etc/default/
+ #
+ #
+diff -urN mgetty-1.1.36/t/Makefile mgetty-1.1.36-fix/t/Makefile
+--- mgetty-1.1.36/t/Makefile   2006-09-26 00:32:10.000000000 +0200
++++ mgetty-1.1.36-fix/t/Makefile       2009-09-29 16:03:10.000000000 +0200
+@@ -4,8 +4,8 @@
+ # CVS: $Id: Makefile,v 1.6 2006/09/25 22:23:56 gert Exp $ Copyright (c) Gert 
Doering
+ #
+ 
+-CC=gcc
+-CFLAGS=-O2 -I.. -g  #-DT_LOG_VERBOSE
++
++CFLAGS+=-DAUTO_PPP
+ 
+ TEST_PROGRAMS=t_config t_ring
+ TEST_HELP_PGM=t_g3f_c
+diff -urN mgetty-1.1.36/tools/Makefile mgetty-1.1.36-fix/tools/Makefile
+--- mgetty-1.1.36/tools/Makefile       2006-02-22 18:25:35.000000000 +0100
++++ mgetty-1.1.36-fix/tools/Makefile   2009-09-29 16:03:10.000000000 +0200
+@@ -4,8 +4,8 @@
+ # RCS: $Id: Makefile,v 1.8 2006/02/22 17:25:35 gert Exp $
+ #
+ 
+-CC=gcc
+-CFLAGS=-O2 -I..
++
++CFLAGS+=-DAUTO_PPP
+ 
+ SCRIPTS=kvg cutbl
+ PROGRAMS=ltest mid microcom
+diff -urN mgetty-1.1.36/voice/Makefile mgetty-1.1.36-fix/voice/Makefile
+--- mgetty-1.1.36/voice/Makefile       2006-09-26 17:38:17.000000000 +0200
++++ mgetty-1.1.36-fix/voice/Makefile   2009-09-29 16:03:10.000000000 +0200
+@@ -9,7 +9,7 @@
+ AR=ar
+ ARFLAGS=rc
+ RANLIB=ranlib
+-CC=gcc
++
+ LN=ln
+ MV=mv
+ RM=rm
diff --git a/patches/mgetty_1.1.36/series b/patches/mgetty_1.1.36/series
index 0f2c98d..0f77746 100644
--- a/patches/mgetty_1.1.36/series
+++ b/patches/mgetty_1.1.36/series
@@ -1 +1,2 @@
 mgetty_1.1.36-1.5.diff
+mgetty_fix_environment.diff
diff --git a/rules/mgetty.make b/rules/mgetty.make
index 421d5b0..5ddf58d 100644
--- a/rules/mgetty.make
+++ b/rules/mgetty.make
@@ -65,13 +65,6 @@ $(STATEDIR)/mgetty.prepare: $(mgetty_prepare_deps_default)
        @$(call clean, $(MGETTY_DIR)/config.cache)
        # FIXME: mgetty doesn't allow DESTDIR/SYSROOT mechanism
        cp $(PTXCONF_MGETTY_CONFIG) $(MGETTY_DIR)/policy.h
-       for file in `find $(MGETTY_DIR) -name Makefile`; do \
-               sed -i -e "s,^CFLAGS.*=.*,CFLAGS+=-DAUTO_PPP,g" $$file; \
-               sed -i -e "s,^CC.*=.*,,g" $$file; \
-               sed -i -e "s,^LDFLAGS.*=.*,,g" $$file; \
-               sed -i -e "s,^LIBS.*=.*,,g" $$file; \
-               sed -i -e "s,^prefix.*=.*,prefix=$(SYSROOT),g" $$file; \
-       done
        @$(call touch, $@)
 
 # ----------------------------------------------------------------------------
-- 
1.6.4.4



Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363
Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
USt-IdNr.: DE 128592548



--
ptxdist mailing list
[email protected]

Reply via email to