Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2004 18:50:26 +0700 (NOVST)
From:      "Michael O. Boev" <mike@tric.tomsk.gov.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/73157: [PATCH] update mail/milter-sender to include BDB support/fix cache problems
Message-ID:  <200410261150.i9QBoQ3q068637@isrv.tric.ru>
Resent-Message-ID: <200410261200.i9QC0mh7035581@freefall.freebsd.org>

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

>Number:         73157
>Category:       ports
>Synopsis:       [PATCH] update mail/milter-sender to include BDB support/fix cache problems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 26 12:00:47 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Michael O. Boev
>Release:        FreeBSD 4.10-RELEASE i386
>Organization:
Tomsk Regional Information Center
>Environment:
System: FreeBSD isrv.tric.ru 4.10-RELEASE FreeBSD 4.10-RELEASE #3: Fri May 28 14:45:40 NOVST 2004 root@isrv.tric.ru:/usr/obj/usr/src/sys/ISRV i386

>Description:
	There is a problem with this port's cachefile and BerkeleyDB 1.x used in base FreeBSD,
	mentioned in pkg-message of this port and on milter.org.
	Although it could be theoretically built with any other version of BerkeleyDB,
	choosing a v3+ resulted in inablility to read sendmail's databases.
	
	Now that there's support (in mail/sendmail) for databases of later versions of
	BerkeleyDB, the user may choose to use both features, cache in DB format and
	support of reading sendmail databases.
	
>How-To-Repeat:
	
>Fix:
	The following patch is:
	1) adding knobs for linking with BDB ports. Knobs copy/pasted from mail/sendmail port,
	to be consistent with the version of BDB the sendmail is linked with.
	2) cosmetic enhancements to rc script.
	3) disconnecting the tools dir of libsnert from the build, to save both build time and
	from portability issues.

--- milter-sender.patch begins here ---
diff -ruN milter-sender.orig/Makefile milter-sender/Makefile
--- milter-sender.orig/Makefile	Mon Oct 25 12:03:49 2004
+++ milter-sender/Makefile	Mon Oct 25 19:23:05 2004
@@ -7,6 +7,8 @@
 
 PORTNAME=	milter-sender
 PORTVERSION=	0.62
+PORTREVISION=   1
+PKGNAMESUFFIX?=	${BERKELEYDB_SUFFIX}
 CATEGORIES=	mail
 MASTER_SITES=	http://www.snert.com/Software/download/
 DISTFILES=	libsnert-1.40.tgz milter-sender-${PORTVERSION}.tgz
@@ -22,6 +24,14 @@
 WRKSRC=		${WRKDIR}/com/snert/src/milter-sender
 MAKEFILE=	makefile
 
+# Options to define Features
+# WITH_DEBUG=yes
+# SENDMAIL_WITH_BERKELEYDB_VER=2
+# SENDMAIL_WITH_BERKELEYDB_VER=3
+# SENDMAIL_WITH_BERKELEYDB_VER=4
+# SENDMAIL_WITH_BERKELEYDB_VER=41
+# SENDMAIL_WITH_BERKELEYDB_VER=42
+
 .include <bsd.port.pre.mk>
 
 .if ( ${OSVERSION} < 440000 )
@@ -43,10 +53,48 @@
 
 CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ENV+=	LDFLAGS="${LDFLAGS}"
-CONFIGURE_ARGS+=--with-db --localstatedir=/var/spool --enable-cache=flatfile \
+CONFIGURE_ARGS+=--localstatedir=/var/spool \
 		--enable-milter-cf="${PREFIX}/etc/milter-sender.cf"
 .if !defined(WITH_DEBUG)
 CONFIGURE_ARGS+=--disable-debug
+.endif
+
+.if defined(SENDMAIL_WITH_BERKELEYDB_VER)
+.if ${SENDMAIL_WITH_BERKELEYDB_VER} == "2"
+BERKELEYDB_SUFFIX=      +db2
+BERKELEYDB_PORT?=       databases/db2
+BERKELEYDB_LIB?=                db2
+BERKELEYDB_INCLUDE?=    ${LOCALBASE}/include/db2
+.endif
+.if ${SENDMAIL_WITH_BERKELEYDB_VER} == "3"
+BERKELEYDB_SUFFIX=      +db3
+BERKELEYDB_PORT?=       databases/db3
+BERKELEYDB_LIB?=                db3
+BERKELEYDB_INCLUDE?=    ${LOCALBASE}/include/db3
+.endif
+.if ${SENDMAIL_WITH_BERKELEYDB_VER} == "4"
+BERKELEYDB_SUFFIX=      +db4
+BERKELEYDB_PORT?=       databases/db4
+BERKELEYDB_LIB?=                db4
+BERKELEYDB_INCLUDE?=    ${LOCALBASE}/include/db4
+.endif
+.if ${SENDMAIL_WITH_BERKELEYDB_VER} == "41"
+BERKELEYDB_SUFFIX=      +db41
+BERKELEYDB_PORT?=       databases/db41
+BERKELEYDB_LIB?=                db41
+BERKELEYDB_INCLUDE?=    ${LOCALBASE}/include/db41
+.endif
+.if ${SENDMAIL_WITH_BERKELEYDB_VER} == "42"
+BERKELEYDB_SUFFIX=      +db42
+BERKELEYDB_PORT?=       databases/db42
+BERKELEYDB_LIB?=                db-4.2
+BERKELEYDB_INCLUDE?=    ${LOCALBASE}/include/db42
+.endif
+LIB_DEPENDS+=           ${BERKELEYDB_LIB}:${PORTSDIR}/${BERKLEYDB_PORT}
+RUN_DEPENDS+=           ${LOCALBASE}/sbin/makemap:${PORTSDIR}/mail/sendmail
+CONFIGURE_ARGS+=--with-db=${BERKELEYDB_INCLUDE}
+.else
+CONFIGURE_ARGS+=--with-db --enable-cache=flatfile
 .endif
 
 USE_RC_SUBR=	yes
diff -ruN milter-sender.orig/files/milter-sender.sh milter-sender/files/milter-sender.sh
--- milter-sender.orig/files/milter-sender.sh	Mon Oct 25 12:03:49 2004
+++ milter-sender/files/milter-sender.sh	Mon Oct 25 11:36:14 2004
@@ -26,16 +26,16 @@
 %%NAME%%_flags=${%%NAME%%_flags:-"unix:$%%NAME%%_chdir/socket"}
 
 command=%%PREFIX%%/sbin/milter-sender
+command_args="&"
 required_dirs="$%%NAME%%_chdir"
 
-start_cmd=start_cmd
-start_cmd()
+start_precmd=start_precmd
+start_precmd()
 {
     if [ -s "$%%NAME%%_chdir/mutex" ]; then
 	ipcrm -s `cat $%%NAME%%_chdir/mutex`
     fi
     rm -f $%%NAME%%_chdir/{mutex,socket} $%%NAME%%_pidfile
-    cd $%%NAME%%_chdir && $command $%%NAME%%_flags >/dev/null &
 }
 
 load_rc_config $name
diff -ruN milter-sender.orig/files/patch-af milter-sender/files/patch-af
--- milter-sender.orig/files/patch-af	Thu Jan  1 07:00:00 1970
+++ milter-sender/files/patch-af	Mon Oct 25 12:47:23 2004
@@ -0,0 +1,11 @@
+--- ../lib/makefile.in.orig	Mon Oct 25 12:44:54 2004
++++ ../lib/makefile.in	Fri Aug 13 20:34:36 2004
+@@ -60,7 +60,7 @@
+ 
+ OBJS = LibSnert$O
+ 
+-SUBDIRS = crc type util mail sys io ../tools
++SUBDIRS = crc type util mail sys io
+ 
+ all: build
+ 
diff -ruN milter-sender.orig/pkg-message milter-sender/pkg-message
--- milter-sender.orig/pkg-message	Mon Oct 25 12:03:49 2004
+++ milter-sender/pkg-message	Mon Oct 25 19:21:27 2004
@@ -18,4 +18,11 @@
 of stability, he should change the CacheType= setting to flatfile in
 milter-sender.cf and move the old cache file away.
 
+A new solution to the problem exists, which may or may not serve better.
+One may build a BerkeleyDB v.2+ -enabled Sendmail (mail/sendmail port 
+has now got knobs for it). This way is, of course, a bit more tricky,
+as in the very minimum one should also rebuild this port with 
+corresponding BDB settings (see Makefile), may be a couple of other 
+programs that use sendmail databases, and rebuild the very databases.
+
 ************************************************************************
--- milter-sender.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



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