1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

- Use the ports framework to create user/group

- Shebangfix
- Allow staging as a regular user
This commit is contained in:
Antoine Brodin 2014-09-14 20:38:48 +00:00
parent ca1261504c
commit 3937eb52b5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=368225
3 changed files with 5 additions and 45 deletions

View File

@ -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:${PORTSDIR}/sysutils/p5-Unix-Syslog \
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 INSTALL LDAP.schema LICENSE \
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>

View File

@ -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

View File

@ -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