1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-03 06:04:53 +00:00

- Update to 0.62

- Supply rcng script

PR:		ports/71466
Submitted by:	Michael O. Boev <mike@tric.tomsk.gov.ru>
This commit is contained in:
Pav Lucistnik 2004-10-19 22:57:34 +00:00
parent 72857ab69f
commit 1243011ed7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=119812
8 changed files with 105 additions and 113 deletions

View File

@ -6,10 +6,10 @@
#
PORTNAME= milter-sender
PORTVERSION= 0.61
PORTVERSION= 0.62
CATEGORIES= mail
MASTER_SITES= http://www.snert.com/Software/download/
DISTFILES= libsnert-1.39.tgz milter-sender-${PORTVERSION}.tgz
DISTFILES= libsnert-1.40.tgz milter-sender-${PORTVERSION}.tgz
MAINTAINER= ports@FreeBSD.org
COMMENT= Real-time sender address verification, based on Milter API
@ -25,7 +25,7 @@ MAKEFILE= makefile
.include <bsd.port.pre.mk>
.if ( ${OSVERSION} < 440000 )
BUILD_DEPENDS= gxargs:${PORTSBASE}/misc/findutils
BUILD_DEPENDS+= gxargs:${PORTSBASE}/misc/findutils
.endif
.if !exists(/usr/lib/libmilter.a) && !exists(${LOCALBASE}/lib/libmilter.a)
@ -43,13 +43,22 @@ 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 \
CONFIGURE_ARGS+=--with-db --localstatedir=/var/spool --enable-cache=flatfile \
--enable-milter-cf="${PREFIX}/etc/milter-sender.cf"
.if !defined(WITH_DEBUG)
CONFIGURE_ARGS+=--disable-debug
.endif
USE_RC_SUBR= yes
RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} NAME=milter_sender
post-extract:
${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/milter-sender.sh > ${WRKSRC}/milter-sender.sh.freebsd
post-patch:
.if ( ${OSVERSION} < 440000 ) # please contact vs@ if in doubt
${REINPLACE_CMD} 's/xargs -J{}/gxargs -i{}/' ${WRKSRC}/../lib/configure
${REINPLACE_CMD} 's+/usr/sbin/daemon -f ++' ${WRKSRC}/milter-sender.sh.in
.endif
${REINPLACE_CMD} "s,-fvolatile,," ${WRKSRC}/configure

View File

@ -1,4 +1,4 @@
MD5 (libsnert-1.39.tgz) = 3017eaaa62c1c9f321f4d323dbb01c7e
SIZE (libsnert-1.39.tgz) = 299689
MD5 (milter-sender-0.61.tgz) = da277e57d858a37aaa8ba850e34cd498
SIZE (milter-sender-0.61.tgz) = 263998
MD5 (libsnert-1.40.tgz) = ee97d93f06304a87f54f1caf994cc91b
SIZE (libsnert-1.40.tgz) = 307456
MD5 (milter-sender-0.62.tgz) = 0717f2cf3387d993054c43633b21fc6e
SIZE (milter-sender-0.62.tgz) = 239890

View File

@ -0,0 +1,42 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: %%NAME%%
# REQUIRE: syslogd
# BEFORE: sendmail
# KEYWORD: FreeBSD shutdown
#
# Add the following lines to /etc/rc.conf to enable milter-sender:
#
#%%NAME%%_enable="YES"
#
. %%RC_SUBR%%
name=%%NAME%%
rcvar=`set_rcvar`
# set defaults
%%NAME%%_enable=${%%NAME%%_enable:-"NO"}
%%NAME%%_chdir="/var/spool/milter-sender"
%%NAME%%_pidfile=${%%NAME%%_pidfile:-"$%%NAME%%_chdir/pid"}
%%NAME%%_flags=${%%NAME%%_flags:-"unix:$%%NAME%%_chdir/socket"}
command=%%PREFIX%%/sbin/milter-sender
required_dirs="$%%NAME%%_chdir"
start_cmd=start_cmd
start_cmd()
{
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
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
--- configure.orig Fri Jun 11 20:37:06 2004
+++ configure Wed Jun 16 13:43:31 2004
@@ -1617,7 +1617,7 @@
@@ -1647,7 +1647,7 @@
COMPILE='$(CC) $(CFLAGS) $(CC_O)$*$O -c $<'
# Assume GCC.

View File

@ -1,24 +1,18 @@
--- install.sh.in.orig Sun May 30 11:26:05 2004
+++ install.sh.in Wed Jun 16 13:50:22 2004
@@ -18,62 +18,22 @@
MAILDIR="@with_sendmail@"
MILTER_CF="@milter_cf@"
-if [ ! -d ${STATEDIR} ]; then
- mkdir -p ${STATEDIR}
-fi
-chown ${USER} ${STATEDIR}
-chgrp ${GROUP} ${STATEDIR}
+install -d -o ${USER} -g ${GROUP} -m 755 ${STATEDIR}
--- install.sh.in.orig Wed Aug 25 17:35:08 2004
+++ install.sh.in Tue Sep 7 14:25:25 2004
@@ -25,62 +25,27 @@
chgrp ${GROUP} ${STATEDIR}
RC="${STARTUP_DIR}/${MILTER}${STARTUP_EXT}"
-if [ ! -f $RC ]; then
+${BSD_INSTALL_SCRIPT} ${MILTER}.sh.freebsd ${RC}.sample
if [ ! -f $RC ]; then
- cp ${MILTER}.sh $RC
- chmod 540 $RC
+${BSD_INSTALL_SCRIPT} ${MILTER}.sh $RC.sample
+[ ! -f $RC ] && cp $RC.sample $RC
-
- case `uname -s` in
- FreeBSD)
- ${BSD_INSTALL_PROGRAM} ${MILTER} ${SBINDIR}
- ;;
- Linux*)
- which chkconfig
- if test $? -eq 0; then
@ -26,8 +20,7 @@
- else
- # Probably a stupid Debian system.
- cd ${STARTUP_DIR}
+${BSD_INSTALL_PROGRAM} ${MILTER} ${SBINDIR}
-
- # Create relative links
- cd ../rc0.d
- ln -s ../init.d/${MILTER} K20${MILTER}
@ -35,9 +28,7 @@
- ln -s ../init.d/${MILTER} K20${MILTER}
- cd ../rc6.d
- ln -s ../init.d/${MILTER} K20${MILTER}
+${BSD_INSTALL_DATA} ${MILTER}.mc ${MAILDIR}/${MILTER}.mc.sample
+[ ! -f ${MAILDIR}/${MILTER}.mc ] && cp ${MAILDIR}/${MILTER}.mc.sample ${MAILDIR}/${MILTER}.mc
-
- # Assume S20sendmail or higher.
- cd ../rc2.d
- ln -s ../init.d/${MILTER} S18${MILTER}
@ -55,21 +46,32 @@
- ln -s $RC /etc/rcS.d/K30${MILTER}
- ;;
- esac
-fi
+./milter-sender help=1 | sed 's|^MilterSocket=.*|MilterSocket=unix:/var/spool/milter-sender/socket|' >${MILTER_CF}.sample
+[ ! -f ${MILTER_CF} ] && cp ${MILTER_CF}.sample ${MILTER_CF}
+ cp ${RC}.sample $RC
fi
-cp -f ${MILTER} ${SBINDIR}
-chmod 550 ${SBINDIR}/${MILTER}
-
+${BSD_INSTALL_PROGRAM} ${MILTER} ${SBINDIR}
-cp -f ${MILTER}.mc ${MAILDIR}/${MILTER}.mc.sample
-
+MILTER_MC=${MAILDIR}/${MILTER}.mc
+${BSD_INSTALL_DATA} ${MILTER}.mc ${MILTER_MC}.sample
+if [ ! -f $MILTER_MC ]; then
+ cp ${MILTER_MC}.sample ${MILTER_MC}
+fi
# Save the default configuration.
-./milter-sender help=1 >${MILTER_CF}.sample
-
-chmod g+r ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* ${MILTER_CF}.sample*
+./milter-sender help=1 | sed "s|^MilterSocket=.*|MilterSocket=unix:$STATEDIR/socket|">${MILTER_CF}.sample
# Save the existing configuration with any new additions.
-./milter-sender help=2 >${MILTER_CF}.new
+./milter-sender help=2 | sed "s|^MilterSocket=.*|MilterSocket=unix:$STATEDIR/socket|">${MILTER_CF}.new
-chgrp ${GROUP} ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* ${MILTER_CF}.sample*
+chgrp ${GROUP} ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF} ${MILTER_CF}.sample
+chmod g+r ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF} ${MILTER_CF}.sample
-chmod g+r ${MAILDIR} ${MAILDIR}/access.* ${MAILDIR}/aliases.* ${MILTER_CF}.sample*
+chgrp ${GROUP} ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF}.new ${MILTER_CF}.sample
+chmod g+r ${MAILDIR}/access.db ${MAILDIR}/aliases.db ${MILTER_CF}.new ${MILTER_CF}.sample
echo '***************************************************************'
echo

View File

@ -1,72 +0,0 @@
--- milter-sender.sh.in.orig Thu Aug 12 09:44:49 2004
+++ milter-sender.sh.in Mon Aug 23 10:45:57 2004
@@ -88,35 +88,25 @@
rm -f $STATE_DIR/mutex
NAME=`basename "$PROGRAM"`
- printf "Starting %s" $NAME
pid=`getpid "$PROGRAM"`
if [ X"$pid" != X ]; then
- printf '\r\033[71C['${FG_RED}'FAILED'${FG_NORMAL}']\n'
+ echo " milter-sender:FAILED"
return
fi
# Make sure the old socket has been removed, especially for FreeBSD.
rm -f ${STATE_DIR}/socket
- # Start the program in the background from a sub-shell
- # so that process will appear in the ps output immediately.
- sh -c "$PROGRAM $OPTIONS &"
-
- pid=`getpid "$PROGRAM"`
- if [ X"$pid" = X ]; then
- printf '\r\033[71C['${FG_RED}'FAILED'${FG_NORMAL}']\n'
- return
- fi
-
- printf '\r\033[71C['${FG_GREEN}' OK '${FG_NORMAL}']\n'
+ cd $STATE_DIR && /usr/sbin/daemon -f $PROGRAM $OPTIONS &
+
+ echo -n " milter-sender"
}
unalias stop
stop()
{
NAME=`basename "$PROGRAM"`
- printf "Stopping %s" $NAME
pid=`getpid "$PROGRAM"`
if [ X"$pid" != X ]; then
@@ -133,7 +123,7 @@
pid=`getpid "$PROGRAM"`
if [ X"$pid" != X ]; then
- printf '\r\033[71C['${FG_RED}'FAILED'${FG_NORMAL}']\n'
+ echo " milter-sender:FAILED"
return
fi
@@ -152,7 +142,7 @@
fi
fi
- printf '\r\033[71C['${FG_GREEN}' OK '${FG_NORMAL}']\n'
+ echo -n " milter-sender"
}
case "$1" in
@@ -183,9 +173,9 @@
status)
pid=`getpid "$PROGRAM"`
if [ X"$pid" != X ]; then
- printf '\r\033[72C['${FG_GREEN}${pid}${FG_NORMAL}']\n'
+ echo "milter-sender:${pid}"
else
- printf '\r\033[70C['${FG_RED}'STOPPED'${FG_NORMAL}']\n'
+ echo "milter-sender:STOPPED"
fi
;;
*)

View File

@ -8,4 +8,14 @@ include(`milter-sender.mc')dnl
Don't forget to remake and reinstall the sendmail configuration file
after modifying YOUR-CONF.mc.
IMPORTANT NOTE for those updating from older releases:
The default cachefile format has changed from bdb to flatfile, because
the author has observed instabilities and cache corruption problems in
milter-sender with the version of BerkeleyDB used in base FreeBSD.
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.
************************************************************************

View File

@ -1,4 +1,5 @@
@unexec if [ -f %D/etc/milter-sender.cf ] && cmp -s %D/etc/milter-sender.cf %D/etc/milter-sender.cf.sample; then rm -f %D/etc/milter-sender.cf; fi
etc/milter-sender.cf.new
etc/milter-sender.cf.sample
@exec if [ ! -f %D/etc/milter-sender.cf ] ; then cp -p %D/%F %B/milter-sender.cf; fi
@unexec if [ -f %D/etc/rc.d/milter-sender.sh ] && cmp -s %D/etc/rc.d/milter-sender.sh %D/etc/rc.d/milter-sender.sh.sample; then rm -f %D/etc/rc.d/milter-sender.sh; fi
@ -6,7 +7,7 @@ etc/rc.d/milter-sender.sh.sample
@exec if [ ! -f %D/etc/rc.d/milter-sender.sh ] ; then cp %D/%F %B/milter-sender.sh; fi
sbin/milter-sender
@exec install -d -o smmsp -g smmsp -m 755 /var/spool/milter-sender
@unexec rm -rf /var/spool/milter-sender
@unexec rm -rf /var/spool/milter-sender 2>&1 >/dev/null || true
%%PORTDOCS%%%%DOCSDIR%%/CHANGES.TXT
%%PORTDOCS%%%%DOCSDIR%%/Img/bg.gif
%%PORTDOCS%%%%DOCSDIR%%/Img/dilbert2003071742312.gif