Skip to contentSkip to conversation

package/clamav: New package

PATCH Superseded Bernd Kuhls 2 participants 3 messages Oct 4, 2014 – Oct 13, 2014

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 package/clamav: New package

---
v3: CLAMAV_CONF_OPT -> CLAMAV_CONF_OPTS
v2: - Reworked dependencies (Thomas)
- OpenSSL and zlib are mandatory dependencies
- iconv is an optional dependency
- gettext is an optional dependency (see shared/output.c, line 72)
- Added more license files (Thomas)
- patch #0002 renamed and submitted upstream (Thomas)
- package/Config.in: respect alphabetic ordering (Thomas)
- package/clamav/Config.in: moved bool (Thomas)

 package/Config.in                               |    1 +
 package/clamav/Config.in                        |   16 ++++++
 package/clamav/clamav-0001-clamdscan.patch      |   21 ++++++++
 package/clamav/clamav-0002-static-linking.patch |   58 ++++++++++++++++++++++
 package/clamav/clamav.mk                        |   60 +++++++++++++++++++++++
 5 files changed, 156 insertions(+)
 create mode 100644 package/clamav/Config.in
 create mode 100644 package/clamav/clamav-0001-clamdscan.patch
 create mode 100644 package/clamav/clamav-0002-static-linking.patch
 create mode 100644 package/clamav/clamav.mk
package/Config.in +1 -0
index 1629d5a..457ce07 100644
@@ -918,6 +918,7 @@ endmenu
 menu "Miscellaneous"
 	source "package/aespipe/Config.in"
 	source "package/bc/Config.in"
+	source "package/clamav/Config.in"
 	source "package/collectd/Config.in"
 	source "package/empty/Config.in"
 	source "package/googlefontdirectory/Config.in"
package/clamav/Config.in new file +16 -0
new file mode 100644
index 0000000..7ec402d
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CLAMAV
+	bool "clamav"
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_ZLIB
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU # fork()
+	help
+	  ClamAV is an open source antivirus engine for detecting trojans,
+	  viruses, malware & other malicious threats.
+
+	  http://www.clamav.net
+
+comment "clamav needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
package/clamav/clamav-0001-clamdscan.patch new file +21 -0
new file mode 100644
index 0000000..c395ae1
@@ -0,0 +1,21 @@
+Fixes build error
+
+proto.c: In function ?dconnect?:
+proto.c:86:67: error: invalid application of ?sizeof? to incomplete type ?struct sockaddr_un?
+             if (connect(sockd, (struct sockaddr *)&nixsock, sizeof(nixsock)) == 0)
+
+Patch sent upstream: http://lurker.clamav.net/message/20140928.130829.5494fd68.en.html
+
+Signed-off-by: Bernd Kuhls <[email protected]>
+
+diff -uNr clamav-0.98.3.org/clamdscan/proto.c clamav-0.98.3/clamdscan/proto.c
+--- clamav-0.98.3.org/clamdscan/proto.c	2014-05-06 20:39:56.000000000 +0200
++++ clamav-0.98.3/clamdscan/proto.c	2014-05-10 10:41:44.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
++#include <sys/un.h>
+ #ifdef HAVE_SYS_SELECT_H
+ #include <sys/select.h>
+ #endif
package/clamav/clamav-0002-static-linking.patch new file +58 -0

58 lines not on this page · raw message

package/clamav/clamav.mk new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v3 1/1 package/clamav: New package

Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Bernd" == Bernd Kuhls <[email protected]> writes:

Thanks, a few comments below.

package/clamav/clamav-0002-static-linking.patch line 3

Quoted 5 lines

+++ b/package/clamav/clamav-0002-static-linking.patch

package/clamav/clamav-0002-static-linking.patch new file +3 -0
@@ -0,0 +1,58 @@
+Fix detection of statically linked libraries
+
+Ptch submitted upstream: https://bugzilla.clamav.net/show_bug.cgi?id=11132

s/Ptch/Patch. I don't seem to have access to view that patch, even after creating an account :/

Quoted 8 lines
package/clamav/clamav.mk new file +2 -0
new file mode 100644
index 0000000..417aade
@@ -0,0 +1,60 @@
+################################################################################
+#

package/clamav/clamav.mk line 12

Quoted 10 lines
package/clamav/clamav.mk new file +10 -0
+# clamav
+#
+################################################################################
+
+CLAMAV_VERSION = 0.98.4
+CLAMAV_SITE = http://sourceforge.net/projects/clamav/files/clamav/$(CLAMAV_VERSION)
+CLAMAV_LICENSE = GPLv2
+CLAMAV_LICENSE_FILES = COPYING COPYING.bzip2 COPYING.file COPYING.getopt \
+	COPYING.LGPL COPYING.llvm COPYING.lzma COPYING.regex COPYING.sha256 \
+	COPYING.unrar COPYING.zlib

While the entire clamav is indeed GPLv2, all these COPYING files are a fairly strong indication that the situation is more complicated than that, especially as it links with openssl.

package/clamav/clamav.mk line 13

Quoted 1 line
package/clamav/clamav.mk new file +1 -0
+CLAMAV_AUTORECONF = YES

We normally add a comment about why this is done - E.G. something like:

# clamav-0002-static-linking.patch touches configure.ac

package/clamav/clamav.mk line 21

Quoted 8 lines
package/clamav/clamav.mk new file +8 -0
+CLAMAV_DEPENDENCIES = openssl zlib $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
+
+# mmap cannot be detected when cross-compiling, needed for mempool support
+CLAMAV_CONF_ENV = \
+	ac_cv_c_mmap_private=yes
+
+CLAMAV_CONF_OPTS = \
+	--sysconfdir=/etc \

The autotools infrastructure already handles this, so it can be dropped.

package/clamav/clamav.mk line 25

Quoted 4 lines
package/clamav/clamav.mk new file +4 -0
+	--with-dbdir=/var/lib/clamav \
+	--with-openssl=$(STAGING_DIR)/usr \
+	--with-zlib=$(STAGING_DIR)/usr \
+	--disable-rpath \

Is openssl really a required dependency? It isn't listed here:

http://www.clamav.net/doc/install.html#Requirements

If not, then you should just automatically enable/disable support depending if openssl is available or not.

package/clamav/clamav.mk line 31

Quoted 6 lines
package/clamav/clamav.mk new file +6 -0
+	--disable-clamuko \
+	--disable-clamav \
+	--disable-milter \
+	--disable-llvm \
+	--disable-clamdtop \
+	--enable-mempool

Doesn't clamav need a virus definition database to do anything? Where is that?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v3 1/1 package/clamav: New package

[posted and mailed]

Hi,

Peter Korsgaard <[email protected]> wrote in
news:87vbnprlcl.fsf at dell.be.48ers.dk:

Quoted 5 lines
Quoted 2 lines

+Ptch submitted upstream:
https://bugzilla.clamav.net/show_bug.cgi?id=11132

s/Ptch/Patch. I don't seem to have access to view that patch, even after creating an account :/

fixed typo. Regarding the bug report I even can not add you to the CC list of the bug, their bugtracker is pretty restrictive when it comes to accessing someone else's bugs... Shall I remove the bug reference from the patch?

Quoted 8 lines
Quoted 4 lines
(quoted diff) +2 -0
+CLAMAV_LICENSE = GPLv2
+CLAMAV_LICENSE_FILES = COPYING COPYING.bzip2 COPYING.file

COPYING.getopt \ + COPYING.LGPL COPYING.llvm COPYING.lzma
COPYING.regex COPYING.sha256 \ + COPYING.unrar COPYING.zlib

While the entire clamav is indeed GPLv2, all these COPYING files are a fairly strong indication that the situation is more complicated than that, especially as it links with openssl.

Regarding OpenSSL I found this:
https://github.com/vrtadmin/clamav-devel/commit/5628bc85006c0efd4035ee2025c
b83e093d91237

Could you please give me an advice on what CLAMAV_LICENSE/CLAMAV_LICENSE_FILES should contain?

Quoted 5 lines
Quoted 1 line

+CLAMAV_AUTORECONF = YES

We normally add a comment about why this is done - E.G. something like:

# clamav-0002-static-linking.patch touches configure.ac

Done.

Quoted 4 lines

package/clamav/clamav.mk line 21

Quoted 2 lines
package/clamav/clamav.mk new file +2 -0
+CLAMAV_CONF_OPTS = \
+     --sysconfdir=/etc \

The autotools infrastructure already handles this, so it can be dropped.

Done.

Quoted 6 lines

package/clamav/clamav.mk line 25

Quoted 4 lines
package/clamav/clamav.mk new file +4 -0
+     --with-dbdir=/var/lib/clamav \
+     --with-openssl=$(STAGING_DIR)/usr \
+     --with-zlib=$(STAGING_DIR)/usr \
+     --disable-rpath \

Is openssl really a required dependency?

Yes:
https://github.com/vrtadmin/clamav-devel/blob/master/m4/reorganization/libs
/openssl.m4#L22

Quoted 2 lines

Doesn't clamav need a virus definition database to do anything? Where is that?

Clamav includes a binary, freshclam, which fetches the database:
https://raw.githubusercontent.com/vrtadmin/clamav-devel/master/docs/man/fre
shclam.1.in

Regards, Bernd