From 747ba4a7389f5b6a65cc3d5880cfaf45b963a9dc Mon Sep 17 00:00:00 2001 From: nico Date: Mon, 24 Jul 2006 19:03:00 +0000 Subject: [PATCH] port mgetty to buildroot-ng git-svn-id: svn://svn.openwrt.org/openwrt/packages@4270 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- utils/mgetty/Makefile | 132 ++++++++++++++++++++++++++++++++++++++ utils/mgetty/patches/mgetty.patch | 98 ++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100644 utils/mgetty/Makefile create mode 100644 utils/mgetty/patches/mgetty.patch diff --git a/utils/mgetty/Makefile b/utils/mgetty/Makefile new file mode 100644 index 000000000..100a1260d --- /dev/null +++ b/utils/mgetty/Makefile @@ -0,0 +1,132 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mgetty +PKG_VERSION:=1.1.35 +PKG_XVERSION:=Feb22 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION)-$(PKG_XVERSION).tar.gz +PKG_SOURCE_URL:=ftp://alpha.greenie.net/pub/mgetty/source/1.1 +PKG_MD5SUM:=6805f8e31423bb777be80e3a856001cb +PKG_CAT:=zcat + +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/mgetty + SECTION:=utils + CATEGORY:=Utilities + TITLE:=A data/fax solution for your analog modem + DESCRIPTION:=A data/fax solution for your analog modem. +endef + +define Build/Configure + cp $(PKG_BUILD_DIR)/policy.h-dist $(PKG_BUILD_DIR)/policy.h + echo "#define AUTO_PPP" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef FAX_NOTIFY_PROGRAM" >> $(PKG_BUILD_DIR)/policy.h + echo "#define FAX_NOTIFY_PROGRAM \"/usr/lib/mgetty+sendfax/new_fax\"" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef DATA_FLOW" >> $(PKG_BUILD_DIR)/policy.h + echo "#define DATA_FLOW FLOW_HARD" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef DEVICE_GROUP" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef DEVICE_OWNER" >> $(PKG_BUILD_DIR)/policy.h + echo "#define DEVICE_OWNER \"root\"" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef FAXREC_FLOW" >> $(PKG_BUILD_DIR)/policy.h + echo "#define FAXREC_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h + echo "#undef FAXSEND_FLOW" >> $(PKG_BUILD_DIR)/policy.h + echo "#define FAXSEND_FLOW FLOW_SOFT" >> $(PKG_BUILD_DIR)/policy.h +endef + +#FIXME: don't manually install, use upstream Makefile instead +define Build/Compile + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR)/usr/bin + mkdir -p $(PKG_INSTALL_DIR)/usr/sbin + mkdir -p $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + mkdir -p $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(MAKE) -C $(PKG_BUILD_DIR) \ + mksed + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + prefix="$(PKG_INSTALL_DIR)/usr" \ + CONFDIR=/etc/mgetty+sendfax \ + bin-all + $(CP) $(PKG_BUILD_DIR)/mgetty $(PKG_INSTALL_DIR)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/sendfax $(PKG_INSTALL_DIR)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/fax/faxrunqd $(PKG_INSTALL_DIR)/usr/sbin + chmod 755 $(PKG_INSTALL_DIR)/usr/sbin/* + $(CP) $(PKG_BUILD_DIR)/fax/faxq-helper $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + chmod u+s $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper + $(CP) $(PKG_BUILD_DIR)/fax/cour25n.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/cour25.pbm $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/faxq $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/fax/faxrm $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/fax/faxrunq $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/fax/faxspool $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/g3/g32pbm $(PKG_INSTALL_DIR)/usr/bin + (cd $(PKG_INSTALL_DIR)/usr/bin;\ + ln -snf g32pbm g3topbm;\ + ); + $(CP) $(PKG_BUILD_DIR)/g3/g3cat $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/g3/pbm2g3 $(PKG_INSTALL_DIR)/usr/bin + $(CP) $(PKG_BUILD_DIR)/g3/sff2g3 $(PKG_INSTALL_DIR)/usr/bin + chmod 755 $(PKG_INSTALL_DIR)/usr/bin/* +# Installation into /etc + $(CP) $(PKG_BUILD_DIR)/dialin.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/faxheader $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/faxrunq.config $(PKG_INSTALL_DIR)/etc/mgetty+sendfax + $(CP) $(PKG_BUILD_DIR)/fax/faxspool.rules $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample + $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/login.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config + $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/mgetty.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config + $(PKG_BUILD_DIR)/sedscript < $(PKG_BUILD_DIR)/sendfax.cfg.in > $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config +endef + +define Package/mgetty/install + install -d -m0755 $(1)/usr/bin + install -m0755 \ + $(PKG_INSTALL_DIR)/usr/bin/faxq \ + $(PKG_INSTALL_DIR)/usr/bin/faxrm \ + $(PKG_INSTALL_DIR)/usr/bin/faxrunq \ + $(PKG_INSTALL_DIR)/usr/bin/faxspool \ + $(PKG_INSTALL_DIR)/usr/bin/g32pbm \ + $(PKG_INSTALL_DIR)/usr/bin/g3cat \ + $(PKG_INSTALL_DIR)/usr/bin/pbm2g3 \ + $(PKG_INSTALL_DIR)/usr/bin/sff2g3 \ + $(1)/usr/bin/ + install -d -m0755 $(1)/usr/sbin + install -m0755 \ + $(PKG_INSTALL_DIR)/usr/sbin/mgetty \ + $(PKG_INSTALL_DIR)/usr/sbin/sendfax \ + $(PKG_INSTALL_DIR)/usr/sbin/faxrunqd \ + $(1)/usr/sbin/ + install -d -m0755 $(1)/usr/lib/mgetty+sendfax + install -m4755 \ + $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/faxq-helper \ + $(1)/usr/lib/mgetty+sendfax/ + install -m644 \ + $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25n.pbm \ + $(PKG_INSTALL_DIR)/usr/lib/mgetty+sendfax/cour25.pbm \ + $(1)/usr/lib/mgetty+sendfax/ + install -d -m0755 $(1)/etc/mgetty+sendfax + install -m600 \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/dialin.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxheader \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxrunq.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/faxspool.rules.sample \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/login.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/mgetty.config \ + $(PKG_INSTALL_DIR)/etc/mgetty+sendfax/sendfax.config \ + $(1)/etc/mgetty+sendfax/ +endef + +$(eval $(call BuildPackage,mgetty)) diff --git a/utils/mgetty/patches/mgetty.patch b/utils/mgetty/patches/mgetty.patch new file mode 100644 index 000000000..c5ffb6f2e --- /dev/null +++ b/utils/mgetty/patches/mgetty.patch @@ -0,0 +1,98 @@ +Only in mgetty-1.1.31: .prepared +diff -ur mgetty-1.1.31-old/Makefile mgetty-1.1.31/Makefile +--- mgetty-1.1.31-old/Makefile 2006-01-02 00:37:56.000000000 +0000 ++++ mgetty-1.1.31/Makefile 2006-01-02 00:43:57.000000000 +0000 +@@ -164,7 +164,9 @@ + # + # 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 ++STRIP=$(STAGING_DIR)sstrip ++INSTALL=install -c -o root -g root ++#INSTALL=install -c -o bin -g bin + #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 +@@ -216,7 +218,7 @@ + # (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=root + # + # + # Where section 1 manual pages should be placed +@@ -416,7 +418,12 @@ + ./mksed >sedscript + chmod 700 sedscript + +-mksed: mksed.c policy.h Makefile ++REALGCC:=/usr/bin/gcc ++mksed: mksed.c policy.h Makefile ++ ( echo $(REALGCC); $(MAKE) "CC=$(REALGCC)" "CFLAGS=$(CFLAGS)" mksed-wrong;\ ++ ); ++ ++mksed-wrong: mksed.c policy.h Makefile + $(CC) $(CFLAGS) -DBINDIR=\"$(BINDIR)\" -DSBINDIR=\"$(SBINDIR)\" \ + -DLIBDIR=\"$(LIBDIR)\" \ + -DCONFDIR=\"$(CONFDIR)\" \ +@@ -590,8 +597,10 @@ + -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) ++ $(STRIP) $(SBINDIR)/mgetty ++ $(INSTALL) -m 755 sendfax $(SBINDIR) ++ $(STRIP) $(SBINDIR)/sendfax + # + # data files + directories + # +@@ -653,7 +662,8 @@ + 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) && \ ++ $(STRIP) $(BINDIR)/mg.echo ; \ + fi + + # +Only in mgetty-1.1.31-old: Makefile.orig +Only in mgetty-1.1.31-old: Makefile.rej +diff -ur mgetty-1.1.31-old/g3/Makefile mgetty-1.1.31/g3/Makefile +--- mgetty-1.1.31-old/g3/Makefile 2006-01-02 00:37:56.000000000 +0000 ++++ mgetty-1.1.31/g3/Makefile 2006-01-02 00:42:17.000000000 +0000 +@@ -40,7 +40,8 @@ + # install programs + # + for f in $(G3_PROGRAMS) ; do \ +- $(INSTALL) -s -m 755 $$f $(BINDIR) ; \ ++ $(INSTALL) -m 755 $$f $(BINDIR) ; \ ++ $(STRIP) $(BINDIR)/$$f ; \ + done + # + # make symlink for "g3topbm" (so third-party fax viewers won't fail) +diff -ur mgetty-1.1.31-old/logfile.c mgetty-1.1.31/logfile.c +--- mgetty-1.1.31-old/logfile.c 2006-01-02 00:37:56.000000000 +0000 ++++ mgetty-1.1.31/logfile.c 2006-01-02 00:42:17.000000000 +0000 +@@ -327,12 +327,11 @@ + } + else /* ERROR or FATAL */ + { +- fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: %s", ++ fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: #%d", + 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]: +- "" ); ++ errnr ); + #ifdef SYSLOG + syslog( level == L_FATAL? LOG_ALERT: LOG_ERR, "%s: %m", ws ); + #endif +Only in mgetty-1.1.31-old/voice/libutil: access.c.orig +Only in mgetty-1.1.31-old/voice/libvoice: Lucent.c.orig +Only in mgetty-1.1.31-old/voice/libvoice: V253modem.c.orig +Only in mgetty-1.1.31-old/voice/pvftools: pvftormd.c.orig -- 2.11.0