From a252914544c410c7d77815ddd54729e1fe03b3cd Mon Sep 17 00:00:00 2001 From: Lucian Cristian Date: Sun, 5 Mar 2017 21:21:00 +0200 Subject: [PATCH 1/2] clamav: update to 0.99.2 added option DatabaseDirectory update depends on musl-fts libraries Signed-off-by: Lucian Cristian --- net/clamav/Makefile | 11 +++++------ net/clamav/files/clamav.config | 1 + net/clamav/files/clamav.init | 9 ++++++--- net/clamav/files/freshclam.config | 1 + net/clamav/files/freshclam.init | 9 ++++++--- net/clamav/patches/001-compile.patch | 2 +- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/net/clamav/Makefile b/net/clamav/Makefile index 3f3edab56..180c4b3ea 100644 --- a/net/clamav/Makefile +++ b/net/clamav/Makefile @@ -8,15 +8,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=clamav -PKG_VERSION:=0.98.7 +PKG_VERSION:=0.99.2 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Marko Ratkaj PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://sourceforge.net/projects/clamav/files/clamav/$(PKG_VERSION)/ -PKG_MD5SUM:=157c601161da1c2d5a0e48ea1b49e067 +PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/ +PKG_MD5SUM:=61b51a04619aeafd965892a53f86d192 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk define Package/clamav/Default SECTION:=net - DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl + DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl +libltdl +libpcre +musl-fts CATEGORY:=Network SUBMENU:=Web Servers/Proxies TITLE:=ClamAV @@ -58,7 +58,7 @@ endef CONFIGURE_VARS += \ INCLUDES="" \ CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ - LIBS="-lpthread" \ + LIBS="-lpthread -lfts" \ define Build/Configure $(call Build/Configure/Default, \ @@ -67,7 +67,6 @@ define Build/Configure --exec-prefix=/usr/ \ --disable-xml \ --disable-bzip2 \ - --enable-ltdl-install \ --with-user nobody \ --with-group nogroup \ ) diff --git a/net/clamav/files/clamav.config b/net/clamav/files/clamav.config index 1543caa71..26d941ea1 100644 --- a/net/clamav/files/clamav.config +++ b/net/clamav/files/clamav.config @@ -32,3 +32,4 @@ config clamav 'clamav' option LocalSocket '/var/run/clamav/clamd.sock' option User 'nobody' option ExitOnOOM 'yes' + option DatabaseDirectory '/usr/share/clamav' diff --git a/net/clamav/files/clamav.init b/net/clamav/files/clamav.init index b2a895019..a02468e07 100644 --- a/net/clamav/files/clamav.init +++ b/net/clamav/files/clamav.init @@ -42,7 +42,8 @@ validate_clamav_section() { 'MaxFileSize:string' \ 'LocalSocket:string' \ 'User:string' \ - 'ExitOnOOM:string' + 'ExitOnOOM:string' \ + 'DatabaseDirectory:string' } start_service() { @@ -50,14 +51,15 @@ start_service() { StreamMaxPort MaxThreads ReadTimeout CommandReadTimeout MaxDirectoryRecursion \ FollowFileSymlinks FollowDirectorySymlinks SelfCheck DetectPUA ScanPE DisableCertCheck \ ScanELF DetectBrokenExecutables ScanOLE2 ScanPDF ScanSWF ScanMail ScanPartialMessages \ - ScanArchive TemporaryDirectory ArchiveBlockEncrypted MaxFileSize LocalSocket User + ScanArchive TemporaryDirectory ArchiveBlockEncrypted MaxFileSize LocalSocket User \ + DatabaseDirectory validate_clamav_section clamav || { echo "validation failed" return 1 } - mkdir -p /usr/share/clamav + mkdir -p $DatabaseDirectory mkdir -p /etc/clamav/ mkdir -p /var/run/clamav/ chmod a+rw /var/run/clamav @@ -97,6 +99,7 @@ start_service() { echo "LocalSocket " $LocalSocket >> $CLAMD_CONFIGFILE echo "User " $User >> $CLAMD_CONFIGFILE echo "ExitOnOOM " $ExitOnOOM >> $CLAMD_CONFIGFILE + echo "DatabaseDirectory " $DatabaseDirectory >> $CLAMD_CONFIGFILE procd_open_instance procd_set_param command $PROG -c $CLAMD_CONFIGFILE diff --git a/net/clamav/files/freshclam.config b/net/clamav/files/freshclam.config index 827e8dd95..ccce09a41 100644 --- a/net/clamav/files/freshclam.config +++ b/net/clamav/files/freshclam.config @@ -5,3 +5,4 @@ config freshclam 'freshclam' option NotifyClamd '/etc/clamav/clamd.conf' option DatabaseOwner 'root' option CompressLocalDatabase 'yes' + option DatabaseDirectory '/usr/share/clamav' diff --git a/net/clamav/files/freshclam.init b/net/clamav/files/freshclam.init index 37b276729..9504b7ffa 100644 --- a/net/clamav/files/freshclam.init +++ b/net/clamav/files/freshclam.init @@ -15,11 +15,13 @@ validate_freshclam_section() { 'DatabaseMirror:string' \ 'NotifyClamd:string' \ 'DatabaseOwner:string' \ - 'CompressLocalDatabase:string:' + 'CompressLocalDatabase:string' \ + 'DatabaseDirectory:string:' } start_service() { - local freshclam_config_file UpdateLogFile DatabaseOwner NotifyClamd DatabaseMirror + local freshclam_config_file UpdateLogFile DatabaseOwner NotifyClamd DatabaseMirror \ + DatabaseDirectory validate_freshclam_section freshclam || { echo "validation failed" @@ -28,7 +30,7 @@ start_service() { [ -f /tmp/freshclam.pid ] && echo "already running" && return 0 - mkdir -p /usr/share/clamav + mkdir -p $DatabaseDirectory mkdir -p /etc/clamav touch /tmp/freshclam.log touch /tmp/freshclam.pid @@ -41,6 +43,7 @@ start_service() { echo "NotifyClamd " $NotifyClamd >> $FRESHCLAM_CONFIGFILE echo "DatabaseOwner " $DatabaseOwner >> $FRESHCLAM_CONFIGFILE echo "CompressLocalDatabase " $CompressLocalDatabase >> $FRESHCLAM_CONFIGFILE + echo "DatabaseDirectory " $DatabaseDirectory >> $FRESHCLAM_CONFIGFILE procd_open_instance procd_set_param command $PROG -d --config-file=$FRESHCLAM_CONFIGFILE -p /tmp/freshclam.pid --no-warnings diff --git a/net/clamav/patches/001-compile.patch b/net/clamav/patches/001-compile.patch index 399225708..096d9cb9c 100644 --- a/net/clamav/patches/001-compile.patch +++ b/net/clamav/patches/001-compile.patch @@ -1,6 +1,6 @@ --- a/clamdscan/proto.c +++ b/clamdscan/proto.c -@@ -55,6 +55,7 @@ +@@ -59,6 +59,7 @@ #include "shared/misc.h" #include "shared/clamdcom.h" From 33b8364f2d70827eb9b1057fbf1417f772fe7d77 Mon Sep 17 00:00:00 2001 From: Lucian Cristian Date: Mon, 6 Mar 2017 14:41:26 +0200 Subject: [PATCH 2/2] clamav: depend on musl-fts only when USE_MUSL add me as a maintainer Signed-off-by: Lucian Cristian --- net/clamav/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/clamav/Makefile b/net/clamav/Makefile index 180c4b3ea..5cd4487fd 100644 --- a/net/clamav/Makefile +++ b/net/clamav/Makefile @@ -12,11 +12,12 @@ PKG_VERSION:=0.99.2 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 -PKG_MAINTAINER:=Marko Ratkaj +PKG_MAINTAINER:=Marko Ratkaj \ + Lucian Cristian PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.clamav.net/downloads/production/ -PKG_MD5SUM:=61b51a04619aeafd965892a53f86d192 +PKG_HASH:=167bd6a13e05ece326b968fdb539b05c2ffcfef6018a274a10aeda85c2c0027a PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -26,7 +27,7 @@ include $(INCLUDE_DIR)/package.mk define Package/clamav/Default SECTION:=net - DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl +libltdl +libpcre +musl-fts + DEPENDS:=+libpthread +uclibcxx +zlib +libcurl +libopenssl +libltdl +libpcre +USE_MUSL:musl-fts CATEGORY:=Network SUBMENU:=Web Servers/Proxies TITLE:=ClamAV @@ -58,7 +59,7 @@ endef CONFIGURE_VARS += \ INCLUDES="" \ CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ - LIBS="-lpthread -lfts" \ + $(if $(CONFIG_USE_MUSL),LIBS="-lpthread -lfts",LIBS="-lpthread") \ define Build/Configure $(call Build/Configure/Default, \