aboutsummaryrefslogtreecommitdiffstats
path: root/security/vscan
diff options
context:
space:
mode:
authorjeh <jeh@FreeBSD.org>2006-05-09 20:08:51 +0800
committerjeh <jeh@FreeBSD.org>2006-05-09 20:08:51 +0800
commitcb254176c878c6726e13bffaf14e76e42b85359e (patch)
tree3b28336726e0098db386f89ecc6b625d3c4fc5f3 /security/vscan
parent9c6488dcc8f2ac82731bca6546728df34494930e (diff)
downloadfreebsd-ports-gnome-cb254176c878c6726e13bffaf14e76e42b85359e.tar.gz
freebsd-ports-gnome-cb254176c878c6726e13bffaf14e76e42b85359e.tar.zst
freebsd-ports-gnome-cb254176c878c6726e13bffaf14e76e42b85359e.zip
Since the DAT files are so short lived on the server, have this port
automatically fetch the current DAT file. The uvscan-dat port will be removed shortly.
Diffstat (limited to 'security/vscan')
-rw-r--r--security/vscan/Makefile13
-rw-r--r--security/vscan/files/update_dat31
-rw-r--r--security/vscan/pkg-message3
-rw-r--r--security/vscan/pkg-plist2
4 files changed, 45 insertions, 4 deletions
diff --git a/security/vscan/Makefile b/security/vscan/Makefile
index 42dbf2ac5e2c..143476dfd52b 100644
--- a/security/vscan/Makefile
+++ b/security/vscan/Makefile
@@ -7,7 +7,7 @@
PORTNAME= uvscan
PORTVERSION= 4.40e
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://download.nai.com/products/evaluation/virusscan/english/cmdline/bsd/v4.40/
DISTNAME= vbsd440e
@@ -16,7 +16,6 @@ EXTRACT_SUFX= .tar.Z
MAINTAINER= jeh@FreeBSD.org
COMMENT= Evaluation version of a DOS/Windows/Linux file virus scanner
-RUN_DEPENDS+= ${LOCALBASE}/sbin/update_dat:${PORTSDIR}/security/uvscan-dat
# misc/compat3x is forbidden, but if it is compiled into the system
# we may still be good to go.
LIB_DEPENDS+= c.3:${PORTSDIR}/misc/compat3x
@@ -40,8 +39,11 @@ PROGFILES= contact.txt license.dat license.txt messages.dat \
do-configure:
${SED} <${FILESDIR}/uvscan.sh >${WRKSRC}/uvscan.sh \
-e 's:@@PREFIX@@:${PREFIX}:g'
+ ${SED} -e 's:@PREFIX@:${PREFIX}:g' \
+ <${FILESDIR}/update_dat >${WRKDIR}/update_dat
do-install:
+ ${MKDIR} ${PREFIX}/libexec/uvscan
${INSTALL_SCRIPT} ${WRKSRC}/uvscan ${PREFIX}/libexec/uvscan
${INSTALL_SCRIPT} ${WRKSRC}/uvscan.sh ${PREFIX}/bin/uvscan
${INSTALL_SCRIPT} ${WRKSRC}/uvscan_secure ${PREFIX}/bin
@@ -58,9 +60,12 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/${filename} ${DOCSDIR}
.endfor
.endif
+ ${INSTALL_SCRIPT} ${WRKDIR}/update_dat ${PREFIX}/sbin
+ @${CAT} ${PKGMESSAGE}
post-install:
- ${LN} -sf ${PREFIX}/lib/libbsdfv.so.4 \
- ${PREFIX}/lib/libbsdfv.so
+ ${LN} -sf ${PREFIX}/lib/libbsdfv.so.4 ${PREFIX}/lib/libbsdfv.so
+ ${ECHO_CMD} "Trying to fetch the current DAT file"
+ ${SH} ${PREFIX}/sbin/update_dat
.include <bsd.port.mk>
diff --git a/security/vscan/files/update_dat b/security/vscan/files/update_dat
new file mode 100644
index 000000000000..29283944a82e
--- /dev/null
+++ b/security/vscan/files/update_dat
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $Id$
+#
+cd @PREFIX@/libexec/uvscan/
+
+# Force a low default and then get the current version's value
+cur_AVVER="1"
+if [ -f "file_id.diz" ]; then
+ cur_AVVER="`tail -1 file_id.diz | sed -e 's/^(\(4[0-9]*\)).*$/\1/'`"
+fi
+
+# Find what the website has for the current version
+fetch -q http://download.nai.com/products/datfiles/4.x/nai/update.ini || exit 1
+AVVER="`grep DATVersion update.ini | head -1 | cut -f2 -d= | sed -e 's/^\(4[0-9]*\).$/\1/'`"
+rm -f update.ini
+
+# Check to make sure the requested version is "newer" then the current
+if [ "$cur_AVVER" -lt "$AVVER" ]; then
+ for i in *.tar ; do
+ [ -f "$i" ] && mv $i $i.old
+ done
+ fetch -q http://download.nai.com/products/datfiles/4.x/nai/dat-$AVVER.tar || exit 1
+ for i in *.dat ; do
+ [ -f "$i" ] && cp -p $i $i.bak
+ done
+ tar xf dat-$AVVER.tar || exit 1
+ rm -f *.old
+ echo "`date` Successfully updated AntiVirus DAT files to $AVVER"
+fi
+exit 0
diff --git a/security/vscan/pkg-message b/security/vscan/pkg-message
new file mode 100644
index 000000000000..65592d117852
--- /dev/null
+++ b/security/vscan/pkg-message
@@ -0,0 +1,3 @@
+NOTE: The update_dat script is useful for automatically downloading
+the latest version of the virus definitions without waiting for the
+port to be updated.
diff --git a/security/vscan/pkg-plist b/security/vscan/pkg-plist
index f57ab18094f2..dc4d4db89912 100644
--- a/security/vscan/pkg-plist
+++ b/security/vscan/pkg-plist
@@ -1,6 +1,7 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2000/06/05 12:01:25 rh Exp $
bin/uvscan
bin/uvscan_secure
+sbin/update_dat
lib/libbsdfv.so.4
libexec/uvscan/contact.txt
libexec/uvscan/license.dat
@@ -8,3 +9,4 @@ libexec/uvscan/license.txt
libexec/uvscan/messages.dat
libexec/uvscan/signlic.txt
libexec/uvscan/uvscan
+@dirrm libexec/uvscan