summaryrefslogtreecommitdiff
path: root/security/uvscan
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2002-08-07 05:42:12 +0000
committerjlam <jlam@pkgsrc.org>2002-08-07 05:42:12 +0000
commitb23b831acc5f3fa3af35dbe13d151170186b78b3 (patch)
tree9ee40362de39f23fe0c1595bb669367f854f64a0 /security/uvscan
parent3700725038f93920c71da10699456dc7a08d2895 (diff)
downloadpkgsrc-b23b831acc5f3fa3af35dbe13d151170186b78b3.tar.gz
Merge security/uvscan-dat into security/uvscan. The uvscan-dat package is
out-of-date very frequently, and it's sole purpose seems to be to provide the uvscan package with the update_dat script so that uvscan can keep up-to-date with the latest virus definitions. A MESSAGE file has been added to security/uvscan that recommends running "update_dat" to update the virus definitions database to the most recent version after installation. The update_dat script has also been rewritten to allow the new syntax "update -f <DATFILE>" to update from an already- downloaded DATFILE, so users will still be able to do bulk downloads to removable media on a machine with a fat connection and be able to compile and install a usable uvscan package on another machine. Bump the PKGREVISION on uvscan to 1 and mark the CONFLICT with the obsolete uvscan-dat packages.
Diffstat (limited to 'security/uvscan')
-rw-r--r--security/uvscan/DEINSTALL11
-rw-r--r--security/uvscan/MESSAGE8
-rw-r--r--security/uvscan/Makefile37
-rw-r--r--security/uvscan/PLIST8
-rw-r--r--security/uvscan/files/update_dat.sh91
5 files changed, 146 insertions, 9 deletions
diff --git a/security/uvscan/DEINSTALL b/security/uvscan/DEINSTALL
new file mode 100644
index 00000000000..3f86f51d77d
--- /dev/null
+++ b/security/uvscan/DEINSTALL
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# $NetBSD: DEINSTALL,v 1.1 2002/08/07 05:42:13 jlam Exp $
+
+UVSCANDIR=@UVSCANDIR@
+
+case ${STAGE} in
+POST-DEINSTALL)
+ ${RM} -rf ${UVSCANDIR}
+ ;;
+esac
diff --git a/security/uvscan/MESSAGE b/security/uvscan/MESSAGE
new file mode 100644
index 00000000000..cfcf073935d
--- /dev/null
+++ b/security/uvscan/MESSAGE
@@ -0,0 +1,8 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.1 2002/08/07 05:42:13 jlam Exp $
+
+The VirusScan data files may be initially fetched or updated to the latest
+versions from the Network Associates Website (www.nai.com) by running
+"update_dat". It is recommended that "update_dat" be run on a regular
+basis.
+===========================================================================
diff --git a/security/uvscan/Makefile b/security/uvscan/Makefile
index 3c44260326c..7e51cc60bb9 100644
--- a/security/uvscan/Makefile
+++ b/security/uvscan/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.13 2002/04/04 12:29:50 tron Exp $
+# $NetBSD: Makefile,v 1.14 2002/08/07 05:42:13 jlam Exp $
DISTNAME= vlnx416e
PKGNAME= uvscan-4.16.0
+PKGREVISION= 1
CATEGORIES= security
MASTER_SITES= http://download.nai.com/products/evaluation/virusscan/english/cmdline/linux/version_4.16/
EXTRACT_SUFX= .tar.Z
@@ -10,11 +11,11 @@ MAINTAINER= packages@netbsd.org
HOMEPAGE= http://www.mcafeeb2b.com/products/virusscan/default.asp
COMMENT= evaluation version of a DOS/Windows file virus scanner
+CONFLICTS= uvscan-dat-[0-9]*
+
DEPENDS+= suse_compat>=6.1:../../emulators/${SUSE_DIR_PREFIX}_compat
-DEPENDS+= uvscan-dat>=4171:../../security/uvscan-dat
ONLY_FOR_PLATFORM= NetBSD-*-i386
-NO_BUILD= YES
CHECK_SHLIBS= NO
LICENSE= shareware
@@ -26,18 +27,32 @@ NO_SRC_ON_CDROM= ${RESTRICTED}
WRKSRC= ${WRKDIR}
DOCDIR= ${PREFIX}/share/doc/uvscan
+DATDIR= ${PREFIX}/share/uvscan
UVSCANDIR= ${PREFIX}/libexec/uvscan
+DATFILES= clean.dat internet.dat names.dat scan.dat readme.txt
+
+FILES_SUBST+= UVSCANDIR=${UVSCANDIR:Q}
+FILES_SUBST+= DATFILES=${DATFILES:Q}
+
+DEINSTALL_EXTRA_TMPL= ${.CURDIR}/DEINSTALL
+SUPPORT_FILES= ${DATDIR}/clean.dat ${UVSCANDIR}/clean.dat
+SUPPORT_FILES+= ${DATDIR}/names.dat ${UVSCANDIR}/names.dat
+SUPPORT_FILES+= ${DATDIR}/scan.dat ${UVSCANDIR}/scan.dat
+SUPPORT_FILES+= ${DATDIR}/readme.txt ${UVSCANDIR}/readme.txt
+OWN_DIRS= ${UVSCANDIR}
-do-configure:
- ${SED} -e "s|@PREFIX@|${PREFIX}|g" \
- ${FILESDIR}/uvscan.sh > ${WRKDIR}/uvscan.sh
+do-build:
+ @${SED} ${FILES_SUBST_SED} \
+ ${FILESDIR}/update_dat.sh > ${WRKDIR}/update_dat
do-install:
- ${INSTALL_SCRIPT} ${WRKDIR}/uvscan.sh ${PREFIX}/bin/uvscan
+ ${INSTALL_SCRIPT} ${WRKDIR}/update_dat ${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/uvscan.1 ${PREFIX}/man/man1
${INSTALL_PROGRAM_DIR} ${UVSCANDIR}
${INSTALL_SCRIPT} ${WRKSRC}/uvscan ${UVSCANDIR}
+ ${RM} -f ${PREFIX}/bin/uvscan
+ ${LN} -sf ../${UVSCANDIR:S/${PREFIX}\///}/uvscan ${PREFIX}/bin/uvscan
${INSTALL_DATA} ${WRKSRC}/liblnxfv.so.4 ${UVSCANDIR}
${RM} -f ${UVSCANDIR}/liblnxfv.so
${LN} -s liblnxfv.so.4 ${UVSCANDIR}/liblnxfv.so
@@ -49,10 +64,16 @@ do-install:
for file in license.dat messages.dat; do \
${INSTALL_DATA} ${WRKSRC}/$${file} ${UVSCANDIR}; \
done
+ ${INSTALL_DATA_DIR} ${DATDIR}
+ for file in ${DATFILES}; do \
+ if [ -f ${WRKSRC}/$${file} ]; then \
+ ${INSTALL_DATA} ${WRKSRC}/$${file} ${DATDIR}; \
+ fi; \
+ done
${INSTALL_DATA_DIR} ${DOCDIR}
for file in contact.txt license.txt unxadmin.pdf; do \
${INSTALL_DATA} ${WRKSRC}/$${file} ${DOCDIR}; \
done
+.include "../../mk/bsd.pkg.install.mk"
.include "../../emulators/suse_linux/Makefile.application"
-
diff --git a/security/uvscan/PLIST b/security/uvscan/PLIST
index 0b93f57be32..233f53ce278 100644
--- a/security/uvscan/PLIST
+++ b/security/uvscan/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.2 2001/12/13 06:53:16 jlam Exp $
+@comment $NetBSD: PLIST,v 1.3 2002/08/07 05:42:14 jlam Exp $
bin/uvscan
emul/linux/usr/local/lib/liblnxfv.so
emul/linux/usr/local/lib/liblnxfv.so.4
@@ -8,6 +8,12 @@ libexec/uvscan/liblnxfv.so.4
libexec/uvscan/license.dat
libexec/uvscan/messages.dat
man/man1/uvscan.1
+sbin/update_dat
share/doc/uvscan/contact.txt
share/doc/uvscan/license.txt
share/doc/uvscan/unxadmin.pdf
+share/uvscan/clean.dat
+share/uvscan/names.dat
+share/uvscan/readme.txt
+share/uvscan/scan.dat
+@dirrm share/uvscan
diff --git a/security/uvscan/files/update_dat.sh b/security/uvscan/files/update_dat.sh
new file mode 100644
index 00000000000..540404d59de
--- /dev/null
+++ b/security/uvscan/files/update_dat.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+
+UVSCANDIR="@UVSCANDIR@"
+DAT_SITE="ftp://ftp.nai.com/pub/datfiles/english/"
+DAT_FILES="@DATFILES@"
+TMPDIR="${TMPDIR:-/tmp}/$$"
+
+AWK="@AWK@"
+BASENAME="@BASENAME@"
+CP="@CP@"
+ECHO="@ECHO@"
+GREP="@GREP@"
+GTAR="@GTAR@"
+MKDIR="@MKDIR@"
+MV="@MV@"
+RM="@RM@"
+SED="@SED@"
+
+progname=`${BASENAME} $0`
+
+while getopts vf: arg; do
+ case $arg in
+ v) verbose=1 ;;
+ f) dat_tar="${OPTARG}" ;;
+ esac
+done
+
+${MKDIR} ${TMPDIR}
+
+if [ -n "$dat_tar" ]; then
+ if ! (${GTAR} -x -C ${TMPDIR} -f $dat_tar readme.txt >/dev/null); then
+ ${ECHO} "$progname: unable to extract readme.txt"
+ ${RM} -rf ${TMPDIR}
+ exit 1
+ fi
+else
+ # Fetch the ReadMe file to read the latest version of the DAT files.
+ if ! (cd ${TMPDIR}; ftp ${DAT_SITE}readme.txt >/dev/null); then
+ ${ECHO} "$progname: unable to fetch ${DAT_SITE}readme.txt"
+ ${RM} -rf ${TMPDIR}
+ exit 1
+ fi
+fi
+
+curver=`${AWK} '/DAT Version/ { print $4; exit }' ${TMPDIR}/readme.txt | ${SED} -e 's/^.*\([0-9][0-9][0-9][0-9]\).*$/\1/'`
+oldver=`${AWK} '/DAT Version/ { print $4; exit }' ${UVSCANDIR}/readme.txt | ${SED} -e 's/^.*\([0-9][0-9][0-9][0-9]\).*$/\1/'`
+
+if [ $curver -le $oldver ]; then
+ if [ -z "$verbose" ]; then
+ ${ECHO} "$progname: VirusScan DAT files are current ($oldver)"
+ fi
+else
+ if [ -z "$dat_tar" ]; then
+ dat_tar=${DAT_SITE}dat-$curver.tar
+ if (cd ${TMPDIR}; ftp $dat_tar >/dev/null); then
+ dat_tar=${TMPDIR}/dat-$curver.tar
+ else
+ ${ECHO} "$progname: unable to fetch $dat_tar"
+ ${RM} -rf ${TMPDIR}
+ exit 1
+ fi
+ fi
+
+ ${GTAR} -x -C ${TMPDIR} -f $dat_tar
+
+ # Backup old dat-* tar files.
+ if [ "`${ECHO} ${UVSCANDIR}/*.tar`" != "${UVSCANDIR}/*.tar" ]; then
+ for file in ${UVSCANDIR}/*.tar; do
+ ${MV} -f $file $file.old
+ done
+ fi
+
+ # Backup old DAT files.
+ for file in ${DAT_FILES}; do
+ file=${UVSCANDIR}/$file
+ if [ -f $file ]; then
+ ${MV} -f $file $file.bak
+ fi
+ done
+
+ # Copy new DAT files into place.
+ for file in ${DAT_FILES}; do
+ ${CP} -f ${TMPDIR}/$file ${UVSCANDIR}/$file
+ done
+ ${CP} -f $dat_tar ${UVSCANDIR}
+ ${RM} -f ${UVSCANDIR}/*.old
+ ${ECHO} `date` Successfully updated VirusScan DAT files to $curver.
+fi
+
+${RM} -rf ${TMPDIR}
+exit 0