Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Sep 2014 20:38:48 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r368225 - in head/security/amavisd-new: . files
Message-ID:  <201409142038.s8EKcmhl018084@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Sun Sep 14 20:38:48 2014
New Revision: 368225
URL: http://svnweb.freebsd.org/changeset/ports/368225
QAT: https://qat.redports.org/buildarchive/r368225/

Log:
  - Use the ports framework to create user/group
  - Shebangfix
  - Allow staging as a regular user

Modified:
  head/security/amavisd-new/Makefile
  head/security/amavisd-new/files/pkg-deinstall.in
  head/security/amavisd-new/files/pkg-install.in

Modified: head/security/amavisd-new/Makefile
==============================================================================
--- head/security/amavisd-new/Makefile	Sun Sep 14 20:33:03 2014	(r368224)
+++ head/security/amavisd-new/Makefile	Sun Sep 14 20:38:48 2014	(r368225)
@@ -2,6 +2,7 @@
 
 PORTNAME=	amavisd-new
 PORTVERSION=	2.9.1
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.ijs.si/software/amavisd/ \
@@ -21,8 +22,9 @@ RUN_DEPENDS=	p5-Unix-Syslog>=0:${PORTSDI
 		p5-Net-Server>=2.0:${PORTSDIR}/net/p5-Net-Server \
 		p5-Mail-DKIM>=0.33:${PORTSDIR}/mail/p5-Mail-DKIM
 
-USES=		perl5 tar:xz
+USES=		perl5 shebangfix tar:xz
 USE_PERL5=	run
+SHEBANG_FILES=	amavisd-agent amavisd-nanny amavisd-release
 
 NO_BUILD=	yes
 
@@ -32,6 +34,8 @@ DOCS=		AAAREADME.first AMAVIS-MIB.txt IN
 
 AMAVISUSER?=	vscan
 AMAVISGROUP?=	vscan
+USERS=		${AMAVISUSER}
+GROUPS=		${AMAVISGROUP}
 AMAVISDIR?=	/var/amavis
 AMAVISQUARANTINE?=	/var/virusmails
 DAEMON?=	/usr/sbin/daemon -p
@@ -234,9 +238,6 @@ post-patch:
 				-e 's|$$localhost_name = .localhost.;|$$localhost_name = $$myhostname;|' \
 			${WRKSRC}/amavisd
 
-pre-install:
-	@${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL
-
 do-install:
 .if ${PORT_OPTIONS:MP0F}
 	${INSTALL_SCRIPT} ${WRKSRC}/p0f-analyzer.pl ${STAGEDIR}${PREFIX}/sbin
@@ -256,9 +257,6 @@ do-install:
 .endfor
 	@${CP} -pr ${WRKSRC}/README_FILES/images/ ${STAGEDIR}${DOCSDIR}/images
 .endif
-
-post-install:
 	${LN} -s ${PREFIX}/sbin/amavisd-release ${STAGEDIR}${PREFIX}/sbin/amavisd-requeue
-	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>

Modified: head/security/amavisd-new/files/pkg-deinstall.in
==============================================================================
--- head/security/amavisd-new/files/pkg-deinstall.in	Sun Sep 14 20:33:03 2014	(r368224)
+++ head/security/amavisd-new/files/pkg-deinstall.in	Sun Sep 14 20:38:48 2014	(r368225)
@@ -10,14 +10,6 @@ QUARANTINE=%%AMAVISQUARANTINE%%
 
 if [ "$2" = "POST-DEINSTALL" ]; then
 
-    if /usr/sbin/pw group show "${GROUP}" 2>&1 >/dev/null; then
-	echo "You should manually remove the \"${GROUP}\" group."
-    fi
-
-    if /usr/sbin/pw user show "${USER}" 2>&1 >/dev/null; then
-	echo "You should manually remove the \"${USER}\" user."
-    fi
-
     if [ -e ${DIR} ]; then
 	echo "You should manually remove the \"${DIR}\" directory."
     fi

Modified: head/security/amavisd-new/files/pkg-install.in
==============================================================================
--- head/security/amavisd-new/files/pkg-install.in	Sun Sep 14 20:33:03 2014	(r368224)
+++ head/security/amavisd-new/files/pkg-install.in	Sun Sep 14 20:38:48 2014	(r368225)
@@ -10,36 +10,6 @@ QUARANTINE=%%AMAVISQUARANTINE%%
 
 if [ "$2" = "PRE-INSTALL" ]; then
 
-    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 - -g 110
-	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 ${DIR} \
-	   -s /bin/sh \
-	   -c "Scanning Virus Account" \
-	   -u 110
-	then
-	    echo "Added user \"${USER}\"."
-	else
-	    echo "Adding user \"${USER}\" failed..."
-	    echo "Please create it, and try again."
-	    exit 1
-	fi
-    fi
-
     /usr/bin/install -o ${USER} -g ${GROUP} -m 750 -d ${DIR}
     echo "Created \"${DIR}\" directory."
     /usr/bin/install -o ${USER} -g ${GROUP} -m 750 -d ${DIR}/db



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