summaryrefslogtreecommitdiffstats
path: root/security/clamav-devel
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2003-09-26 17:34:19 +0000
committerdinoex <dinoex@FreeBSD.org>2003-09-26 17:34:19 +0000
commitd8eb19c8a385e10b0e26f6f399e35e1961b5899b (patch)
tree94e1720b311f4d3a98f9b5f110b3f480ef32d32b /security/clamav-devel
parent991368ad588ce338c92373f3f7c3e6a4248c2b22 (diff)
downloadFreeBSD-ports-d8eb19c8a385e10b0e26f6f399e35e1961b5899b.zip
FreeBSD-ports-d8eb19c8a385e10b0e26f6f399e35e1961b5899b.tar.gz
- Udpate to 20030926
add a few switches for spooldir and user The clamav-user doesn't get deinstalled by default (easy when upgrading), after deinstall a message is presented to remove the clamav-user if neccesary. PR: 57254 Submitted by: rob@debank.tv
Diffstat (limited to 'security/clamav-devel')
-rw-r--r--security/clamav-devel/Makefile19
-rw-r--r--security/clamav-devel/distinfo2
-rw-r--r--security/clamav-devel/pkg-install38
-rw-r--r--security/clamav-devel/pkg-plist9
4 files changed, 40 insertions, 28 deletions
diff --git a/security/clamav-devel/Makefile b/security/clamav-devel/Makefile
index 4ebcd50..a65d989 100644
--- a/security/clamav-devel/Makefile
+++ b/security/clamav-devel/Makefile
@@ -6,12 +6,11 @@
#
PORTNAME= clamav
-PORTVERSION= 20030829
-PORTREVISION= 1
+PORTVERSION= 20030926
CATEGORIES= security
MASTER_SITES= http://clamav.sourceforge.net/snapshot/
PKGNAMESUFFIX= -devel
-DISTNAME= ${PORTNAME}-${PORTVERSION}
+DISTNAME= ${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}
MAINTAINER= rob@debank.tv
COMMENT= Command line virus scanner written entirely in C
@@ -39,6 +38,11 @@ MAN1= clamscan.1 freshclam.1 sigtool.1 clamdscan.1 clamav-milter.1
MAN5= clamav.conf.5
MAN8= clamd.8
+CLAMAVUSER?= clamav
+SPOOLDIR?= /var/clamd
+PLIST_SUB+= SPOOLDIR="${SPOOLDIR}"
+PLIST_SUB+= CLAMAVUSER="${CLAMAVUSER}"
+
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 510001
@@ -65,14 +69,9 @@ post-patch:
@${REINPLACE_CMD} -e 's|/usr/lib/sendmail|/usr/sbin/sendmail|g' \
${WRKSRC}/clamav-milter/clamav-milter.c
-pre-install:
- @${ECHO} "===> Creating custom user to run clamav..."
- ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
-
post-install:
- @${ECHO} "===> Setting permissions..."
- @${SETENV} PKG_PREFIX=${PREFIX} \
- ${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL
+ ${SETENV} PKG_PREFIX=${PREFIX} \
+ ${SH} ${PKGINSTALL} ${PREFIX}
${INSTALL_SCRIPT} ${WRKSRC}/clamav-clamd.sh \
${LOCALBASE}/etc/rc.d/clamav-clamd.sh.sample
.if defined(WITH_MILTER)
diff --git a/security/clamav-devel/distinfo b/security/clamav-devel/distinfo
index f6170db..62671f7 100644
--- a/security/clamav-devel/distinfo
+++ b/security/clamav-devel/distinfo
@@ -1 +1 @@
-MD5 (clamav-20030829.tar.gz) = 2189904a13d126d02f166b1638e65bcd
+MD5 (clamav-devel-20030926.tar.gz) = 7b8f32e8dc373c51e1cb1a2bda07bdad
diff --git a/security/clamav-devel/pkg-install b/security/clamav-devel/pkg-install
index f040d5b..6541062 100644
--- a/security/clamav-devel/pkg-install
+++ b/security/clamav-devel/pkg-install
@@ -1,31 +1,39 @@
#!/bin/sh
+if [ -z "${CLAMAVUSER}" ]; then
+ CLAMAVUSER=clamav
+fi
-if [ "$2" != "PRE-INSTALL" ]; then
- chown -R clamav:clamav ${PKG_PREFIX}/share/clamav
+if [ -z "${SPOOLDIR}" ]; then
+ SPOOLDIR=/var/clamd
fi
-USER=clamav
-GROUP=clamav
+CLAMAVGROUP=${CLAMAVUSER}
-if ! pw groupshow "$GROUP" 2>/dev/null 1>&2; then
- if pw groupadd $GROUP; then
- echo "===> Added group \"$GROUP\"."
+echo "===> Adding user \"${CLAMAVUSER}\" if necessary."
+if ! pw groupshow "${CLAMAVGROUP}" 2>/dev/null 1>&2; then
+ if pw groupadd ${CLAMAVGROUP}; then
+ echo "===> Added group \"${CLAMAVGROUP}\"."
else
- echo "===> Adding group \"$GROUP\" failed..."
+ echo "===> Adding group \"${CLAMAVGROUP}\" failed..."
exit 1
- fi
+ fi
fi
-if ! pw usershow "$USER" 2>/dev/null 1>&2; then
- if pw useradd $USER -g $GROUP -h - \
- -s "/sbin/nologin" -d "/nonexistent" \
- -c "Clam Antivirus"; \
+if ! pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then
+ if pw useradd ${CLAMAVUSER} -g ${CLAMAVGROUP} -h - \
+ -s "/usr/sbin/nologin" -d "${SPOOLDIR}" \
+ -c "Clam Antivirus"; \
then
- echo "===> Added user \"$USER\"."
+ echo "===> Added user \"${CLAMAVUSER}\"."
else
- echo "===> Adding user \"$USER\" failed..."
+ echo "===> Adding user \"${CLAMAVUSER}\" failed..."
exit 1
fi
fi
+
+echo "===> Setting permissions..."
+mkdir ${SPOOLDIR}
+chown -R ${CLAMAVUSER}:${CLAMAVGROUP} ${PKG_PREFIX}/share/clamav ${SPOOLDIR}
+
exit 0
diff --git a/security/clamav-devel/pkg-plist b/security/clamav-devel/pkg-plist
index e4ee292..3362f1c 100644
--- a/security/clamav-devel/pkg-plist
+++ b/security/clamav-devel/pkg-plist
@@ -13,6 +13,11 @@ lib/libclamav.so
lib/libclamav.la
lib/libclamav.a
share/clamav/mirrors.txt
-@exec chown clamav share/clamav share/clamav/mirrors.txt share/clamav/viruses.db share/clamav/viruses.db2
@dirrm share/clamav
-@unexec rmuser -y clamav
+@unexec echo ""
+@unexec echo "========================================================="
+@unexec echo " If you want to deinstall this package permanently then"
+@unexec echo " \"rmuser -y %%CLAMAVUSER%%\" "
+@unexec echo " This will remove clamav's spool-directory and user "
+@unexec echo "========================================================="
+@unexec echo ""
OpenPOWER on IntegriCloud