Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Oct 2004 18:55:55 +0700 (NOVST)
From:      "Michael O. Boev" <mike@tric.tomsk.gov.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/73158: [PATCH] maintainer-update of mail/milter-spamc
Message-ID:  <200410261155.i9QBttfK068784@isrv.tric.ru>
Resent-Message-ID: <200410261200.i9QC0mKw035640@freefall.freebsd.org>

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

>Number:         73158
>Category:       ports
>Synopsis:       [PATCH] maintainer-update of mail/milter-spamc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 26 12:00:48 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:
	Add support for linking against various BerkeleyDB ports, following the recent 
	mail/sendmail knobs.
	Disconnect tools directory from build of libsnert, saving build time and from portability
	issues.
	Cosmetic enhancements to rc script
>How-To-Repeat:
>Fix:
	Please, apply the following patch
	and rm files/patch-b[ab].

--- milter-spamc.patch begins here ---
diff -ruN milter-spamc.orig/Makefile milter-spamc/Makefile
--- milter-spamc.orig/Makefile	Mon Oct 25 12:22:20 2004
+++ milter-spamc/Makefile	Mon Oct 25 19:25:39 2004
@@ -7,9 +7,11 @@
 
 PORTNAME=	milter-spamc
 PORTVERSION=	0.25
+PORTREVISION=   1
 CATEGORIES=	mail
 MASTER_SITES=	http://www.snert.com/Software/download/
 DISTFILES=	libsnert-1.40.tgz milter-spamc-${PORTVERSION}.tgz
+PKGNAMESUFFIX?=	${BERKELEYDB_SUFFIX}
 
 MAINTAINER=	mike@tric.tomsk.gov.ru
 COMMENT=	Yet Another Sendmail-SpamAssassin Interface Milter
@@ -22,6 +24,14 @@
 WRKSRC=		${WRKDIR}/com/snert/src/milter-spamc
 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,9 +53,47 @@
 
 CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ENV+=	LDFLAGS="${LDFLAGS}"
-CONFIGURE_ARGS+=--with-db --localstatedir=/var/spool
+CONFIGURE_ARGS+=--localstatedir=/var/spool
 .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
 .endif
 
 USE_RC_SUBR=	yes
diff -ruN milter-spamc.orig/files/milter-spamc.sh milter-spamc/files/milter-spamc.sh
--- milter-spamc.orig/files/milter-spamc.sh	Mon Oct 25 12:22:20 2004
+++ milter-spamc/files/milter-spamc.sh	Mon Oct 25 13:00:37 2004
@@ -28,16 +28,16 @@
 %%NAME%%_flags=${%%NAME%%_flags:-"-f /etc/mail/sendmail.cf unix:$%%NAME%%_chdir/socket"}
 
 command=%%PREFIX%%/sbin/milter-spamc
+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-spamc.orig/files/patch-af milter-spamc/files/patch-af
--- milter-spamc.orig/files/patch-af	Thu Jan  1 07:00:00 1970
+++ milter-spamc/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-spamc.orig/files/patch-ba milter-spamc/files/patch-ba
--- milter-spamc.orig/files/patch-ba	Mon Oct 25 12:22:20 2004
+++ milter-spamc/files/patch-ba	Thu Jan  1 07:00:00 1970
@@ -1,10 +0,0 @@
---- ../tools/here-i-am.c~	Thu Oct 21 03:50:12 2004
-+++ ../tools/here-i-am.c	Thu Oct 21 04:01:48 2004
-@@ -34,6 +34,7 @@
-  *** You can change the stuff below if the configure script doesn't work.
-  ***********************************************************************/
- 
-+#define	HAVE_INET_NTOP 1
- 
- /***********************************************************************
-  *** No configuration below this point.
diff -ruN milter-spamc.orig/files/patch-bb milter-spamc/files/patch-bb
--- milter-spamc.orig/files/patch-bb	Mon Oct 25 12:22:20 2004
+++ milter-spamc/files/patch-bb	Thu Jan  1 07:00:00 1970
@@ -1,11 +0,0 @@
---- ../tools/where-are-you.c~	Thu Oct 21 03:55:49 2004
-+++ ../tools/where-are-you.c	Thu Oct 21 03:56:28 2004
-@@ -42,6 +42,8 @@
- #define DEFAULT_TIMEOUT			3000
- #endif
- 
-+#define	HAVE_INET_NTOP	1
-+
- /***********************************************************************
-  *** No configuration below this point.
-  ***********************************************************************/
--- milter-spamc.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?200410261155.i9QBttfK068784>