diff options
author | Greg Lewis <glewis@FreeBSD.org> | 2004-02-03 06:46:21 +0000 |
---|---|---|
committer | Greg Lewis <glewis@FreeBSD.org> | 2004-02-03 06:46:21 +0000 |
commit | dfcb3af5b8f61761317df79fc7f5cffe4a57db09 (patch) | |
tree | e91db1c2025f4f6e566f789524685e6fc5534519 /security/clamav | |
parent | . Add a pkg-deinstall script telling people how they can get rid of the (diff) |
1. Add a freshclam rc.d script to start freshclam so the AV database is
updated periodically. Loosely based on the script in the PR.
2. Reorder some operations in the various Makefile targets.
3. Bump PORTREVISION.
PR: 61966 [1]
Submitted by: Douglas K. Rand <rand@meridian-enviro.com>
Notes
Notes:
svn path=/head/; revision=99866
Diffstat (limited to 'security/clamav')
-rw-r--r-- | security/clamav/Makefile | 14 | ||||
-rw-r--r-- | security/clamav/files/clamav-freshclam.sh | 36 | ||||
-rw-r--r-- | security/clamav/pkg-plist | 1 |
3 files changed, 48 insertions, 3 deletions
diff --git a/security/clamav/Makefile b/security/clamav/Makefile index 82ca6d3228c6..eedd186336c2 100644 --- a/security/clamav/Makefile +++ b/security/clamav/Makefile @@ -7,7 +7,7 @@ PORTNAME= clamav PORTVERSION= 0.65 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= security MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= clamav @@ -102,24 +102,32 @@ post-build: @${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL} @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \ >${WRKDIR}/clamav-clamd.sh + @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-freshclam.sh \ + >${WRKDIR}/clamav-freshclam.sh +.if defined(WITH_MILTER) @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \ >${WRKDIR}/clamav-milter.sh +.endif pre-install: @${SETENV} PKG_PREFIX=${PREFIX} \ ${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL post-install: + @${INSTALL_DATA} ${BUILD_WRKSRC}/etc/clamav.conf.default \ + ${PREFIX}/etc/clamav.conf.default @${INSTALL_SCRIPT} ${WRKDIR}/clamav-clamd.sh \ ${RC_DIR}/clamav-clamd${RC_SUFX} + @${INSTALL_SCRIPT} ${WRKDIR}/clamav-freshclam.sh \ + ${RC_DIR}/clamav-freshclam${RC_SUFX} @${CHOWN} -R clamav:clamav ${DATADIR} @[ -f ${PREFIX}/etc/clamav.conf ] || \ ${CP} ${PREFIX}/etc/clamav.conf.default ${PREFIX}/etc/clamav.conf - @${SETENV} PKG_PREFIX=${PREFIX} \ - ${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL .if defined(WITH_MILTER) @${INSTALL_SCRIPT} ${WRKDIR}/clamav-milter.sh \ ${RC_DIR}/clamav-milter${RC_SUFX} .endif + @${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL .include <bsd.port.post.mk> diff --git a/security/clamav/files/clamav-freshclam.sh b/security/clamav/files/clamav-freshclam.sh new file mode 100644 index 000000000000..ea87bd583c50 --- /dev/null +++ b/security/clamav/files/clamav-freshclam.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: freshclam +# REQUIRE: LOGIN +# BEFORE: mail +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable freshclam: +# +#clamav_freshclam_enable="YES" +# +# See freshclam(8) for flags +# + +. %%RC_SUBR%% + +name=clamav_freshclam +rcvar=`set_rcvar` + +command=%%PREFIX%%/bin/freshclam +required_dirs=%%DATADIR%% + +# set defaults + +clamav_freshclam_enable=${clamav_freshclam_enable:-"NO"} +clamav_freshclam_flags=${clamav_freshclam_flags:-"--checks=1 --datadir=%%DATADIR%% --daemon-notify=%%PREFIX%%/etc/clamav.conf --log=/var/log/clamav/freshclam.log"} + +load_rc_config $name + +# add --daemon to any given arguments +clamav_freshclam_flags="${clamav_freshclam_flags} --daemon" +run_rc_command "$1" diff --git a/security/clamav/pkg-plist b/security/clamav/pkg-plist index a12af6b1d7fd..552820d185c6 100644 --- a/security/clamav/pkg-plist +++ b/security/clamav/pkg-plist @@ -15,6 +15,7 @@ lib/libclamav.a etc/clamav.conf.default @exec [ -f %B/clamav.conf ] || cp %B/%f %B/clamav.conf etc/rc.d/clamav-clamd%%RC_SUFX%% +etc/rc.d/clamav-freshclam%%RC_SUFX%% @owner clamav @group clamav %%DATADIR%%/daily.cvd |