aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorijliao <ijliao@FreeBSD.org>2002-05-20 03:37:05 +0800
committerijliao <ijliao@FreeBSD.org>2002-05-20 03:37:05 +0800
commit8666bfd04d16a3c1e217f9fe13da4818b878eb8d (patch)
treeb6ed2402475b002294af11a50276e13b129e5a12
parent22346b03cf264bf01281ea0a88409424e31d1407 (diff)
downloadfreebsd-ports-graphics-8666bfd04d16a3c1e217f9fe13da4818b878eb8d.tar.gz
freebsd-ports-graphics-8666bfd04d16a3c1e217f9fe13da4818b878eb8d.tar.zst
freebsd-ports-graphics-8666bfd04d16a3c1e217f9fe13da4818b878eb8d.zip
add milter support
fix startup script PR: 38297 Submitted by: Martin Matuska <matuska@wu-wien.ac.at>, maintainer
-rw-r--r--security/amavisd/Makefile13
-rw-r--r--security/amavisd/files/amavisd-milter.sh31
-rw-r--r--security/amavisd/files/amavisd.sh12
-rw-r--r--security/amavisd/pkg-plist.milter18
4 files changed, 69 insertions, 5 deletions
diff --git a/security/amavisd/Makefile b/security/amavisd/Makefile
index 949456bd242..cb47f7c6af7 100644
--- a/security/amavisd/Makefile
+++ b/security/amavisd/Makefile
@@ -7,7 +7,7 @@
PORTNAME= amavisd
PORTVERSION= 20020300
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://www.amavis.org/dist/perl/
DISTNAME= ${PORTNAME}-snapshot-${PORTVERSION}
@@ -39,6 +39,8 @@ AMAVISGROUP?= vscan
CONFIGURE_ARGS+= --sysconfdir=${PREFIX}/etc --with-amavisuser=${AMAVISUSER}:${AMAVISGROUP}
+STARTSCRIPT= amavisd.sh
+
.if defined(WITH_POSTFIX)
CONFIGURE_ARGS+= --enable-postfix
MTA?= postfix
@@ -47,19 +49,24 @@ RUN_DEPENDS+= ${LOCALBASE}/libexec/postfix/smtpd:${PORTSDIR}/mail/postfix
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
post-patch:
- @${SED} 's,%%AMAVISUSER%%,${AMAVISUSER},g' ${FILESDIR}/amavisd.sh > ${WRKSRC}/amavisd.sh
+ @${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}/amavisd.sh ${PREFIX}/etc/rc.d
+ ${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
diff --git a/security/amavisd/files/amavisd-milter.sh b/security/amavisd/files/amavisd-milter.sh
new file mode 100644
index 00000000000..8ab574f4bac
--- /dev/null
+++ b/security/amavisd/files/amavisd-milter.sh
@@ -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
diff --git a/security/amavisd/files/amavisd.sh b/security/amavisd/files/amavisd.sh
index e09150d0b72..823b03e4a90 100644
--- a/security/amavisd/files/amavisd.sh
+++ b/security/amavisd/files/amavisd.sh
@@ -7,10 +7,18 @@ fi
case "$1" in
start)
- [ -x ${PREFIX}/sbin/amavisd ] && su - %%AMAVISUSER%% -c ${PREFIX}/sbin/amavisd > /dev/null 2>&1 && echo -n ' amavisd'
+ ( [ -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)
- echo -n ' amavisd'
+ ( [ -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
diff --git a/security/amavisd/pkg-plist.milter b/security/amavisd/pkg-plist.milter
new file mode 100644
index 00000000000..43247c6abb1
--- /dev/null
+++ b/security/amavisd/pkg-plist.milter
@@ -0,0 +1,18 @@
+%%PORTDOCS%%share/doc/amavisd/FAQ
+%%PORTDOCS%%share/doc/amavisd/INSTALL
+%%PORTDOCS%%share/doc/amavisd/README
+%%PORTDOCS%%share/doc/amavisd/README.exim
+%%PORTDOCS%%share/doc/amavisd/README.milter
+%%PORTDOCS%%share/doc/amavisd/README.postfix
+%%PORTDOCS%%share/doc/amavisd/README.qmail
+%%PORTDOCS%%share/doc/amavisd/README.scanners
+%%PORTDOCS%%share/doc/amavisd/README.sendmail
+%%PORTDOCS%%share/doc/amavisd/amavis.html
+%%PORTDOCS%%share/doc/amavisd/amavis.m4
+%%PORTDOCS%%share/doc/amavisd/amavis.png
+%%PORTDOCS%%share/doc/amavisd/amavis.txt
+%%PORTDOCS%%@dirrm share/doc/amavisd
+etc/amavisd.conf
+etc/rc.d/amavisd-milter.sh
+sbin/amavis-milter
+sbin/amavisd
td>-0/+159 * Add koffice-i18n-se. This port is set to IGNORE,lofi2004-02-044-0/+159 * Add koffice-i18n-lo. This port is set to IGNORE,lofi2004-02-044-0/+159 * Add koffice-i18n-fi. This port is set to IGNORE,lofi2004-02-044-0/+159 * Add koffice-i18n-fa. This port is set to IGNORE,lofi2004-02-044-0/+159 * Set {WANT,USE}_GNOME correctly to make these ports compatible with the newmarcus2004-02-047-6/+14 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-0469-27/+69 * Add USE_GETTEXT and bump PORTREVISION.marcus2004-02-0452-107/+109 * Fetch the .tar.gz files for this port since the .tar.bz2 distributionsjkoshy2004-02-042-2/+2 * - Update to 0.3.6pav2004-02-034-5/+28 * Update to Vim 6.2 patchlevel 221obrien2004-02-022-2/+55 * - Update to version 2.05akrion2004-01-313-5/+5 * - Update to version 1.40.16krion2004-01-313-5/+5 * - Update to 0.7.11pav2004-01-316-66/+60 * Fix build on AMD64arved2004-01-311-1/+6 * - Add missing man page and bump PORTREVISIONkrion2004-01-311-0/+3 * . Fix the build on alpha by not assuming that you can cast a va_listglewis2004-01-314-2/+107 * - Update to 1.2pav2004-01-313-3/+10 * SIZE *DOES* MATTER.sergei2004-01-311-0/+1 * Add NO_LATEST_LINK to avoid link stompingkris2004-01-292-0/+3 * . Don't allow -O3 to be hardwired into CFLAGS, just use what is set. Inglewis2004-01-291-0/+15 * SIZEify.trevor2004-01-2951-0/+58 * Use lthack, and install translations.adamw2004-01-253-12/+55 * Update to 2.0.3.marcus2004-01-249-6/+9 * Now gettext 0.12.1 is gettext-old.trevor2004-01-2452-52/+52 * . If PACKAGE_BUILDING is set, then set WITHOUT_X11 as we can't guaranteeglewis2004-01-237-9/+285 * Use the SORT macro from bsd.port.mk.trevor2004-01-2223-28/+13 * Remove dasher after a repocopy to accessibility/dasher.marcus2004-01-226-94/+0 * Update to 1.6arved2004-01-208-134/+202 * Fix dependecy list. MrProject renamed to Planner.bland2004-01-161-1/+2 * Patch is not longer required. scandir() filter function now properlybland2004-01-163-42/+0 * [REPOCOPY WAITING] editors/ooodict-hu_HU port can moved to hungarian categoryedwin2004-01-162-19/+0 * Update to 3.2.2.marcus2004-01-164-14/+4 * OBE by REINPLACE action in pre-configure.obrien2004-01-141-8/+0 * - Update to version 1.58krion2004-01-123-16/+13 * update to 0.8yoichi2004-01-112-2/+2 * setup -dontdeletetemp has the same effect as this patch.mbr2004-01-104-84/+0 * $OOHOME/user/config/soffice.cfg is a directory, not a file.mbr2004-01-104-8/+8 * - Set QTMAKESPEC and fix the buildkrion2004-01-091-1/+4 * Fix Makefile comment in port.mbr2004-01-091-2/+2 * Fix USE_CDROM option in comment.mbr2004-01-091-1/+1 * Add staroffice7.0 port. This product is commercial and needs to be boughtmbr2004-01-098-3680/+4925 * Update port: editors/tpad fixed some bugs and added new featuresedwin2004-01-084-6/+31 * - Update to 0.7.10pav2004-01-083-2/+3 * Add gnome2-office, a meta-port of office/productivity applications formarcus2004-01-074-0/+40 * Add another MASTERSITE.obrien2004-01-051-1/+2 * Remove junk files (ie, .orig) before installing all files in supportobrien2004-01-051-0/+4 * Update to 2.4.1.marcus2004-01-052-2/+2 * - Update to 0.7.9pav2004-01-054-9/+38 * Since we prefix the binary names with "pn", we need this patch sopetef2004-01-052-1/+13 * Merge a forgotten line from my GNOME 2.5 repo.marcus2004-01-041-1/+1 * Add a missing USE_REINPLACE.marcus2004-01-031-0/+1 * Merge diffs from my GNOME 2.5 repo.marcus2004-01-035-16/+67 * New port: misc/dasher, text entry system (for people with disabilities)edwin2004-01-035-0/+52 * Add emacs-21.2-menu-encode.patch for WITH_MENUBAR_FONTSET knob.nobutaka2003-12-312-1/+2 * Fix DISTNAME which I forgot in my previous commit.demon2003-12-301-0/+1 * From the submitter:dd2003-12-292-4/+9 * add texmaker 1.0ijliao2003-12-295-0/+59 * Fix it so doing Help->Contents works, and the help file is rendered correctlymarcus2003-12-292-0/+18 * Update to 2.9.8 release.demon2003-12-273-17/+18 * Note that two bugs in the OS are fixed and we shouldn'tmbr2003-12-264-8/+8 * - Update to version 1.55krion2003-12-262