1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-23 09:10:43 +00:00

Add amavisd-new, performance-enhanced daemonized version of amavis-perl.

PR:		38934
Submitted by:	Christopher K Davis (ckd-freebsd@ckdhr.com)
This commit is contained in:
Anton Berezin 2002-06-13 14:46:25 +00:00
parent 7afd5c645a
commit 32088666dc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=61219
10 changed files with 246 additions and 0 deletions

View File

@ -8,6 +8,7 @@
SUBDIR += altivore
SUBDIR += amavis-perl
SUBDIR += amavisd
SUBDIR += amavisd-new
SUBDIR += apg
SUBDIR += arirang
SUBDIR += audit

View File

@ -0,0 +1,100 @@
# New ports collection makefile for: amavisd-new
# Date created: 05 Jun 2002
# Whom: Christopher K Davis (ckd-freebsd@ckdhr.com)
#
# $FreeBSD$
#
# Based on amavisd ports makefile.
PORTNAME= amavisd-new
PORTVERSION= 20020517
CATEGORIES= security
MASTER_SITES= http://www.ijs.si/software/amavisd/
DISTNAME= ${PORTNAME}-${PORTVERSION}
MAINTAINER= ckd-freebsd@ckdhr.com
BUILD_DEPENDS= ${LOCALBASE}/bin/arc:${PORTSDIR}/archivers/arc \
${LOCALBASE}/bin/lha:${PORTSDIR}/archivers/lha \
${LOCALBASE}/bin/unarj:${PORTSDIR}/archivers/unarj \
${LOCALBASE}/bin/unrar:${PORTSDIR}/archivers/unrar \
${LOCALBASE}/bin/zoo:${PORTSDIR}/archivers/zoo \
${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
${SITE_PERL}/${PERL_ARCH}/Compress/Zlib.pm:${PORTSDIR}/archivers/p5-Compress-Zlib \
${SITE_PERL}/${PERL_ARCH}/Convert/UUlib.pm:${PORTSDIR}/converters/p5-Convert-UUlib \
${SITE_PERL}/${PERL_ARCH}/IO/Socket/UNIX.pm:${PORTSDIR}/devel/p5-IO \
${SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64 \
${SITE_PERL}/${PERL_ARCH}/Unix/Syslog.pm:${PORTSDIR}/sysutils/p5-Unix-Syslog \
${SITE_PERL}/Archive/Tar.pm:${PORTSDIR}/archivers/p5-Archive-Tar \
${SITE_PERL}/Archive/Zip.pm:${PORTSDIR}/archivers/p5-Archive-Zip \
${SITE_PERL}/Convert/TNEF.pm:${PORTSDIR}/converters/p5-Convert-TNEF \
${SITE_PERL}/IO/AtomicFile.pm:${PORTSDIR}/devel/p5-IO-stringy \
${SITE_PERL}/MIME/Body.pm:${PORTSDIR}/mail/p5-MIME-Tools \
${SITE_PERL}/Mail/Address.pm:${PORTSDIR}/mail/p5-Mail-Tools \
${SITE_PERL}/Net/SMTP.pm:${PORTSDIR}/net/p5-Net \
${SITE_PERL}/Net/Server.pm:${PORTSDIR}/net/p5-Net-Server
RUN_DEPENDS= ${BUILD_DEPENDS}
GNU_CONFIGURE= yes
SITE_PERL= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}
AMAVISUSER?= vscan
AMAVISGROUP?= vscan
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc --with-amavisuser=${AMAVISUSER}:${AMAVISGROUP}
STARTSCRIPT= amavisd.sh
.if defined(WITH_POSTFIX)
CONFIGURE_ARGS+= --enable-postfix
MTA?= postfix
RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix
.elif defined(WITH_POSTFIX_CURRENT)
CONFIGURE_ARGS+= --enable-postfix
MTA?= postfix
RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix-current
.elif defined(WITH_MILTER)
CONFIGURE_ARGS+= --enable-milter
MTA?= milter
PLIST= ${PKGDIR}/pkg-plist.milter
STARTSCRIPT= amavisd-milter.sh
.else
CONFIGURE_ARGS+= --enable-sendmail
MTA?= sendmail
.endif
.if defined(WITH_SPAMASSASSIN)
BUILD_DEPENDS+= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Mail/SpamAssassin.pm:${PORTSDIR}/mail/p5-Mail-SpamAssassin \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Net/DNS.pm:${PORTSDIR}/net/p5-Net-DNS \
${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Razor/Client.pm:${PORTSDIR}/mail/razor-agents
pre-configure:
${CP} ${WRKSRC}/amavis/amavisd.in.all ${WRKSRC}/amavis/amavisd.in
.endif
# you must define this if you have no scanners (example: to use amavisd-new only as a SpamAssassin/Razor filter)
.if defined(WITH_ALL_SCANNERS)
CONFIGURE_ARGS+= --enable-all
.endif
post-patch:
@${SED} 's,%%AMAVISUSER%%,${AMAVISUSER},g' ${FILESDIR}/${STARTSCRIPT} > ${WRKSRC}/${STARTSCRIPT}
pre-install:
@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${AMAVISUSER} ${AMAVISGROUP}
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/${STARTSCRIPT} ${PREFIX}/etc/rc.d
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for FILE in FAQ INSTALL README README.exim README.milter README.postfix README.qmail README.scanners README.sendmail doc/amavis.html doc/amavis.m4 doc/amavis.png doc/amavis.txt
${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
.endfor
@${ECHO} "==============================================================================="
@${ECHO} "Please read ${DOCSDIR}/README.${MTA}"
@${ECHO} "==============================================================================="
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (amavisd-new-20020517.tar.gz) = b13a90e401884ac125b098d36b8d170a

View File

@ -0,0 +1,31 @@
#!/bin/sh
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
case "$1" in
start)
( [ -x ${PREFIX}/sbin/amavisd ] || [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
AMAVIS_MILTER=$(/bin/ps -xU %%AMAVISUSER%% | grep amavis-milter | awk '{ print $1 }')
( /bin/test "$AMAVISD" || /bin/test "$AMAVIS_MILTER" ) && \
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD $AMAVIS_MILTER" > /dev/null
rm -rf /var/amavis/amavis*.sock
su - %%AMAVISUSER%% -c "${PREFIX}/sbin/amavis-milter -D -p /var/amavis/amavis-milter.sock" > /dev/null
su - %%AMAVISUSER%% -c ${PREFIX}/sbin/amavisd > /dev/null 2>&1 && echo -n ' amavisd-milter'
;;
stop)
( [ -x ${PREFIX}/sbin/amavisd ] || [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
AMAVIS_MILTER=$(/bin/ps -xU %%AMAVISUSER%% | grep amavis-milter | awk '{ print $1 }')
( /bin/test "$AMAVISD" || /bin/test "$AMAVIS_MILTER" ) && \
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD $AMAVIS_MILTER" > /dev/null && echo -n ' amavisd-milter'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0

View File

@ -0,0 +1,28 @@
#!/bin/sh
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
case "$1" in
start)
( [ -x ${PREFIX}/sbin/amavisd ] || [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
( /bin/test "$AMAVISD" ) && \
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD" > /dev/null
rm -rf /var/amavis/amavis*.sock
su - %%AMAVISUSER%% -c ${PREFIX}/sbin/amavisd > /dev/null 2>&1 && echo -n ' amavisd'
;;
stop)
( [ -x ${PREFIX}/sbin/amavisd ] || [ -x ${PREFIX}/sbin/amavis-milter ] ) || exit 1
AMAVISD=$(/bin/ps -xU %%AMAVISUSER%% | grep amavisd | awk '{ print $1 }')
( /bin/test "$AMAVISD") && \
su - %%AMAVISUSER%% -c "/bin/kill $AMAVISD" > /dev/null && echo -n ' amavisd'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0

View File

@ -0,0 +1 @@
Performance-enhanced daemonized version of amavis-perl

View File

@ -0,0 +1,9 @@
amavisd-new is a performance-enhanced daemonized version of amavis-perl
Note that the installation is different than the original package, and the
integration into your MTA can be different, so please read the README and
INSTALL files very carefully.
amavisd-new also supports SpamAssassin integration.
WWW: http://www.ijs.si/software/amavisd/

View File

@ -0,0 +1,39 @@
#!/bin/sh
#
# $FreeBSD$
#
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
BATCH=${BATCH:=no}
USER=$1
GROUP=$2
if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if /usr/sbin/pw groupadd ${GROUP} -h -
then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
echo "Please create it, and try again."
exit 1
fi
fi
if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - \
-d /var/amavis \
-s /bin/sh \
-c "Scanning Virus Account"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
echo "Please create it, and try again."
exit 1
fi
fi

View File

@ -0,0 +1,18 @@
%%PORTDOCS%%share/doc/amavisd-new/FAQ
%%PORTDOCS%%share/doc/amavisd-new/INSTALL
%%PORTDOCS%%share/doc/amavisd-new/README
%%PORTDOCS%%share/doc/amavisd-new/README.exim
%%PORTDOCS%%share/doc/amavisd-new/README.milter
%%PORTDOCS%%share/doc/amavisd-new/README.postfix
%%PORTDOCS%%share/doc/amavisd-new/README.qmail
%%PORTDOCS%%share/doc/amavisd-new/README.scanners
%%PORTDOCS%%share/doc/amavisd-new/README.sendmail
%%PORTDOCS%%share/doc/amavisd-new/amavis.html
%%PORTDOCS%%share/doc/amavisd-new/amavis.m4
%%PORTDOCS%%share/doc/amavisd-new/amavis.png
%%PORTDOCS%%share/doc/amavisd-new/amavis.txt
%%PORTDOCS%%@dirrm share/doc/amavisd-new
etc/amavisd.conf
etc/rc.d/amavisd.sh
sbin/amavis
sbin/amavisd

View File

@ -0,0 +1,18 @@
%%PORTDOCS%%share/doc/amavisd-new/FAQ
%%PORTDOCS%%share/doc/amavisd-new/INSTALL
%%PORTDOCS%%share/doc/amavisd-new/README
%%PORTDOCS%%share/doc/amavisd-new/README.exim
%%PORTDOCS%%share/doc/amavisd-new/README.milter
%%PORTDOCS%%share/doc/amavisd-new/README.postfix
%%PORTDOCS%%share/doc/amavisd-new/README.qmail
%%PORTDOCS%%share/doc/amavisd-new/README.scanners
%%PORTDOCS%%share/doc/amavisd-new/README.sendmail
%%PORTDOCS%%share/doc/amavisd-new/amavis.html
%%PORTDOCS%%share/doc/amavisd-new/amavis.m4
%%PORTDOCS%%share/doc/amavisd-new/amavis.png
%%PORTDOCS%%share/doc/amavisd-new/amavis.txt
%%PORTDOCS%%@dirrm share/doc/amavisd-new
etc/amavisd.conf
etc/rc.d/amavisd-milter.sh
sbin/amavis-milter
sbin/amavisd