Skip site navigation (1)Skip section navigation (2)
Date:      29 Nov 1998 22:38:58 -0000
From:      nbm@rucus.ru.ac.za
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/8899: New port: qmail-contrib
Message-ID:  <19981129223858.11128.qmail@scythe.graham.ru.ac.za>

next in thread | raw e-mail | index | archive | help

>Number:         8899
>Category:       ports
>Synopsis:       New port: qmail-contrib
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 29 14:50:01 PST 1998
>Last-Modified:
>Originator:     Neil Blakey-Milner
>Organization:
Rhodes University Computers Users' Society
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

FreeBSD scythe.graham.ru.ac.za 3.0-CURRENT FreeBSD 3.0-CURRENT #2: Sat Nov 14 18:56:05 SAST 1998     nbm@scythe.graham.ru.ac.za:/usr/src/sys/compile/SCYTHE  i386

>Description:

	Two programs that work well with qmail.

	fastforward allows the collection of aliases into a compact database.
	dot-forward allows the use of ".forward" files.

>How-To-Repeat:
>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	qmail-contrib
#	qmail-contrib/Makefile
#	qmail-contrib/pkg
#	qmail-contrib/pkg/PLIST
#	qmail-contrib/pkg/COMMENT
#	qmail-contrib/pkg/DESCR
#	qmail-contrib/files
#	qmail-contrib/files/patch-newaliases
#	qmail-contrib/files/md5
#	qmail-contrib/files/patch-striplocal
#
echo c - qmail-contrib
mkdir -p qmail-contrib > /dev/null 2>&1
echo x - qmail-contrib/Makefile
sed 's/^X//' >qmail-contrib/Makefile << 'END-of-qmail-contrib/Makefile'
X# New ports collection makefile for:	qmail-contrib
X# Version required:     1.0
X# Date created:		28 November 1998
X# Whom:			Neil Blakey-Milner <nbm@rucus.ru.ac.za>
X#
X# $Id$
X
XDISTNAME=       qmail-contrib-0.1
XCATEGORIES=	mail
XMASTER_SITES=	ftp://ftp.qmail.org/pub/software/ \
X		ftp://rucus.ru.ac.za/pub/mail/qmail/src/
XDISTFILES=	dot-forward-${DF_VER}.tar.gz \
X		fastforward-${FF_VER}.tar.gz
X
XMAINTAINER=	ports@freebsd.org
X
XNO_PACKAGE=     Unsure of djbs license
X
XRUN_DEPENDS=	${QMAIL_DIR}/bin/qmail-send:${PORTSDIR}/mail/qmail
X
XALL_TARGET=	it
XINSTALL_TARGET=	setup
X
XMAN1=		dot-forward.1 fastforward.1 printforward.1 setforward.1
XMAN1+=		newaliases.1 printmaillist.1 setmaillist.1 newinclude.1
X
XPLIST_SUB=      DOCDIR=${DOCDIR}
X
X.if exists(/usr/local/qmail/bin/qmail-send)
XQMAIL_DIR?=	/usr/local/qmail
XPREFIX?=	/usr/local/qmail
X.else
XQMAIL_DIR?=	/var/qmail
XPREFIX?=	/var/qmail
X.endif
X
X.if (${PREFIX} == "/usr/local")
XDOCDIR= share/doc/qmail
X.else
XDOCDIR= doc
X.endif
X
XFF_VER=		0.51
XDF_VER=		0.71
XQCK_VER=	0.1
X
XWRKFF=		${WRKDIR}/fastforward-${FF_VER}
XWRKDF=		${WRKDIR}/dot-forward-${DF_VER}
X
XNO_MTREE=	yes
X
Xpre-patch:
X	@cd ${WRKFF} \
X	&& ${PATCH} -s <${FILESDIR}/patch-newaliases
X#	&& ${PATCH} <${FILESDIR}/patch-striplocal
X#	apparently the above patch is no longer needed
X
Xpost-patch:
X	@perl -pi.bak -e "s|-O2|${CFLAGS}|" ${WRKFF}/conf-cc
X	@perl -pi.bak -e "s|.var.qmail|${QMAIL_DIR}|" ${WRKFF}/conf-qmail
X	@perl -pi.bak -e '$$_ = "" if /cat/' ${WRKFF}/hier.c
X	@perl -pi.bak -e "s|-O2|${CFLAGS}|" ${WRKDF}/conf-cc
X	@perl -pi.bak -e "s|.var.qmail|${QMAIL_DIR}|" ${WRKDF}/conf-qmail
X	@perl -pi.bak -e '$$_ = "" if /cat/' ${WRKDF}/hier.c
X
Xdo-build:
X	@cd ${WRKDIR}/dot-forward-${DF_VER} \
X	&& make ${ALL_TARGET}
X	@cd ${WRKDIR}/fastforward-${FF_VER} \
X	&& make ${ALL_TARGET}
X
Xdo-install:
X	@cd ${WRKDIR}/dot-forward-${DF_VER} \
X	&& make ${INSTALL_TARGET}
X	@cd ${WRKDIR}/fastforward-${FF_VER} \
X	&& make ${INSTALL_TARGET}
X
X.include <bsd.port.mk>
END-of-qmail-contrib/Makefile
echo c - qmail-contrib/pkg
mkdir -p qmail-contrib/pkg > /dev/null 2>&1
echo x - qmail-contrib/pkg/PLIST
sed 's/^X//' >qmail-contrib/pkg/PLIST << 'END-of-qmail-contrib/pkg/PLIST'
Xdoc/fastforward/ALIASES
Xbin/dot-forward
Xbin/fastforward
Xbin/printforward
Xbin/setforward
Xbin/newaliases
Xbin/printmaillist
Xbin/setmaillist
Xbin/newinclude
X@dirrm doc/fastforward
END-of-qmail-contrib/pkg/PLIST
echo x - qmail-contrib/pkg/COMMENT
sed 's/^X//' >qmail-contrib/pkg/COMMENT << 'END-of-qmail-contrib/pkg/COMMENT'
XContributed programs for qmail.
END-of-qmail-contrib/pkg/COMMENT
echo x - qmail-contrib/pkg/DESCR
sed 's/^X//' >qmail-contrib/pkg/DESCR << 'END-of-qmail-contrib/pkg/DESCR'
XThese are a collection of contributed programs for qmail.
X
Xfastforward allows the use of a new method of storing aliases, in a 
Xcompact database.
X
Xdotforward allows old-style ".forward" files to work correctly.
END-of-qmail-contrib/pkg/DESCR
echo c - qmail-contrib/files
mkdir -p qmail-contrib/files > /dev/null 2>&1
echo x - qmail-contrib/files/patch-newaliases
sed 's/^X//' >qmail-contrib/files/patch-newaliases << 'END-of-qmail-contrib/files/patch-newaliases'
X*** newaliases.c.orig	Fri Apr 24 17:34:58 1998
X--- newaliases.c	Fri Apr 24 17:38:32 1998
X***************
X*** 12,17 ****
X--- 12,21 ----
X  
X  #define FATAL "newaliases: fatal: "
X  
X+ stralloc fnsrc = {0};
X+ stralloc fncdb = {0};
X+ stralloc fntmp = {0};
X+ 
X  void nomem()
X  {
X    strerr_die2x(111,FATAL,"out of memory");
X***************
X*** 26,36 ****
X  }
X  void writeerr()
X  {
X!   strerr_die2sys(111,FATAL,"unable to write to /etc/aliases.tmp: ");
X  }
X  void readerr()
X  {
X!   strerr_die2sys(111,FATAL,"unable to read /etc/aliases: ");
X  }
X  void die_control()
X  {
X--- 30,40 ----
X  }
X  void writeerr()
X  {
X!   strerr_die4sys(111,FATAL,"unable to write to ",fntmp.s,": ");
X  }
X  void readerr()
X  {
X!   strerr_die4sys(111,FATAL,"unable to read ",fnsrc.s,": ");
X  }
X  void die_control()
X  {
X***************
X*** 270,288 ****
X    if (cdbmss_add(&cdbmss,key.s,key.len,instr.s,instr.len) == -1) writeerr();
X  }
X  
X! void main()
X  {
X    int fd;
X  
X    umask(033);
X    readcontrols();
X  
X!   fd = open_read("/etc/aliases");
X    if (fd == -1) readerr();
X    substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
X  
X!   fd = open_trunc("/etc/aliases.tmp");
X!   if (fd == -1) strerr_die2sys(111,FATAL,"unable to create /etc/aliases.tmp: ");
X    if (cdbmss_start(&cdbmss,fd) == -1) writeerr();
X  
X    if (!stralloc_copys(&line,"")) nomem();
X--- 274,305 ----
X    if (cdbmss_add(&cdbmss,key.s,key.len,instr.s,instr.len) == -1) writeerr();
X  }
X  
X! void main(argc,argv)
X! int argc;
X! char **argv;
X  {
X    int fd;
X  
X    umask(033);
X    readcontrols();
X  
X!   if (!stralloc_copys(&fnsrc,argv[1] ? argv[1] : "/etc/aliases")) nomem();
X!   if (!stralloc_0(&fnsrc)) nomem();
X! 
X!   if (!stralloc_copys(&fncdb,fnsrc.s)) nomem();
X!   if (!stralloc_cats(&fncdb,".cdb")) nomem();
X!   if (!stralloc_0(&fncdb)) nomem();
X! 
X!   if (!stralloc_copys(&fntmp,fnsrc.s)) nomem();
X!   if (!stralloc_cats(&fntmp,".tmp")) nomem();
X!   if (!stralloc_0(&fntmp)) nomem();
X!   
X!   fd = open_read(fnsrc.s);
X    if (fd == -1) readerr();
X    substdio_fdbuf(&ssin,read,fd,inbuf,sizeof inbuf);
X  
X!   fd = open_trunc(fntmp.s);
X!   if (fd == -1) strerr_die4sys(111,FATAL,"unable to create ",fntmp.s,": ");
X    if (cdbmss_start(&cdbmss,fd) == -1) writeerr();
X  
X    if (!stralloc_copys(&line,"")) nomem();
X***************
X*** 314,321 ****
X    if (fsync(fd) == -1) writeerr();
X    if (close(fd) == -1) writeerr(); /* NFS stupidity */
X  
X!   if (rename("/etc/aliases.tmp","/etc/aliases.cdb") == -1)
X!     strerr_die2sys(111,FATAL,"unable to move /etc/aliases.tmp to /etc/aliases.cdb: ");
X    
X    _exit(0);
X  }
X--- 331,338 ----
X    if (fsync(fd) == -1) writeerr();
X    if (close(fd) == -1) writeerr(); /* NFS stupidity */
X  
X!   if (rename(fntmp.s,fncdb.s) == -1)
X!     strerr_die6sys(111,FATAL,"unable to move ",fntmp.s," to ",fncdb.s,": ");
X    
X    _exit(0);
X  }
END-of-qmail-contrib/files/patch-newaliases
echo x - qmail-contrib/files/md5
sed 's/^X//' >qmail-contrib/files/md5 << 'END-of-qmail-contrib/files/md5'
XMD5 (dot-forward-0.71.tar.gz) = 1fefd9760e4706491fb31c7511d69bed
XMD5 (fastforward-0.51.tar.gz) = 6dc619180ba9726380dc1047e45a1d8d
END-of-qmail-contrib/files/md5
echo x - qmail-contrib/files/patch-striplocal
sed 's/^X//' >qmail-contrib/files/patch-striplocal << 'END-of-qmail-contrib/files/patch-striplocal'
X*** fastforward.c.orig	Thu Apr 23 20:35:48 1998
X--- fastforward.c	Thu Apr 23 20:37:05 1998
X***************
X*** 261,270 ****
X        if (gettarget(1,"?",addr))
X          if (!stralloc_copy(&sender,&data)) nomem();
X    if (!gettarget(1,":",addr))
X!     if (flagpassthrough)
X!       _exit(0);
X!     else
X!       strerr_die1x(100,"Sorry, no mailbox here by that name. (#5.1.1)");
X    dodata();
X  }
X  
X--- 261,273 ----
X        if (gettarget(1,"?",addr))
X          if (!stralloc_copy(&sender,&data)) nomem();
X    if (!gettarget(1,":",addr))
X!     if (strpbrk(addr,"-"))
X!       if (!str_copy(addr,strpbrk(addr,"-")+1)) nomem();
X!     if (!gettarget(1,":",addr))
X!       if (flagpassthrough)
X!         _exit(0);
X!       else
X!         strerr_die1x(100,"Sorry, no mailbox here by that name. (#5.1.1)");
X    dodata();
X  }
X  
END-of-qmail-contrib/files/patch-striplocal
exit

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981129223858.11128.qmail>