Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2003 10:08:53 +0100 (CET)
From:      Blaz Zupan <blaz.zupan@amis.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/59323: MAINTAINER-UPDATE: amavisd-new-20030616.p6 
Message-ID:  <20031116090853.8765C55470@titanic.medinet.si>
Resent-Message-ID: <200311160920.hAG9KChW018732@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59323
>Category:       ports
>Synopsis:       MAINTAINER-UPDATE: amavisd-new-20030616.p6
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 16 01:20:12 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Blaz Zupan
>Release:        FreeBSD 4.8-RELEASE-p13 i386
>Organization:
>Environment:
System: FreeBSD titanic.medinet.si 4.8-RELEASE-p13 FreeBSD 4.8-RELEASE-p13 #2: Mon Oct 6 00:19:15 CEST 2003 root@bigbrother.amis.net:/db/obj/usr/src/sys/TITANIC i386


	
>Description:

1) Update port to amavisd-new-20030616-p6.
2) Incorporate changes from PR 57382:
   - add rc.subr support
   - cleanup sed variable replacement scripts
   - add pointer to Clam Antivirus to installation message
  PR 57382 was closed by mistake, I thought the contents
  have already been commited, while they were not.

Submitted by: milter@free.fr (1)
Submitted by: Martin Matuska <martin@tradex.sk> (2)
Approved by: maintainer

>How-To-Repeat:
	
>Fix:

diff -urN amavisd-new.old/Makefile amavisd-new/Makefile
--- amavisd-new.old/Makefile	Wed Aug 27 10:30:05 2003
+++ amavisd-new/Makefile	Sun Nov 16 09:47:30 2003
@@ -7,7 +7,7 @@
 # Based on amavisd ports makefile.
 
 PORTNAME=	amavisd-new
-PORTVERSION=	20030616.p5
+PORTVERSION=	20030616.p6
 CATEGORIES=	security
 MASTER_SITES=	http://www.ijs.si/software/amavisd/
 DISTNAME=	${PORTNAME}-${PORTVERSION:S/.p/-p/}
@@ -35,6 +35,7 @@
 		${LOCALBASE}/bin/zoo:${PORTSDIR}/archivers/zoo
 
 USE_PERL5_RUN=	yes
+USE_RC_SUBR=	yes
 
 PKGINSTALL=	${WRKDIR}/INSTALL
 PKGDEINSTALL=	${WRKDIR}/DEINSTALL
@@ -63,23 +64,20 @@
 BUILD_WRKSRC=	${WRKSRC}/helper-progs
 .endif
 
+SED_SCRIPT=	-e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \
+		-e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' \
+		-e 's,%%AMAVISDIR%%,${AMAVISDIR},g' \
+		-e 's,%%AMAVISQUARANTINE%%,${AMAVISQUARANTINE},g' \
+		-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
+		-e 's,%%PREFIX%%,${PREFIX},g' \
+		-e 's,%%RC_SUBR%%,${RC_SUBR},g'
+
 pre-build:
-	for file in amavisd.sh INSTALL DEINSTALL MESSAGE; do \
-		${SED} -e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \
-		       -e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' \
-		       -e 's,%%AMAVISDIR%%,${AMAVISDIR},g' \
-		       -e 's,%%AMAVISQUARANTINE%%,${AMAVISQUARANTINE},g' \
-		       -e 's,%%DOCSDIR%%,${DOCSDIR},g' \
-		       -e 's,%%PREFIX%%,${PREFIX},g' \
-	               < ${FILESDIR}/$${file}.tmpl > ${WRKDIR}/$${file}; \
+	for file in amavisd.sh amavis-milter.sh INSTALL DEINSTALL MESSAGE; do \
+		${SED} ${SED_SCRIPT} < ${FILESDIR}/$${file}.tmpl > ${WRKDIR}/$${file}; \
 	done
 	for file in amavisd.conf amavisd; do \
-		${SED} -e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \
-		       -e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' \
-		       -e 's,%%AMAVISDIR%%,${AMAVISDIR},g' \
-		       -e 's,%%AMAVISQUARANTINE%%,${AMAVISQUARANTINE},g' \
-		       -e 's,%%PREFIX%%,${PREFIX},g' \
-		       < ${WRKSRC}/$${file} > ${WRKDIR}/$${file}; \
+		${SED} ${SED_SCRIPT} < ${WRKSRC}/$${file} > ${WRKDIR}/$${file}; \
 	done
 
 pre-install:
@@ -89,6 +87,7 @@
 .if !defined(AMAVIS_NOMILTER)
 	${INSTALL_PROGRAM} ${WRKSRC}/helper-progs/amavis ${PREFIX}/sbin
 	${INSTALL_PROGRAM} ${WRKSRC}/helper-progs/amavis-milter ${PREFIX}/sbin
+	${INSTALL_SCRIPT} ${WRKDIR}/amavis-milter.sh ${PREFIX}/etc/rc.d
 .endif
 	${INSTALL_SCRIPT} ${WRKDIR}/amavisd ${PREFIX}/sbin
 	${INSTALL_SCRIPT} ${WRKDIR}/amavisd.conf ${PREFIX}/etc/amavisd.conf-dist
diff -urN amavisd-new.old/distinfo amavisd-new/distinfo
--- amavisd-new.old/distinfo	Wed Aug 27 10:30:05 2003
+++ amavisd-new/distinfo	Sun Nov 16 09:47:30 2003
@@ -1 +1 @@
-MD5 (amavisd-new-20030616-p5.tar.gz) = 13c76432e957ccd302856f64526483a2
+MD5 (amavisd-new-20030616-p6.tar.gz) = a611af8b952707977b9851dc8fc81640
diff -urN amavisd-new.old/files/MESSAGE.tmpl amavisd-new/files/MESSAGE.tmpl
--- amavisd-new.old/files/MESSAGE.tmpl	Sat Jan  4 11:59:25 2003
+++ amavisd-new/files/MESSAGE.tmpl	Sun Nov 16 09:46:34 2003
@@ -2,10 +2,17 @@
 *******************************************************************
  To use amavisd-new, you need to install at least one virus scanner.
  For example McAfee VirusScan is available as a FreeBSD port
- in /usr/ports/security/vscan. If you want to use the amavis sendmail
- milter interface, you need to type the following command:
+ in /usr/ports/security/vscan and Clam Antivirus is available
+ in /usr/ports/security/clamav.
 
-	touch %%AMAVISDIR%%/use.milter
+ Enable amavisd-new in /etc/rc.conf with the following line:
+
+    amavisd_enable="YES"
+
+ If you want to use the amavis sendmail milter interface,
+ you need the following additional line in /etc/rc.conf
+
+    amavis_milter_enable="YES"
 
  A configuration template is available in %%PREFIX%%/etc
  as amavisd.conf-dist. Copy it to amavisd.conf and edit it to
diff -urN amavisd-new.old/files/amavis-milter.sh.tmpl amavisd-new/files/amavis-milter.sh.tmpl
--- amavisd-new.old/files/amavis-milter.sh.tmpl	Thu Jan  1 01:00:00 1970
+++ amavisd-new/files/amavis-milter.sh.tmpl	Sun Nov 16 09:46:34 2003
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: amavis_milter
+# REQUIRE: amavisd
+# BEFORE: amavisd
+# KEYWORD: FreeBSD shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable amavis-milter:
+#
+#amavis_milter_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=amavis_milter
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/amavis-milter
+
+amavis_milter_user=%%AMAVISUSER%%
+
+required_files=%%PREFIX%%/etc/amavisd.conf
+
+# set defaults
+
+amavis_milter_enable=${amavis_milter_enable:-"NO"}
+amavis_milter_flags=${amavis_milter_flags:-"-D -p %%AMAVISDIR%%/amavis-milter.sock"}
+
+load_rc_config $name
+run_rc_command "$1"
diff -urN amavisd-new.old/files/amavisd.sh.tmpl amavisd-new/files/amavisd.sh.tmpl
--- amavisd-new.old/files/amavisd.sh.tmpl	Fri May 16 04:54:14 2003
+++ amavisd-new/files/amavisd.sh.tmpl	Sun Nov 16 09:46:34 2003
@@ -1,36 +1,42 @@
 #!/bin/sh
+#
+# $FreeBSD: ports/security/clamav/files/amavisd.sh,v 1.1 2003/09/28 13:29:28 dinoex Exp $
+#
 
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
-	echo "$0: Cannot determine the PREFIX" >&2
-	exit 1
-fi
-
-DIR=%%AMAVISDIR%%
-PIDFILE=$DIR/amavisd.pid
-SOCKFILES=$DIR/amavis*.sock
-MILTERFLAG=$DIR/use.milter
-
-case "$1" in
-start)
-	if [ -e ${PREFIX}/etc/amavisd.conf ]; then
-		rm -rf ${SOCKFILES}
-		if [ -e $MILTERFLAG ]; then
-			su %%AMAVISUSER%% -c "${PREFIX}/sbin/amavis-milter -D -p $DIR/amavis-milter.sock"
-		fi
-		su %%AMAVISUSER%% -c "${PREFIX}/sbin/amavisd > /dev/null 2>&1" && echo -n ' amavisd'
-	fi
-	;;
-stop)
-	if [ -e $MILTERFLAG ]; then
-		killall -u %%AMAVISUSER%% amavis-milter >/dev/null 2>&1
-	fi
-	if [ -e $PIDFILE ]; then
-		su %%AMAVISUSER%% -c "kill `cat $PIDFILE`" && echo -n ' amavisd'
-	fi
-	;;
-*)
-	echo "Usage: `basename $0` {start|stop}" >&2
-	;;
-esac
+# PROVIDE: amavisd
+# REQUIRE: LOGIN
+# BEFORE: mail
+# KEYWORD: FreeBSD shutdown
 
-exit 0
+#
+# Add the following lines to /etc/rc.conf to enable amavisd:
+#
+#amavisd_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=amavisd
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/amavisd > /dev/null 2>&1
+
+amavisd_user=%%AMAVISUSER%%
+
+pidfile=%%AMAVISDIR%%/amavisd.pid
+required_files=%%PREFIX%%/etc/amavisd.conf
+
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+  rm -f $pidfile
+}
+
+# set defaults
+
+amavisd_enable=${amavisd_enable:-"NO"}
+amavisd_flags=${amavisd_flags:-""}
+
+load_rc_config $name
+run_rc_command "$1"
diff -urN amavisd-new.old/files/patch-amavisd amavisd-new/files/patch-amavisd
--- amavisd-new.old/files/patch-amavisd	Wed Aug 27 10:30:05 2003
+++ amavisd-new/files/patch-amavisd	Sun Nov 16 09:47:30 2003
@@ -1,15 +1,6 @@
---- amavisd.orig	Mon Aug 25 18:07:56 2003
-+++ amavisd	Mon Aug 25 20:47:40 2003
-@@ -3903,7 +3903,7 @@
- 	/^\.lzo$/  && defined $lzop
- 	    && return do_uncompress($part,$tempdir,"$lzop -d -c");
- 	/^\.cpio$/ && defined $cpio && return do_cpio($part,$tempdir);
--#	/^\.tar$/  && defined $cpio && return do_cpio($part,$tempdir);
-+	/^\.tar$/  && defined $cpio && return do_cpio($part,$tempdir);
- 	/^\.tar$/  && return do_tar($part,$tempdir);  # fallback
- 	/^\.zip$/  && return do_unzip($part,0,$tempdir);
- 	/^\.rar$/  && return do_unrar($part,0,$tempdir);
-@@ -6260,7 +6260,7 @@
+--- amavisd.orig	Mon Nov 10 01:22:13 2003
++++ amavisd	Tue Nov 11 22:42:47 2003
+@@ -6279,7 +6279,7 @@
  my($amavisd_path) = find_program_path($0, [split(/:/, $path, -1)], 0);
  $amavisd_path = $1 if $amavisd_path=~m{^([A-Za-z0-9/._=+-]+)$(?!\n)}; # untaint
  
diff -urN amavisd-new.old/files/patch-amavisd.conf amavisd-new/files/patch-amavisd.conf
--- amavisd-new.old/files/patch-amavisd.conf	Tue Jul  1 11:41:37 2003
+++ amavisd-new/files/patch-amavisd.conf	Sun Nov 16 09:47:31 2003
@@ -1,5 +1,5 @@
---- amavisd.conf.orig	Wed Jun 25 17:22:46 2003
-+++ amavisd.conf	Wed Jun 25 17:26:42 2003
+--- amavisd.conf.orig	Mon Nov 10 00:07:53 2003
++++ amavisd.conf	Tue Nov 11 22:48:05 2003
 @@ -51,7 +51,7 @@
  # $MYHOME serves as a quick default for some other configuration settings.
  # More refined control is available with each individual setting further down.
@@ -12,7 +12,7 @@
 @@ -60,8 +60,8 @@
  
  # Set the user and group to which the daemon will change if started as root
- # (otherwise just keep the UID unchanged, and these settings have no effect):
+ # (otherwise just keeps the UID unchanged, and these settings have no effect):
 -$daemon_user  = 'vscan';	# (no default;  customary: vscan or amavis)
 -$daemon_group = 'sweep';	# (no default;  customary: vscan or amavis)
 +$daemon_user  = '%%AMAVISUSER%%';	# (no default;  customary: vscan or amavis)
@@ -20,16 +20,16 @@
  
  # Runtime working directory (cwd), and a place where
  # temporary directories for unpacking mail are created.
-@@ -271,7 +271,7 @@
+@@ -274,7 +274,7 @@
  # 3: server, client
  # 4: decompose parts
  # 5: more debug details
 -$log_level = 2;		  # (defaults to 0)
 +$log_level = 0;		  # (defaults to 0)
  
- # Customizeable template for the most interesting log file entry (e.g. with
+ # Customizable template for the most interesting log file entry (e.g. with
  # $log_level=0) (take care to properly quote Perl special characters like '\')
-@@ -496,7 +496,7 @@
+@@ -510,7 +510,7 @@
  #   or a directory (no trailing slash)
  #   (the default value is undef, meaning no quarantine)
  #
diff -urN amavisd-new.old/files/patch-config.h.in amavisd-new/files/patch-config.h.in
--- amavisd-new.old/files/patch-config.h.in	Sun Apr 20 12:02:44 2003
+++ amavisd-new/files/patch-config.h.in	Sun Nov 16 09:47:31 2003
@@ -1,15 +1,15 @@
 --- helper-progs/config.h.in.orig	Fri Mar  7 22:56:50 2003
-+++ helper-progs/config.h.in	Sat Mar 15 16:15:40 2003
++++ helper-progs/config.h.in	Tue Nov 11 22:54:33 2003
 @@ -14,10 +14,10 @@
  #define X_HEADER_LINE "by-amavisd-new-via-milter"
-
+ 
  /* Define if you have the mkdtemp function, undefine otherwise */
 -#undef HAVE_MKDTEMP
 +#define HAVE_MKDTEMP
-
+ 
  /* Define if you have the mktemp function, undefine otherwise */
 -#define HAVE_MKTEMP
 +#undef HAVE_MKTEMP
-
+ 
  /* Define if we have the snprintf function, undefine otherwise */
  #undef HAVE_SNPRINTF
diff -urN amavisd-new.old/files/patch-configure amavisd-new/files/patch-configure
--- amavisd-new.old/files/patch-configure	Sun Apr 20 12:02:44 2003
+++ amavisd-new/files/patch-configure	Sun Nov 16 09:47:31 2003
@@ -1,17 +1,9 @@
---- helper-progs/configure.orig	Thu Dec 26 12:35:33 2002
-+++ helper-progs/configure	Sat Apr 19 10:54:31 2003
-@@ -2041,20 +2041,3 @@
+--- helper-progs/configure.orig	Tue Nov 11 22:59:24 2003
++++ helper-progs/configure	Tue Nov 11 23:01:31 2003
+@@ -2040,12 +2040,3 @@
  
  
  
--if test "$AMAVISUSER" != "" ; then
--   id $AMAVISUSER > /dev/null 2>&1
--   if test "$?" != 0 ; then
--      echo ""
--      echo "Note:  The Amavis user '$AMAVISUSER' does not seem to"
--      echo "exist.  Please create this user before continuing."
--   fi
--fi
 -
 -if test "$SENDMAILPROG" != "no" ; then
 -        sendmailversion=`$SENDMAILPROG -bv -d0.1 | $AWK '/Version/ {print $2}'`
diff -urN amavisd-new.old/pkg-plist amavisd-new/pkg-plist
--- amavisd-new.old/pkg-plist	Wed Aug 27 10:30:05 2003
+++ amavisd-new/pkg-plist	Sun Nov 16 09:47:31 2003
@@ -14,11 +14,13 @@
 %%PORTDOCS%%%%DOCSDIR%%/README.performance
 %%PORTDOCS%%%%DOCSDIR%%/README.policy-on-notifications
 %%PORTDOCS%%%%DOCSDIR%%/README.postfix
+%%PORTDOCS%%%%DOCSDIR%%/README.protocol
 %%PORTDOCS%%%%DOCSDIR%%/README.sendmail
 %%PORTDOCS%%%%DOCSDIR%%/README.sendmail-dual
 %%PORTDOCS%%%%DOCSDIR%%/RELEASE_NOTES
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
 etc/amavisd.conf-dist
+%%AMAVIS_NOMILTER%%etc/rc.d/amavis-milter.sh
 etc/rc.d/amavisd.sh
 %%AMAVIS_NOMILTER%%sbin/amavis
 %%AMAVIS_NOMILTER%%sbin/amavis-milter
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031116090853.8765C55470>