aboutsummaryrefslogtreecommitdiffstats
path: root/security/clamav
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-04-02 00:36:29 +0800
committereik <eik@FreeBSD.org>2004-04-02 00:36:29 +0800
commitf4aabac7f5e75471c9ffdb52c101b689532e5526 (patch)
tree2768effe81416631628ce96dd0f05ab41d199af0 /security/clamav
parent339147ceabe432a5a6ebe40de31974b4170aed29 (diff)
downloadfreebsd-ports-graphics-f4aabac7f5e75471c9ffdb52c101b689532e5526.tar.gz
freebsd-ports-graphics-f4aabac7f5e75471c9ffdb52c101b689532e5526.tar.zst
freebsd-ports-graphics-f4aabac7f5e75471c9ffdb52c101b689532e5526.zip
Update to clamav 0.70
- new thread manager (with better SMP support) - new switch ArchiveDetectEncrypted - new directive: ArchiveDetectEncrypted - see /usr/local/share/doc/clamav/NEWS - install html documentation to /usr/local/share/doc/clamav/html added CLAMAVUSER/CLAMAVGROUP support Adopted the port to ensure timely fixes in case I broke something :P Please reset the maintainer if TERAMOTO Masahiro shows up again.
Diffstat (limited to 'security/clamav')
-rw-r--r--security/clamav/Makefile63
-rw-r--r--security/clamav/distinfo4
-rw-r--r--security/clamav/files/patch-clamav-milter::Makefile.in20
-rw-r--r--security/clamav/files/patch-clamd::Makefile.in20
-rw-r--r--security/clamav/files/patch-clamdscan::Makefile.in20
-rw-r--r--security/clamav/files/patch-clamscan::Makefile.in20
-rw-r--r--security/clamav/files/patch-configure16
-rw-r--r--security/clamav/files/patch-freshclam::Makefile.in20
-rw-r--r--security/clamav/files/patch-sigtool::Makefile.in20
-rw-r--r--security/clamav/pkg-deinstall6
-rw-r--r--security/clamav/pkg-descr2
-rw-r--r--security/clamav/pkg-install36
-rw-r--r--security/clamav/pkg-plist14
13 files changed, 83 insertions, 178 deletions
diff --git a/security/clamav/Makefile b/security/clamav/Makefile
index 0d200bbe752..fbe9b7615aa 100644
--- a/security/clamav/Makefile
+++ b/security/clamav/Makefile
@@ -6,13 +6,16 @@
#
PORTNAME= clamav
-PORTVERSION= ${DISTVERSION:S/-/./g}
+PORTVERSION= ${DISTVERSION:S/-rc//g:S/-/./g}
CATEGORIES= security
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED}
MASTER_SITE_SUBDIR= clamav
DISTNAME= ${PORTNAME}-${DISTVERSION}
MAINTAINER= markun@onohara.to
+MAINTAINER= eik@FreeBSD.org
+# I've just adopted the port to ensure timely updates. Please
+# reset the maintainer if TERAMOTO Masahiro shows up again.
COMMENT= Command line virus scanner written entirely in C
LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4
@@ -23,21 +26,36 @@ RUN_DEPENDS= lha:${PORTSDIR}/archivers/lha \
arc:${PORTSDIR}/archivers/arc \
unzip:${PORTSDIR}/archivers/unzip
-DISTVERSION= 0.67-1
+DISTVERSION= 0.70-rc
+
+CLAMAVUSER?= clamav
+CLAMAVGROUP?= clamav
USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
INSTALLS_SHLIB= yes
+USE_RC_SUBR= yes
PKGINSTALL= ${WRKDIR}/pkg-install
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+
+PORTDOCS= NEWS ChangeLog html
CONFIGURE_ARGS= --with-dbdir=${DATADIR} \
- --disable-clamav --enable-bigstack
-CFLAGS+= ${PTHREAD_CFLAGS} -I${LOCALBASE}/include
-LDFLAGS+= ${PTHREAD_LIBS} -L${LOCALBASE}/lib
-CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
+ --disable-clamuko \
+ --disable-clamav \
+ --enable-bigstack \
+ --disable-dependency-tracking \
+ --with-user=${CLAMAVUSER} \
+ --with-group=${CLAMAVGROUP}
+CPPFLAGS+= -I${LOCALBASE}/include \
+ ${PTHREAD_CFLAGS}
+LDFLAGS+= -L${LOCALBASE}/lib \
+ ${PTHREAD_LIBS}
+CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
MAN1= clamscan.1 freshclam.1 sigtool.1 clamdscan.1
MAN5= clamav.conf.5
MAN8= clamd.8 clamav-milter.8
@@ -49,6 +67,8 @@ CONFLICTS= clamav-devel-*
SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \
-e 's|%%DATADIR%%|${DATADIR}|g' \
+ -e 's|%%CLAMAVUSER%%|${CLAMAVUSER}|g' \
+ -e 's|%%CLAMAVGROUP%%|${CLAMAVGROUP}|g' \
-e 's|%%CLAMAV_CLAMD_SOCKET%%|${CLAMAV_CLAMD_SOCKET}|g' \
-e 's|%%CLAMAV_MILTER_SOCKET%%|${CLAMAV_MILTER_SOCKET}|g'
@@ -59,11 +79,14 @@ SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \
-e 's|^\#?(User) .*$$|\1 clamav|' \
-e 's|^\#?(AllowSupplementaryGroups)$$|\1|' \
-e 's|^\#?(FixStaleSocket)$$|\1|' \
- -e 's|^\#?(ScanMail)$$|\1|'
+ -e 's|^\#?(ScanMail)$$|\1|' \
+ -e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DATADIR}|' \
+ -e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
+ -e 's|^\#?(UpdateLogFile) .*$$|\1 /var/log/clamav/freshclam.log|'
-.include <bsd.port.pre.mk>
+PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \
+ CLAMAVGROUP=${CLAMAVGROUP}
-USE_RC_SUBR= yes
RC_DIR= ${PREFIX}/etc/rc.d
RC_SUFX= .sh
SED_SCRIPT+= -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
@@ -72,14 +95,17 @@ SED_SCRIPT+= -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \
PLIST_SUB+= RC_DIR=${RC_DIR} \
RC_SUFX=${RC_SUFX}
+.include <bsd.port.pre.mk>
+
.if defined(WITH_MILTER)
-.if exists(${LOCALBASE}/lib/libmilter.a)
-CPPFLAGS+= -I${LOCALBASE}/include
-CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}"
-.endif
+.if exists(/usr/lib/libmilter.a) || exists(${LOCALBASE}/lib/libmilter.a)
CONFIGURE_ARGS+= --enable-milter
PLIST_SUB+= CLAMAV-MILTER=""
.else
+BROKEN= requires Sendmail 8.12
+PLIST_SUB+= CLAMAV-MILTER="@comment "
+.endif
+.else
PLIST_SUB+= CLAMAV-MILTER="@comment "
.endif
@@ -89,9 +115,13 @@ post-patch:
@${REINPLACE_CMD} -e 's|/usr/lib/sendmail|/usr/sbin/sendmail|g' \
${WRKSRC}/clamav-milter/clamav-milter.c
+# @${REINPLACE_CMD} -E -e 's/(_LIBS=.*)-l?pthread -lc_r[[:>:]]/\1${PTHREAD_LIBS}/' \
+
post-build:
@${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf
+ @${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/freshclam.conf
@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL}
+ @${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-deinstall >${PKGDEINSTALL}
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \
>${WRKDIR}/clamav-clamd.sh
@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-freshclam.sh \
@@ -110,7 +140,7 @@ post-install:
${RC_DIR}/clamav-clamd${RC_SUFX}
@${INSTALL_SCRIPT} ${WRKDIR}/clamav-freshclam.sh \
${RC_DIR}/clamav-freshclam${RC_SUFX}
- @${CHOWN} -R clamav:clamav ${DATADIR}
+ @${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DATADIR}
.for c in clamav freshclam
@[ -f ${PREFIX}/etc/${c}.conf ] || \
${CP} ${PREFIX}/etc/${c}.conf.default ${PREFIX}/etc/${c}.conf
@@ -120,9 +150,12 @@ post-install:
${RC_DIR}/clamav-milter${RC_SUFX}
.endif
.if !defined(NOPORTDOCS)
- ${MKDIR} ${DOCSDIR}
+ @${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${INSTALL_WRKSRC}/NEWS ${INSTALL_WRKSRC}/ChangeLog \
${DOCSDIR}
+ @${MKDIR} ${DOCSDIR}/html
+ @${INSTALL_DATA} ${INSTALL_WRKSRC}/docs/html/*.* \
+ ${DOCSDIR}/html
.endif
@${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL
diff --git a/security/clamav/distinfo b/security/clamav/distinfo
index d9d963bab63..7059faeea61 100644
--- a/security/clamav/distinfo
+++ b/security/clamav/distinfo
@@ -1,2 +1,2 @@
-MD5 (clamav-0.67-1.tar.gz) = e53d65fe2f7d4146f146c5720313381e
-SIZE (clamav-0.67-1.tar.gz) = 2282367
+MD5 (clamav-0.70-rc.tar.gz) = a5c296221fac9e05b865ed29f93e8718
+SIZE (clamav-0.70-rc.tar.gz) = 2251095
diff --git a/security/clamav/files/patch-clamav-milter::Makefile.in b/security/clamav/files/patch-clamav-milter::Makefile.in
deleted file mode 100644
index d6a1bd3f559..00000000000
--- a/security/clamav/files/patch-clamav-milter::Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- clamav-milter/Makefile.in.orig Wed Nov 12 02:36:48 2003
-+++ clamav-milter/Makefile.in Fri Nov 21 18:23:35 2003
-@@ -162,7 +162,7 @@
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- CCLD = $(CC)
- LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-+ $(LIBS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- CFLAGS = @CFLAGS@
- DIST_SOURCES = $(clamav_milter_SOURCES)
-
-@@ -209,7 +209,7 @@
- -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
- clamav-milter$(EXEEXT): $(clamav_milter_OBJECTS) $(clamav_milter_DEPENDENCIES)
- @rm -f clamav-milter$(EXEEXT)
-- $(LINK) $(clamav_milter_LDFLAGS) $(clamav_milter_OBJECTS) $(clamav_milter_LDADD) $(LIBS)
-+ $(LINK) $(clamav_milter_LDFLAGS) $(clamav_milter_OBJECTS) $(clamav_milter_LDADD)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
diff --git a/security/clamav/files/patch-clamd::Makefile.in b/security/clamav/files/patch-clamd::Makefile.in
deleted file mode 100644
index 4f98104fc06..00000000000
--- a/security/clamav/files/patch-clamd::Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- clamd/Makefile.in.orig Fri Nov 21 17:07:49 2003
-+++ clamd/Makefile.in Fri Nov 21 17:10:33 2003
-@@ -181,7 +181,7 @@
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- CCLD = $(CC)
- LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-+ $(LIBS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- CFLAGS = @CFLAGS@
- DIST_SOURCES = $(clamd_SOURCES)
- DIST_COMMON = Makefile.am Makefile.in
-@@ -225,7 +225,7 @@
- -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
- clamd$(EXEEXT): $(clamd_OBJECTS) $(clamd_DEPENDENCIES)
- @rm -f clamd$(EXEEXT)
-- $(LINK) $(clamd_LDFLAGS) $(clamd_OBJECTS) $(clamd_LDADD) $(LIBS)
-+ $(LINK) $(clamd_LDFLAGS) $(clamd_OBJECTS) $(clamd_LDADD)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
diff --git a/security/clamav/files/patch-clamdscan::Makefile.in b/security/clamav/files/patch-clamdscan::Makefile.in
deleted file mode 100644
index f612bdcfdd1..00000000000
--- a/security/clamav/files/patch-clamdscan::Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- clamdscan/Makefile.in.orig Fri Nov 21 17:14:13 2003
-+++ clamdscan/Makefile.in Fri Nov 21 17:14:45 2003
-@@ -156,7 +156,7 @@
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- CCLD = $(CC)
- LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-+ $(LIBS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- CFLAGS = @CFLAGS@
- DIST_SOURCES = $(clamdscan_SOURCES)
- DIST_COMMON = Makefile.am Makefile.in
-@@ -200,7 +200,7 @@
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
- clamdscan$(EXEEXT): $(clamdscan_OBJECTS) $(clamdscan_DEPENDENCIES)
- @rm -f clamdscan$(EXEEXT)
-- $(LINK) $(clamdscan_LDFLAGS) $(clamdscan_OBJECTS) $(clamdscan_LDADD) $(LIBS)
-+ $(LINK) $(clamdscan_LDFLAGS) $(clamdscan_OBJECTS) $(clamdscan_LDADD)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
diff --git a/security/clamav/files/patch-clamscan::Makefile.in b/security/clamav/files/patch-clamscan::Makefile.in
deleted file mode 100644
index b9559bd919b..00000000000
--- a/security/clamav/files/patch-clamscan::Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- clamscan/Makefile.in.orig Fri Nov 21 17:03:08 2003
-+++ clamscan/Makefile.in Fri Nov 21 17:04:35 2003
-@@ -163,7 +163,7 @@
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- CCLD = $(CC)
- LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-+ $(LIBS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- CFLAGS = @CFLAGS@
- DIST_SOURCES = $(clamscan_SOURCES)
- DIST_COMMON = Makefile.am Makefile.in
-@@ -207,7 +207,7 @@
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
- clamscan$(EXEEXT): $(clamscan_OBJECTS) $(clamscan_DEPENDENCIES)
- @rm -f clamscan$(EXEEXT)
-- $(LINK) $(clamscan_LDFLAGS) $(clamscan_OBJECTS) $(clamscan_LDADD) $(LIBS)
-+ $(LINK) $(clamscan_LDFLAGS) $(clamscan_OBJECTS) $(clamscan_LDADD)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
diff --git a/security/clamav/files/patch-configure b/security/clamav/files/patch-configure
index ab505db6d68..91f768e7b97 100644
--- a/security/clamav/files/patch-configure
+++ b/security/clamav/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig Thu Feb 19 14:18:40 2004
-+++ configure Thu Feb 19 14:19:31 2004
-@@ -9317,7 +9317,7 @@
+--- configure.orig Mon Mar 15 21:04:49 2004
++++ configure Thu Apr 1 14:56:36 2004
+@@ -9329,7 +9329,7 @@
@@ -9,7 +9,7 @@
INSTALL_CLAMAV_CONF_TRUE=
INSTALL_CLAMAV_CONF_FALSE='#'
else
-@@ -9327,7 +9327,7 @@
+@@ -9339,7 +9339,7 @@
@@ -18,11 +18,3 @@
INSTALL_FRESHCLAM_CONF_TRUE=
INSTALL_FRESHCLAM_CONF_FALSE='#'
else
-@@ -9564,6 +9564,7 @@
- cat >conftest.$ac_ext <<_ACEOF
- #line $LINENO "configure"
- #include "confdefs.h"
-+#include <sys/types.h>
- #include <netinet/in.h>
- int main(int argc, char **argv) { in_port_t pt; pt = 0; return pt; }
- _ACEOF
diff --git a/security/clamav/files/patch-freshclam::Makefile.in b/security/clamav/files/patch-freshclam::Makefile.in
deleted file mode 100644
index cca90c88247..00000000000
--- a/security/clamav/files/patch-freshclam::Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- freshclam/Makefile.in.orig Fri Nov 21 17:15:56 2003
-+++ freshclam/Makefile.in Fri Nov 21 17:16:27 2003
-@@ -161,7 +161,7 @@
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- CCLD = $(CC)
- LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-+ $(LIBS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- CFLAGS = @CFLAGS@
- DIST_SOURCES = $(freshclam_SOURCES)
- DIST_COMMON = Makefile.am Makefile.in
-@@ -205,7 +205,7 @@
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
- freshclam$(EXEEXT): $(freshclam_OBJECTS) $(freshclam_DEPENDENCIES)
- @rm -f freshclam$(EXEEXT)
-- $(LINK) $(freshclam_LDFLAGS) $(freshclam_OBJECTS) $(freshclam_LDADD) $(LIBS)
-+ $(LINK) $(freshclam_LDFLAGS) $(freshclam_OBJECTS) $(freshclam_LDADD)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
diff --git a/security/clamav/files/patch-sigtool::Makefile.in b/security/clamav/files/patch-sigtool::Makefile.in
deleted file mode 100644
index 7b720958198..00000000000
--- a/security/clamav/files/patch-sigtool::Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- sigtool/Makefile.in.orig Fri Nov 21 17:12:10 2003
-+++ sigtool/Makefile.in Fri Nov 21 17:13:13 2003
-@@ -149,7 +149,7 @@
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- CCLD = $(CC)
- LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-+ $(LIBS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
- CFLAGS = @CFLAGS@
- DIST_SOURCES = $(sigtool_SOURCES)
- DIST_COMMON = Makefile.am Makefile.in
-@@ -193,7 +193,7 @@
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
- sigtool$(EXEEXT): $(sigtool_OBJECTS) $(sigtool_DEPENDENCIES)
- @rm -f sigtool$(EXEEXT)
-- $(LINK) $(sigtool_LDFLAGS) $(sigtool_OBJECTS) $(sigtool_LDADD) $(LIBS)
-+ $(LINK) $(sigtool_LDFLAGS) $(sigtool_OBJECTS) $(sigtool_LDADD)
-
- mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
diff --git a/security/clamav/pkg-deinstall b/security/clamav/pkg-deinstall
index fa1db68a692..20721201529 100644
--- a/security/clamav/pkg-deinstall
+++ b/security/clamav/pkg-deinstall
@@ -5,9 +5,9 @@ if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
-USER=clamav
+CLAMAVUSER=%%CLAMAVUSER%%
-if pw usershow "${USER}" 2>/dev/null 1>&2; then
- echo "To delete ${USER} user permanently, use 'pw userdel \"${USER}\"'"
+if pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then
+ echo "To delete ${CLAMAVUSER} user permanently, use 'pw userdel \"${CLAMAVUSER}\"'"
fi
exit 0
diff --git a/security/clamav/pkg-descr b/security/clamav/pkg-descr
index 0850cba4e5f..2e0cdab83ca 100644
--- a/security/clamav/pkg-descr
+++ b/security/clamav/pkg-descr
@@ -4,4 +4,4 @@ viruses, scans compressed files and supported by AMaViS.
Optionally you can use the clamav-milter interface to connect
clamav with sendmail.
-WWW: http://clamav.sourceforge.net/
+WWW: http://www.clamav.net/
diff --git a/security/clamav/pkg-install b/security/clamav/pkg-install
index c9f494173ec..5024534ac2e 100644
--- a/security/clamav/pkg-install
+++ b/security/clamav/pkg-install
@@ -3,46 +3,52 @@
PREFIX=${PKG_PREFIX:-%%PREFIX%%}
-USER=clamav
-GROUP=clamav
+CLAMAVUSER=%%CLAMAVUSER%%
+CLAMAVGROUP=%%CLAMAVGROUP%%
CLAMRUN=/var/run/clamav
CLAMLOG=/var/log/clamav
+DATADIR=%%DATADIR%%
if [ "$2" = "PRE-INSTALL" ]; then
- if ! pw groupshow "$GROUP" 2>/dev/null 1>&2; then
- if pw groupadd $GROUP; then
- echo "=> Added group \"$GROUP\"."
+ 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
- if ! pw usershow "$USER" 2>/dev/null 1>&2; then
- if pw useradd $USER -g $GROUP -h - \
+ if ! pw usershow "$CLAMAVUSER" 2>/dev/null 1>&2; then
+ if pw useradd $CLAMAVUSER -g $CLAMAVGROUP -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "Clam Antivirus"; \
then
- pw groupmod mail -m $USER
- echo "=> Added user \"$USER\"."
+ pw groupmod mail -m $CLAMAVUSER
+ echo "=> Added user \"$CLAMAVUSER\"."
else
- echo "=> Adding user \"$USER\" failed..."
+ echo "=> Adding user \"$CLAMAVUSER\" failed..."
exit 1
fi
fi
elif [ "$2" = "POST-INSTALL" ]; then
- if [ ! -d "${CLAMRUN}" ]; then
+ if [ ! -d "$CLAMRUN" ]; then
mkdir -p "$CLAMRUN" || exit 1
- chown "$USER:$GROUP" "$CLAMRUN" || exit 1
+ chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMRUN" || exit 1
fi
- if [ ! -d "${CLAMLOG}" ]; then
+ if [ ! -d "$CLAMLOG" ]; then
mkdir -p "$CLAMLOG" || exit 1
- chown "$USER:$GROUP" "$CLAMLOG" || exit 1
+ chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMLOG" || exit 1
+ fi
+
+ if [ ! -d "${DATADIR}" ]; then
+ mkdir -p "$DATADIR" || exit 1
+ chown "$CLAMAVUSER:$CLAMAVGROUP" "$DATADIR" || exit 1
fi
fi
diff --git a/security/clamav/pkg-plist b/security/clamav/pkg-plist
index 83671904d94..e5d7174a6b1 100644
--- a/security/clamav/pkg-plist
+++ b/security/clamav/pkg-plist
@@ -4,6 +4,8 @@ bin/clamscan
bin/clamdscan
bin/freshclam
bin/sigtool
+etc/rc.d/clamav-clamd%%RC_SUFX%%
+etc/rc.d/clamav-freshclam%%RC_SUFX%%
%%CLAMAV-MILTER%%etc/rc.d/clamav-milter%%RC_SUFX%%
%%CLAMAV-MILTER%%sbin/clamav-milter
sbin/clamd
@@ -17,16 +19,8 @@ etc/clamav.conf.default
@unexec if cmp -s %D/etc/freshclam.conf %D/etc/freshclam.conf.default; then rm -f %D/etc/freshclam.conf; fi
etc/freshclam.conf.default
@exec [ -f %B/freshclam.conf ] || cp %B/%f %B/freshclam.conf
-etc/rc.d/clamav-clamd%%RC_SUFX%%
-etc/rc.d/clamav-freshclam%%RC_SUFX%%
-%%PORTDOCS%%%%DOCSDIR%%/NEWS
-%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@owner clamav
-@group clamav
-%%DATADIR%%/daily.cvd
-%%DATADIR%%/main.cvd
-@exec chown clamav:clamav %B
+@unexec rm -f %D/%%DATADIR%%/daily.cvd || true
+@unexec rm -f %D/%%DATADIR%%/main.cvd || true
@dirrm %%DATADIR%%
@unexec rmdir /var/run/clamav 2>/dev/null || true
@unexec rmdir /var/log/clamav 2>/dev/null || true