diff --git a/mail/milter-sender/Makefile b/mail/milter-sender/Makefile index 3cb8d2dd8627..f77581ebdd6f 100644 --- a/mail/milter-sender/Makefile +++ b/mail/milter-sender/Makefile @@ -9,6 +9,7 @@ PORTNAME= milter-sender PORTVERSION= 0.62 CATEGORIES= mail MASTER_SITES= http://www.snert.com/Software/download/ +PKGNAMESUFFIX?= ${BERKELEYDB_SUFFIX} DISTFILES= libsnert-1.40.tgz milter-sender-${PORTVERSION}.tgz MAINTAINER= ports@FreeBSD.org @@ -22,6 +23,14 @@ GNU_CONFIGURE= yes 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 .if ( ${OSVERSION} < 440000 ) @@ -43,12 +52,50 @@ DOCS= CHANGES.TXT index.shtml style.css mailto.js \ 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 RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} NAME=milter_sender diff --git a/mail/milter-sender/files/milter-sender.sh b/mail/milter-sender/files/milter-sender.sh index 0d1fcef3e27b..f5a8b238dc95 100644 --- a/mail/milter-sender/files/milter-sender.sh +++ b/mail/milter-sender/files/milter-sender.sh @@ -26,16 +26,16 @@ rcvar=`set_rcvar` %%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 --git a/mail/milter-sender/files/patch-lib-makefile.in b/mail/milter-sender/files/patch-lib-makefile.in new file mode 100644 index 000000000000..60b04dcba2c4 --- /dev/null +++ b/mail/milter-sender/files/patch-lib-makefile.in @@ -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 --git a/mail/milter-sender/pkg-message b/mail/milter-sender/pkg-message index 424aeb0236df..3c983e4d796d 100644 --- a/mail/milter-sender/pkg-message +++ b/mail/milter-sender/pkg-message @@ -18,4 +18,11 @@ So, if one has observed such behaviour before, or just for the sake 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. + ************************************************************************