View | Details | Raw Unified | Return to bug 208326 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-20 / +21 lines)
Lines 2-50 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	clamav-unofficial-sigs
4
PORTNAME=	clamav-unofficial-sigs
5
PORTVERSION=	3.7.2
5
PORTVERSION=	5.0.3
6
PORTREVISION=	2
7
CATEGORIES=	security
6
CATEGORIES=	security
8
MASTER_SITES=	SF/unofficial-sigs/
9
7
10
MAINTAINER=	sf@maxempire.com
8
MAINTAINER=	lukasz@wasikowski.net
11
COMMENT=	Update script for third-party ClamAV databases
9
COMMENT=	Update script for third-party ClamAV databases
12
10
11
LICENSE=	BSD3CLAUSE
12
13
RUN_DEPENDS=	clamscan:${PORTSDIR}/security/clamav \
13
RUN_DEPENDS=	clamscan:${PORTSDIR}/security/clamav \
14
		rsync:${PORTSDIR}/net/rsync \
14
		rsync:${PORTSDIR}/net/rsync \
15
		curl:${PORTSDIR}/ftp/curl \
15
		curl:${PORTSDIR}/ftp/curl \
16
		gpg:${PORTSDIR}/security/gnupg
16
		gpg:${PORTSDIR}/security/gnupg \
17
		bash:${PORTSDIR}/shells/bash
17
18
18
USES=		perl5
19
USE_GITHUB=	yes
20
USES=		perl5 shebangfix
19
USE_PERL5=	run
21
USE_PERL5=	run
20
NO_BUILD=	yes
22
NO_BUILD=	yes
23
SHEBANG_FILES=	clamav-unofficial-sigs.sh
21
24
25
GH_ACCOUNT=	extremeshok
26
22
SUB_FILES=	pkg-message
27
SUB_FILES=	pkg-message
23
28
24
SED_CONF=	-e 's|%%CLAM_DBS%%|/var/db/clamav|g' \
25
		-e 's|%%CLAMD_PID%%|/var/run/clamav/clamd.pid|g' \
26
		-e 's|%%CLAMD_SOCKET%%|/var/run/clamav/clamd.sock|g' \
27
		-e 's|%%START_CLAMD%%|${PREFIX}/etc/rc.d/clamav-clamd start|g' \
28
		-e 's|%%WORK_DIR%%|/var/db/clamav-unofficial-sigs|g'
29
30
OPTIONS_DEFINE=	DOCS EXAMPLES
29
OPTIONS_DEFINE=	DOCS EXAMPLES
31
30
32
post-patch:
31
post-patch:
33
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/clamav-unofficial-sigs.sh
32
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/clamav-unofficial-sigs.sh ${WRKSRC}/cron.d/clamav-unofficial-sigs
34
	@${REINPLACE_CMD} ${SED_CONF} ${WRKSRC}/clamav-unofficial-sigs.conf
35
	@${REINPLACE_CMD} ${SED_CONF} ${WRKSRC}/clamd-status.sh
36
33
37
do-install:
34
do-install:
38
	${INSTALL_SCRIPT} ${WRKSRC}/clamav-unofficial-sigs.sh ${STAGEDIR}${PREFIX}/bin
35
	${INSTALL_SCRIPT} ${WRKSRC}/clamav-unofficial-sigs.sh ${STAGEDIR}${PREFIX}/bin
39
	${INSTALL_MAN} ${WRKSRC}/clamav-unofficial-sigs.8 ${STAGEDIR}${MANPREFIX}/man/man8
36
	${INSTALL_MAN} ${WRKSRC}/clamav-unofficial-sigs.8 ${STAGEDIR}${MANPREFIX}/man/man8
40
	${INSTALL_DATA} ${WRKSRC}/clamav-unofficial-sigs.conf ${STAGEDIR}${PREFIX}/etc/clamav-unofficial-sigs.conf.sample
41
37
38
	@${MKDIR} ${STAGEDIR}${ETCDIR}
39
40
	${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf.sample
41
	${INSTALL_DATA} ${WRKSRC}/config/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf.sample
42
	${INSTALL_DATA} ${WRKSRC}/config/user.conf ${STAGEDIR}${ETCDIR}/user.conf.sample
43
42
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
44
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
43
	(cd ${WRKSRC} && ${INSTALL_DATA} CHANGELOG INSTALL LICENSE README ${STAGEDIR}${DOCSDIR})
45
	(cd ${WRKSRC} && ${INSTALL_DATA} INSTALL LICENSE README.md ${STAGEDIR}${DOCSDIR})
44
46
45
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
47
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
46
	${INSTALL_DATA} ${WRKSRC}/clamav-unofficial-sigs-cron ${STAGEDIR}${EXAMPLESDIR}
48
	${INSTALL_DATA} ${WRKSRC}/cron.d/clamav-unofficial-sigs ${STAGEDIR}${EXAMPLESDIR}/clamav-unofficial-sigs-cron
47
	${INSTALL_DATA} ${WRKSRC}/clamav-unofficial-sigs-logrotate ${STAGEDIR}${EXAMPLESDIR}
49
	${INSTALL_DATA} ${WRKSRC}/logrotate.d/clamav-unofficial-sigs ${STAGEDIR}${EXAMPLESDIR}/clamav-unofficial-sigs-logrotate
48
	${INSTALL_SCRIPT} ${WRKSRC}/clamd-status.sh ${STAGEDIR}${EXAMPLESDIR}
49
50
50
.include <bsd.port.mk>
51
.include <bsd.port.mk>
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (clamav-unofficial-sigs-3.7.2.tar.gz) = 96e98e6e4434c5950fa9831c6a43236fed7eabae44beded16171305cf3f9bdb9
1
SHA256 (extremeshok-clamav-unofficial-sigs-5.0.3_GH0.tar.gz) = 7883df89cb1e4fda9213021b2bef2a399541bb3b72564a48d9ff724984caafe5
2
SIZE (clamav-unofficial-sigs-3.7.2.tar.gz) = 38549
2
SIZE (extremeshok-clamav-unofficial-sigs-5.0.3_GH0.tar.gz) = 31085
(-)files/patch-clamav-unofficial-sigs.conf (-53 lines)
Lines 1-53 Link Here
1
--- clamav-unofficial-sigs.conf	2013-08-27 18:08:25.000000000 +0200
2
+++ clamav-unofficial-sigs.conf.patched	2013-09-04 16:19:11.000000000 +0200
3
@@ -50,10 +50,10 @@
4
 
5
 # Set path to ClamAV database files location.  If unsure, check
6
 # your clamd.conf file for the "DatabaseDirectory" path setting.
7
-clam_dbs="/var/lib/clamav"
8
+clam_dbs="%%CLAM_DBS%%"
9
 
10
 # Set path to clamd.pid file (see clamd.conf for path location).
11
-clamd_pid="/var/run/clamd.pid"
12
+clamd_pid="%%CLAMD_PID%%"
13
 
14
 # To enable "ham" (non-spam) directory scanning and removal of
15
 # signatures that trigger on ham messages, uncomment the following
16
@@ -84,7 +84,7 @@
17
 # the script will still run).  You will also need to set the correct
18
 # path to your clamd socket file (if unsure of the path, check the
19
 # "LocalSocket" setting in your clamd.conf file for socket location).
20
-#clamd_socket="/var/run/clamd.socket"
21
+#clamd_socket="%%CLAMD_SOCKET%%"
22
 
23
 # If you would like to attempt to restart ClamD if detected not running,
24
 # uncomment the next 2 lines.  Confirm the path to the "clamd_lock" file
25
@@ -94,8 +94,8 @@
26
 # NOTE: these 2 variables are dependant on the "clamd_socket" variable
27
 # shown above - if not enabled, then the following 2 variables will be
28
 # ignored, whether enabled or not.
29
-#clamd_lock="/var/lock/subsys/clamd"
30
-#start_clamd="service clamd start"
31
+#clamd_lock=""
32
+#start_clamd="%%START_CLAMD%%"
33
 
34
 # Enable or disable download time randomization.  This allows the script to
35
 # be executed via cron, but the actual database file checking will pause
36
@@ -227,7 +227,7 @@
37
 # Set working directory paths (edit to meet your own needs). If these
38
 # directories do not exist, the script will attempt to create them.
39
 # Top level working directory path:
40
-work_dir="/usr/unofficial-dbs"   #Top level working directory
41
+work_dir="%%WORK_DIR%%"   #Top level working directory
42
 # Sub-directory names:
43
 ss_dir="$work_dir/ss-dbs"        # Sanesecurity sub-directory
44
 si_dir="$work_dir/si-dbs"        # SecuriteInfo sub-directory
45
@@ -252,7 +252,7 @@
46
 comment_silence="no"   # Default is "no" to report script comments
47
 
48
 # Log update information to '$log_file_path/$log_file_name'.
49
-enable_logging="yes"
50
+enable_logging="no"
51
 log_file_path="/var/log"
52
 log_file_name="clamav-unofficial-sigs.log"
53
 
(-)files/patch-clamav-unofficial-sigs.sh (-30 / +27 lines)
Lines 1-32 Link Here
1
--- clamav-unofficial-sigs.sh	2013-08-27 18:08:25.000000000 +0200
1
--- clamav-unofficial-sigs.sh.orig	2016-03-27 09:47:03 UTC
2
+++ clamav-unofficial-sigs.sh.patched	2014-12-06 23:55:50.000000000 +0100
2
+++ clamav-unofficial-sigs.sh
3
@@ -16,7 +16,7 @@
3
@@ -157,7 +157,7 @@ minimum_required_config_version="55"
4
 #                                                                              #
4
 version_date="27 March 2016"
5
 ################################################################################
6
 
5
 
7
-default_config="/etc/clamav-unofficial-sigs.conf"
6
 #default config files
8
+default_config="%%PREFIX%%/etc/clamav-unofficial-sigs.conf"
7
-config_dir="/etc/clamav-unofficial-sigs"
8
+config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs"
9
 config_files=("$config_dir/master.conf" "$config_dir/os.conf" "$config_dir/user.conf")
9
 
10
 
10
 version="v3.7.2 (updated 2013-08-25)"
11
 
11
 output_ver="
12
@@ -530,6 +530,8 @@ make_signature_database_from_ascii_file 
12
@@ -418,6 +418,8 @@
13
 #Remove the clamav-unofficial-sigs script
13
           exit
14
 remove_script () {
14
           ;;
15
 	echo ""
15
       r)  no_default_config
16
+	pkg_mgr="FreeBSD ports"
16
+          pkg_mgr="FreeBSD ports"
17
+	pkg_rm="pkg remove"
17
+          pkg_rm="pkg_delete"
18
 	if [ -n "$pkg_mgr" -a -n "$pkg_rm" ] ; then
18
           if [ -n "$pkg_mgr" -a -n "$pkg_rm" ]
19
 		echo "  This script (clamav-unofficial-sigs) was installed on the system"
19
              then
20
 		echo "  via '$pkg_mgr', use '$pkg_rm' to remove the script"
20
                 echo "  This script (clamav-unofficial-sigs) was installed on the system"
21
@@ -801,7 +803,7 @@ while true; do
21
@@ -1016,9 +1018,9 @@
22
 		-g | --gpg-verify ) gpg_verify_specific_sanesecurity_database_file; exit; break ;;
22
    comment "======================================================================"
23
 		-i | --information ) output_system_configuration_information; exit; break ;;
23
    comment "Sanesecurity Database & GPG Signature File Updates"
24
 		-m | --make-database ) make_signature_database_from_ascii_file; exit; break ;;
24
    comment "======================================================================"
25
-		-r | --remove-script ) make_signature_database_from_ascii_file; exit; break ;;
25
-   ss_mirror_ips=`dig +ignore +short $ss_url`
26
+		-r | --remove-script ) remove_script; exit; break ;;
26
+   ss_mirror_ips=`host $ss_url | sed 's/.*\s//'`
27
 		-t | --test-database ) clamscan_integrity_test_specific_database_file; exit; break ;;
27
    for ss_mirror_ip in $ss_mirror_ips ; do
28
 		-o | --output-triggered ) output_signatures_triggered_during_ham_directory_scan; exit; break ;;
28
-      ss_mirror_name=`dig +short -x $ss_mirror_ip | sed 's/\.$//'`
29
 		-w | --whitelist ) add_signature_whitelist_entry; exit; break ;;
29
+      ss_mirror_name=`host $ss_mirror_ip | sed 's/.*\s//' | sed 's/\.$//'`
30
       ss_mirror_site_info="$ss_mirror_name $ss_mirror_ip"
31
       comment ""
32
       comment "Sanesecurity mirror site used: $ss_mirror_site_info"
(-)files/patch-clamd-status.sh (-31 lines)
Lines 1-31 Link Here
1
--- clamd-status.sh	2013-08-27 18:08:25.000000000 +0200
2
+++ clamd-status.sh.patched	2013-09-04 16:09:58.000000000 +0200
3
@@ -24,7 +24,7 @@
4
 export PATH
5
 
6
 # Set path to clamd.pid file (see clamd.conf for path location).
7
-clamd_pid="/var/run/clamav/clamd.pid"
8
+clamd_pid="%%CLAMD_PID%%"
9
 
10
 # If running clamd in "LocalSocket" mode (*NOT* in TCP/IP mode), and
11
 # either "SOcket Cat" (socat) or the "IO::Socket::UNIX" perl module
12
@@ -34,7 +34,7 @@
13
 # the script will still run).  You will also need to set the correct
14
 # path to your clamd socket file (if unsure of the path, check the
15
 # "LocalSocket" setting in your clamd.conf file for socket location).
16
-clamd_socket="/var/run/clamav/clamd.sock"
17
+clamd_socket="%%CLAMD_SOCKET%%"
18
 
19
 # If you would like to attemtp to restart ClamD if detected not running,
20
 # uncomment the next 2 lines.  Confirm the path to the "clamd_lock" file
21
@@ -44,8 +44,8 @@
22
 # NOTE: these 2 variables are dependant on the "clamd_socket" variable
23
 # shown above - if not enabled, then the following 2 variables will be
24
 # ignored, whether enabled or not.
25
-clamd_lock="/var/lock/subsys/clamd"
26
-start_clamd="service clamd start"
27
+clamd_lock=""
28
+start_clamd="%%START_CLAMD%%"
29
 
30
 # To only report issues, set the following variable to "yes".
31
 only_report_issues="yes"
(-)files/patch-cron.d_clamav-unofficial-sigs (+8 lines)
Line 0 Link Here
1
--- cron.d/clamav-unofficial-sigs.orig	2016-03-26 00:54:25 UTC
2
+++ cron.d/clamav-unofficial-sigs
3
@@ -22,4 +22,4 @@
4
 # 60 - 600 seconds.  Adjust the cron start time, user account to run the
5
 # script under, and path information shown below to meet your own needs.
6
 
7
-45 * * * * root /bin/bash /usr/local/bin/clamav-unofficial-sigs.sh  > /dev/null
8
+45 * * * * root %%PREFIX%%/bin/bash %%PREFIX%%/bin/clamav-unofficial-sigs.sh  > /dev/null
(-)files/patch-logrotate.d_clamav-unofficial-sigs (+21 lines)
Line 0 Link Here
1
--- logrotate.d/clamav-unofficial-sigs.orig	2016-03-26 00:57:47 UTC
2
+++ logrotate.d/clamav-unofficial-sigs
3
@@ -14,14 +14,14 @@
4
 #
5
 ##################
6
 
7
-/var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log {
8
+/var/log/clamav/clamav-unofficial-sigs.log {
9
      weekly
10
      rotate 4
11
      missingok
12
      notifempty
13
      compress
14
 # Redhat / CentOS 6
15
-     create 0644 clam clam
16
-# Debian / Ubuntu
17
-#     create 0644 clamav clamav
18
+#     create 0644 clam clam
19
+# Debian / Ubuntu / FreeBSD
20
+     create 0644 clamav clamav
21
 }
(-)files/pkg-message.in (-4 / +9 lines)
Lines 3-15 Link Here
3
In order to start using clamav-unofficial-sigs, you need to configure
3
In order to start using clamav-unofficial-sigs, you need to configure
4
it first. A sample configuration file has been installed to:
4
it first. A sample configuration file has been installed to:
5
5
6
%%PREFIX%%/etc/clamav-unofficial-sigs.conf.sample
6
%%ETCDIR%%/user.conf.sample
7
7
8
Modify it according to your needs and copy to:
8
Copy it to:
9
9
10
%%PREFIX%%/etc/clamav-unofficial-sigs.conf
10
%%ETCDIR%%/user.conf
11
11
12
and modify it according to your needs. Don't forget to uncomment 
13
user_configuration_complete="yes"
14
12
To run the script periodically by cron, you also need to add it to 
15
To run the script periodically by cron, you also need to add it to 
13
your crontab.
16
your crontab. Example crontab and logrotate files are in:
14
17
18
%%EXAMPLESDIR%%
19
15
**********************************************************************
20
**********************************************************************
(-)pkg-plist (-4 / +4 lines)
Lines 1-10 Link Here
1
bin/clamav-unofficial-sigs.sh
1
bin/clamav-unofficial-sigs.sh
2
etc/clamav-unofficial-sigs.conf.sample
2
@sample %%ETCDIR%%/master.conf.sample
3
@sample %%ETCDIR%%/os.conf.sample
4
@sample %%ETCDIR%%/user.conf.sample
3
man/man8/clamav-unofficial-sigs.8.gz
5
man/man8/clamav-unofficial-sigs.8.gz
4
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
5
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
6
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
6
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
7
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
7
%%PORTDOCS%%%%DOCSDIR%%/README
8
%%PORTDOCS%%%%DOCSDIR%%/README.md
8
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamav-unofficial-sigs-cron
9
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamav-unofficial-sigs-cron
9
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamav-unofficial-sigs-logrotate
10
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamav-unofficial-sigs-logrotate
10
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clamd-status.sh

Return to bug 208326