ports/144509: [NEW PORT] security/clamav-unofficial-sigs - Update script for third-party ClamAV databases

Marko Njezic mrmax063 at maxempire.com
Sat Mar 6 17:50:04 UTC 2010


>Number:         144509
>Category:       ports
>Synopsis:       [NEW PORT] security/clamav-unofficial-sigs - Update script for third-party ClamAV databases
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 06 17:50:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Marko Njezic
>Release:        8.0-RELEASE-p2
>Organization:
MAX Interactive corp.
>Environment:
FreeBSD vmbsd 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Jan 5 16:02:27 UTC 2010 root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
>Description:
The clamav-unofficial-sigs script provides the capability to download, test, and update the third-party ClamAV signature databases provided by Sanesecurity, SecuriteInfo, MalwarePatrol, OITC, INetMsg and ScamNailer.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	clamav-unofficial-sigs/
#	clamav-unofficial-sigs/pkg-descr
#	clamav-unofficial-sigs/Makefile
#	clamav-unofficial-sigs/pkg-plist
#	clamav-unofficial-sigs/distinfo
#	clamav-unofficial-sigs/files
#	clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh
#	clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.conf
#	clamav-unofficial-sigs/files/patch-clamd-status.sh
#	clamav-unofficial-sigs/files/pkg-message.in
#	clamav-unofficial-sigs/pkg-deinstall
#
echo c - clamav-unofficial-sigs/
mkdir -p clamav-unofficial-sigs/ > /dev/null 2>&1
echo x - clamav-unofficial-sigs/pkg-descr
sed 's/^X//' >clamav-unofficial-sigs/pkg-descr << '1abbff3c470c9a0d63e1be9ff3a1167e'
XThe clamav-unofficial-sigs script provides the capability to download, test,
Xand update the third-party ClamAV signature databases provided by
XSanesecurity, SecuriteInfo, MalwarePatrol, OITC, INetMsg and ScamNailer.
1abbff3c470c9a0d63e1be9ff3a1167e
echo x - clamav-unofficial-sigs/Makefile
sed 's/^X//' >clamav-unofficial-sigs/Makefile << 'c09ee4fd4d3d90b5f73f60c13d7a90e9'
X# New ports collection makefile for:	clamav-unofficial-sigs
X# Date created:		2010-03-06
X# Whom:			Marko Njezic <sf at maxempire.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	clamav-unofficial-sigs
XPORTVERSION=	3.7
XCATEGORIES=	security
XMASTER_SITES=	http://www.inetmsg.com/pub/ \
X		http://www.inetmsg.com/pub/archive/
X
XMAINTAINER=	sf at maxempire.com
XCOMMENT=	Update script for third-party ClamAV databases
X
XRUN_DEPENDS=	clamscan:${PORTSDIR}/security/clamav \
X		rsync:${PORTSDIR}/net/rsync \
X		curl:${PORTSDIR}/ftp/curl \
X		gpg:${PORTSDIR}/security/gnupg
X
XUSE_PERL5_RUN=	yes
XNO_BUILD=	yes
X
XSUB_FILES=	pkg-message
X
XMAN8=		clamav-unofficial-sigs.8
XMANCOMPRESSED=	no
X
XSED_CONF=	-e 's|%%CLAM_DBS%%|/var/db/clamav|g' \
X		-e 's|%%CLAMD_PID%%|/var/run/clamav/clamd.pid|g' \
X		-e 's|%%CLAMD_SOCKET%%|/var/run/clamav/clamd.sock|g' \
X		-e 's|%%START_CLAMD%%|${PREFIX}/etc/rc.d/clamav-clamd start|g' \
X		-e 's|%%WORK_DIR%%|/var/db/clamav-unofficial-sigs|g'
X
Xpost-patch:
X	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/clamav-unofficial-sigs.sh
X	@${REINPLACE_CMD} ${SED_CONF} ${WRKSRC}/clamav-unofficial-sigs.conf
X	@${REINPLACE_CMD} ${SED_CONF} ${WRKSRC}/clamd-status.sh
X
Xdo-install:
X	${INSTALL_SCRIPT} ${WRKSRC}/clamav-unofficial-sigs.sh ${PREFIX}/bin
X	${INSTALL_MAN} ${WRKSRC}/clamav-unofficial-sigs.8 ${MANPREFIX}/man/man8
X	${INSTALL_DATA} ${WRKSRC}/clamav-unofficial-sigs.conf ${PREFIX}/etc/clamav-unofficial-sigs.conf.sample
X
X.ifndef(NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}
X	cd ${WRKSRC} && ${INSTALL_DATA} CHANGELOG INSTALL LICENSE README ${DOCSDIR}
X.endif
X
X.ifndef(NOPORTEXAMPLES)
X	@${MKDIR} ${EXAMPLESDIR}
X	${INSTALL_DATA} ${WRKSRC}/clamav-unofficial-sigs-cron ${EXAMPLESDIR}
X	${INSTALL_DATA} ${WRKSRC}/clamav-unofficial-sigs-logrotate ${EXAMPLESDIR}
X	${INSTALL_SCRIPT} ${WRKSRC}/clamd-status.sh ${EXAMPLESDIR}
X.endif
X
X	@${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.mk>
c09ee4fd4d3d90b5f73f60c13d7a90e9
echo x - clamav-unofficial-sigs/pkg-plist
sed 's/^X//' >clamav-unofficial-sigs/pkg-plist << '8f0cd72bcc0538187722ee7b2ccf5b05'
Xbin/clamav-unofficial-sigs.sh
Xetc/clamav-unofficial-sigs.conf.sample
X%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
X%%PORTDOCS%%%%DOCSDIR%%/INSTALL
X%%PORTDOCS%%%%DOCSDIR%%/LICENSE
X%%PORTDOCS%%%%DOCSDIR%%/README
X%%PORTDOCS%%@dirrm %%DOCSDIR%%
X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamav-unofficial-sigs-cron
X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamav-unofficial-sigs-logrotate
X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamd-status.sh
X%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%%
8f0cd72bcc0538187722ee7b2ccf5b05
echo x - clamav-unofficial-sigs/distinfo
sed 's/^X//' >clamav-unofficial-sigs/distinfo << 'f227ecdda45a291094a83e45a05d877a'
XMD5 (clamav-unofficial-sigs-3.7.tar.gz) = 86f319c5806e6ca76d4de47e6a49a710
XSHA256 (clamav-unofficial-sigs-3.7.tar.gz) = 2dc968c76b5d06a84eb85cae490d354207b57226ac450b4bad1d92cdc83395d1
XSIZE (clamav-unofficial-sigs-3.7.tar.gz) = 36400
f227ecdda45a291094a83e45a05d877a
echo c - clamav-unofficial-sigs/files
mkdir -p clamav-unofficial-sigs/files > /dev/null 2>&1
echo x - clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh
sed 's/^X//' >clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh << 'a16e6c1272e95b282f62a82d2a546717'
X--- clamav-unofficial-sigs.sh	2010-01-24 02:38:29.000000000 +0100
X+++ clamav-unofficial-sigs.sh.patched	2010-03-06 08:52:32.000000000 +0100
X@@ -19,7 +19,7 @@
X #                                                                              #
X ################################################################################
X 
X-default_config="/etc/clamav-unofficial-sigs.conf"
X+default_config="%%PREFIX%%/etc/clamav-unofficial-sigs.conf"
X 
X version="v3.7 (updated 2010-01-23)"
X output_ver="
X@@ -407,6 +407,8 @@
X           exit
X           ;;
X       r)  no_default_config
X+          pkg_mgr="FreeBSD ports"
X+          pkg_rm="pkg_delete"
X           if [ -n "$pkg_mgr" -a -n "$pkg_rm" ]
X              then
X                 echo "  This script (clamav-unofficial-sigs) was installed on the system"
a16e6c1272e95b282f62a82d2a546717
echo x - clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.conf
sed 's/^X//' >clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.conf << '930480f6abdc8a13130f8cba5ca45ddc'
X--- clamav-unofficial-sigs.conf	2010-03-06 09:52:30.000000000 +0100
X+++ clamav-unofficial-sigs.conf.patched	2010-03-06 09:54:08.000000000 +0100
X@@ -42,10 +42,10 @@
X 
X # Set path to ClamAV database files location.  If unsure, check
X # your clamd.conf file for the "DatabaseDirectory" path setting.
X-clam_dbs="/var/lib/clamav"
X+clam_dbs="%%CLAM_DBS%%"
X 
X # Set path to clamd.pid file (see clamd.conf for path location).
X-clamd_pid="/var/run/clamd.pid"
X+clamd_pid="%%CLAMD_PID%%"
X 
X # To enable "ham" (non-spam) directory scanning and removal of
X # signatures that trigger on ham messages, uncomment the following
X@@ -76,7 +76,7 @@
X # the script will still run).  You will also need to set the correct
X # path to your clamd socket file (if unsure of the path, check the
X # "LocalSocket" setting in your clamd.conf file for socket location).
X-#clamd_socket="/var/run/clamd.socket"
X+#clamd_socket="%%CLAMD_SOCKET%%"
X 
X # If you would like to attempt to restart ClamD if detected not running,
X # uncomment the next 2 lines.  Confirm the path to the "clamd_lock" file
X@@ -86,8 +86,8 @@
X # NOTE: these 2 variables are dependant on the "clamd_socket" variable
X # shown above - if not enabled, then the following 2 variables will be
X # ignored, whether enabled or not.
X-#clamd_lock="/var/lock/subsys/clamd"
X-#start_clamd="service clamd start"
X+#clamd_lock=""
X+#start_clamd="%%START_CLAMD%%"
X 
X # Enable or disable download time randomization.  This allows the script to
X # be executed via cron, but the actual database file checking will pause
X@@ -216,7 +216,7 @@
X # Set working directory paths (edit to meet your own needs). If these
X # directories do not exist, the script will attempt to create them.
X # Top level working directory path:
X-work_dir="/usr/unofficial-dbs"   #Top level working directory
X+work_dir="%%WORK_DIR%%"   #Top level working directory
X # Sub-directory names:
X ss_dir="$work_dir/ss-dbs"        # Sanesecurity sub-directory
X si_dir="$work_dir/si-dbs"        # SecuriteInfo sub-directory
930480f6abdc8a13130f8cba5ca45ddc
echo x - clamav-unofficial-sigs/files/patch-clamd-status.sh
sed 's/^X//' >clamav-unofficial-sigs/files/patch-clamd-status.sh << 'e370cf25129fcf6eb092a75abb4510ba'
X--- clamd-status.sh	2010-01-24 02:38:29.000000000 +0100
X+++ clamd-status.sh.patched	2010-03-06 09:57:03.000000000 +0100
X@@ -24,7 +24,7 @@
X export PATH
X 
X # Set path to clamd.pid file (see clamd.conf for path location).
X-clamd_pid="/var/run/clamav/clamd.pid"
X+clamd_pid="%%CLAMD_PID%%"
X 
X # If running clamd in "LocalSocket" mode (*NOT* in TCP/IP mode), and
X # either "SOcket Cat" (socat) or the "IO::Socket::UNIX" perl module
X@@ -34,7 +34,7 @@
X # the script will still run).  You will also need to set the correct
X # path to your clamd socket file (if unsure of the path, check the
X # "LocalSocket" setting in your clamd.conf file for socket location).
X-clamd_socket="/var/run/clamav/clamd.sock"
X+clamd_socket="%%CLAMD_SOCKET%%"
X 
X # If you would like to attemtp to restart ClamD if detected not running,
X # uncomment the next 2 lines.  Confirm the path to the "clamd_lock" file
X@@ -44,8 +44,8 @@
X # NOTE: these 2 variables are dependant on the "clamd_socket" variable
X # shown above - if not enabled, then the following 2 variables will be
X # ignored, whether enabled or not.
X-clamd_lock="/var/lock/subsys/clamd"
X-start_clamd="service clamd start"
X+clamd_lock=""
X+start_clamd="%%START_CLAMD%%"
X 
X # To only report issues, set the following variable to "yes".
X only_report_issues="yes"
e370cf25129fcf6eb092a75abb4510ba
echo x - clamav-unofficial-sigs/files/pkg-message.in
sed 's/^X//' >clamav-unofficial-sigs/files/pkg-message.in << 'b258087401544debed867f1b50df9960'
X**********************************************************************
X
XIn order to start using clamav-unofficial-sigs, you need to configure
Xit first. A sample configuration file has been installed to:
X
X%%PREFIX%%/etc/clamav-unofficial-sigs.conf.sample
X
XModify it according to your needs and copy to:
X
X%%PREFIX%%/etc/clamav-unofficial-sigs.conf
X
XTo run the script periodically by cron, you also need to add it to 
Xyour crontab.
X
X**********************************************************************
b258087401544debed867f1b50df9960
echo x - clamav-unofficial-sigs/pkg-deinstall
sed 's/^X//' >clamav-unofficial-sigs/pkg-deinstall << '750d310a8d2a2102548abc4e2e3e0a1e'
X#!/bin/sh
X# $FreeBSD$
X
XPATH="/bin:/sbin:/usr/bin:/usr/sbin"
X
Xif [ "$2" = "POST-DEINSTALL" ]; then
X
X	echo "**********************************************************************"
X	echo ""
X	echo "In order to completely remove clamav-unofficial-sigs you need to"
X	echo "completely remove its working directory and installed third-party"
X	echo "signature databases from ClamAV's database directory."
X	
X	if [ -f "/var/db/clamav-unofficial-sigs/configs/purge.txt" ]; then
X	
X		echo ""
X		echo "As a guide what needs to be removed you can take a look at the:"
X		echo ""
X		echo "/var/db/clamav-unofficial-sigs/configs/purge.txt"
X		echo ""
X		echo "file, which lists all files related to clamav-unofficial-sigs."
X	fi
X	
X	echo ""
X	echo "**********************************************************************"
X
Xfi
X
Xexit 0
750d310a8d2a2102548abc4e2e3e0a1e
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list