- Add options to build with BDB instead of flatfile, default off

PR:		ports/73157
Submitted by:	Michael O. Boev <mike@tric.tomsk.gov.ru>
This commit is contained in:
Pav Lucistnik 2004-10-26 15:17:30 +00:00
parent 10c4d6f567
commit f863b26889
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=120231
4 changed files with 69 additions and 4 deletions

View file

@ -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 <bsd.port.pre.mk>
.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

View file

@ -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

View file

@ -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

View file

@ -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.
************************************************************************