aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2003-09-26 17:34:19 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2003-09-26 17:34:19 +0000
commite2db2a73e43d23952ea34b2947547e597f5a7abc (patch)
tree520f27d5852dfb8fd38b4105013eb8595f45bcc7 /security
parenta0f1b3ae493ffe9b6d49b594689378ec047966c2 (diff)
Notes
Diffstat (limited to 'security')
-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 4ebcd50138e3..a65d9894ee47 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 f6170db145f4..62671f7a61d2 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 f040d5b8fa83..65410625a42b 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 e4ee2923b973..3362f1c67a67 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 ""