* [Buildroot] [PATCH 1/2] package/clamav: New package
@ 2014-09-28 14:42 Bernd Kuhls
2014-09-28 14:42 ` [Buildroot] [PATCH 2/2] package/exim: Add ClamAV support Bernd Kuhls
2014-09-30 17:40 ` [Buildroot] [PATCH 1/2] package/clamav: New package Thomas Petazzoni
0 siblings, 2 replies; 3+ messages in thread
From: Bernd Kuhls @ 2014-09-28 14:42 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/Config.in | 1 +
package/clamav/Config.in | 14 ++++++
package/clamav/clamav-0001-clamdscan.patch | 21 +++++++++
package/clamav/clamav-0002-static_linking.patch | 56 +++++++++++++++++++++++
package/clamav/clamav.mk | 53 +++++++++++++++++++++
5 files changed, 145 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
diff --git a/package/Config.in b/package/Config.in
index db06310..26dc69c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -917,6 +917,7 @@ menu "Miscellaneous"
source "package/aespipe/Config.in"
source "package/bc/Config.in"
source "package/collectd/Config.in"
+ source "package/clamav/Config.in"
source "package/empty/Config.in"
source "package/googlefontdirectory/Config.in"
source "package/haveged/Config.in"
diff --git a/package/clamav/Config.in b/package/clamav/Config.in
new file mode 100644
index 0000000..9840228
--- /dev/null
+++ b/package/clamav/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_CLAMAV
+ select BR2_PACKAGE_OPENSSL
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_USE_MMU # fork()
+ bool "clamav"
+ 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
diff --git a/package/clamav/clamav-0001-clamdscan.patch b/package/clamav/clamav-0001-clamdscan.patch
new file mode 100644
index 0000000..c395ae1
--- /dev/null
+++ b/package/clamav/clamav-0001-clamdscan.patch
@@ -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 <bernd.kuhls@t-online.de>
+
+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
diff --git a/package/clamav/clamav-0002-static_linking.patch b/package/clamav/clamav-0002-static_linking.patch
new file mode 100644
index 0000000..71e4590
--- /dev/null
+++ b/package/clamav/clamav-0002-static_linking.patch
@@ -0,0 +1,56 @@
+Fix detection of statically linked libraries
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+
+diff -uNr clamav-0.98.4.org/m4/reorganization/libs/curl.m4 clamav-0.98.4/m4/reorganization/libs/curl.m4
+--- clamav-0.98.4.org/m4/reorganization/libs/curl.m4 2014-05-21 17:25:05.000000000 +0200
++++ clamav-0.98.4/m4/reorganization/libs/curl.m4 2014-09-28 15:39:26.714111527 +0200
+@@ -38,7 +38,7 @@
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$CURL_LDFLAGS"
+ AC_CHECK_LIB([curl], [curl_easy_init], [curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS"],
+- [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])])
++ [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])], [$CURL_LDFLAGS])
+ LDFLAGS="$save_LDFLAGS"
+ fi
+
+diff -uNr clamav-0.98.4.org/m4/reorganization/libs/openssl.m4 clamav-0.98.4/m4/reorganization/libs/openssl.m4
+--- clamav-0.98.4.org/m4/reorganization/libs/openssl.m4 2014-05-22 15:18:22.000000000 +0200
++++ clamav-0.98.4/m4/reorganization/libs/openssl.m4 2014-09-28 15:15:18.280323868 +0200
+@@ -26,7 +26,7 @@
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+
+-SSL_LIBS="-lssl -lcrypto"
++SSL_LIBS="-lssl -lcrypto -lz"
+
+ if test "$LIBSSL_HOME" != "/usr"; then
+ SSL_LDFLAGS="-L$LIBSSL_HOME/lib"
+@@ -41,12 +41,12 @@
+ have_ssl="no"
+ have_crypto="no"
+
+-AC_CHECK_LIB([ssl], [SSL_library_init], [have_ssl="yes"], [AC_MSG_ERROR([Your OpenSSL installation is misconfigured or missing])], [-lcrypto])
++AC_CHECK_LIB([ssl], [SSL_library_init], [have_ssl="yes"], [AC_MSG_ERROR([Your OpenSSL installation is misconfigured or missing])], [-lcrypto -lz])
+
+-AC_CHECK_LIB([crypto], [EVP_EncryptInit], [have_crypto="yes"], [AC_MSG_ERROR([Your OpenSSL installation is misconfigured or missing])])
++AC_CHECK_LIB([crypto], [EVP_EncryptInit], [have_crypto="yes"], [AC_MSG_ERROR([Your OpenSSL installation is misconfigured or missing])], [-lcrypto -lz])
+
+ dnl OpenSSL 0.9.8 is the minimum required version due to X509_VERIFY_PARAM
+-AC_CHECK_LIB([ssl], [X509_VERIFY_PARAM_new], [], [AC_MSG_ERROR([Your OpenSSL installation is missing the X509_VERIFY_PARAM function. Please upgrade to a more recent version of OpenSSL.])], [-lcrypto])
++AC_CHECK_LIB([ssl], [X509_VERIFY_PARAM_new], [], [AC_MSG_ERROR([Your OpenSSL installation is missing the X509_VERIFY_PARAM function. Please upgrade to a more recent version of OpenSSL.])], [-lcrypto -lz])
+
+ LDFLAGS="$save_LDFLAGS"
+ CFLAGS="$save_CFLAGS"
+diff -uNr clamav-0.98.4.org/m4/reorganization/libs/xml.m4 clamav-0.98.4/m4/reorganization/libs/xml.m4
+--- clamav-0.98.4.org/m4/reorganization/libs/xml.m4 2014-05-21 17:25:05.000000000 +0200
++++ clamav-0.98.4/m4/reorganization/libs/xml.m4 2014-09-28 15:57:41.836339462 +0200
+@@ -67,7 +67,7 @@
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $XML_LIBS"
+
+- AC_CHECK_LIB([xml2], [xmlTextReaderRead], [working_xml="yes"], [working_xml="no"])
++ AC_CHECK_LIB([xml2], [xmlTextReaderRead], [working_xml="yes"], [working_xml="no"], [$XML_LIBS])
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
diff --git a/package/clamav/clamav.mk b/package/clamav/clamav.mk
new file mode 100644
index 0000000..2db8577
--- /dev/null
+++ b/package/clamav/clamav.mk
@@ -0,0 +1,53 @@
+################################################################################
+#
+# clamav
+#
+################################################################################
+
+CLAMAV_VERSION = 0.98.4
+CLAMAV_SITE = http://sourceforge.net/projects/clamav/files/clamav/$(CLAMAV_VERSION)
+CLAMAV_LICENSE = GPLv2
+CLAMAV_LICENSE_FILES = COPYING
+CLAMAV_AUTORECONF = YES
+CLAMAV_DEPENDENCIES = openssl zlib \
+ $(if $(BR2_PACKAGE_LIBICONV),libiconv) \
+ $(if $(BR2_NEEDS_GETTEXT),gettext)
+
+# mmap cannot be detected when cross-compiling, needed for mempool support
+CLAMAV_CONF_ENV = \
+ ac_cv_c_mmap_private=yes
+
+CLAMAV_CONF_OPT = \
+ --sysconfdir=/etc \
+ --with-dbdir=/var/lib/clamav \
+ --with-openssl=$(STAGING_DIR)/usr \
+ --with-zlib=$(STAGING_DIR)/usr \
+ --disable-rpath \
+ --disable-clamuko \
+ --disable-clamav \
+ --disable-milter \
+ --disable-llvm \
+ --disable-clamdtop \
+ --enable-mempool
+
+ifeq ($(BR2_PACKAGE_BZIP2),y)
+CLAMAV_DEPENDENCIES += bzip2
+else
+CLAMAV_CONF_OPT += --disable-bzip2
+endif
+
+ifeq ($(BR2_PACKAGE_LIBXML2),y)
+CLAMAV_CONF_OPT += --with-xml=$(STAGING_DIR)/usr
+CLAMAV_DEPENDENCIES += libxml2
+else
+CLAMAV_CONF_OPT += --disable-xml
+endif
+
+ifeq ($(BR2_PACKAGE_LIBCURL),y)
+CLAMAV_CONF_OPT += --with-libcurl=$(STAGING_DIR)/usr
+CLAMAV_DEPENDENCIES += libcurl
+else
+CLAMAV_CONF_OPT += --without-libcurl
+endif
+
+$(eval $(autotools-package))
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 2/2] package/exim: Add ClamAV support
2014-09-28 14:42 [Buildroot] [PATCH 1/2] package/clamav: New package Bernd Kuhls
@ 2014-09-28 14:42 ` Bernd Kuhls
2014-09-30 17:40 ` [Buildroot] [PATCH 1/2] package/clamav: New package Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Bernd Kuhls @ 2014-09-28 14:42 UTC (permalink / raw)
To: buildroot
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
package/exim/exim.mk | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/package/exim/exim.mk b/package/exim/exim.mk
index f6016fa..9ae94c3 100644
--- a/package/exim/exim.mk
+++ b/package/exim/exim.mk
@@ -48,6 +48,13 @@ define EXIM_USE_DEFAULT_CONFIG_FILE
$(call exim-config-unset,EXIM_MONITOR)
endef
+ifeq ($(BR2_PACKAGE_CLAMAV),y)
+EXIM_DEPENDENCIES += clamav
+define EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV
+ $(call exim-config-change,WITH_CONTENT_SCAN,yes)
+endef
+endif
+
define EXIM_CONFIGURE_TOOLCHAIN
$(call exim-config-add,CC,$(TARGET_CC))
$(call exim-config-add,CFLAGS,$(TARGET_CFLAGS))
@@ -65,6 +72,7 @@ endef
else # CUSTOM_CONFIG
define EXIM_CONFIGURE_CMDS
$(EXIM_USE_DEFAULT_CONFIG_FILE)
+ $(EXIM_USE_DEFAULT_CONFIG_FILE_CLAMAV)
$(EXIM_CONFIGURE_TOOLCHAIN)
endef
endif # CUSTOM_CONFIG
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/2] package/clamav: New package
2014-09-28 14:42 [Buildroot] [PATCH 1/2] package/clamav: New package Bernd Kuhls
2014-09-28 14:42 ` [Buildroot] [PATCH 2/2] package/exim: Add ClamAV support Bernd Kuhls
@ 2014-09-30 17:40 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2014-09-30 17:40 UTC (permalink / raw)
To: buildroot
Dear Bernd Kuhls,
On Sun, 28 Sep 2014 16:42:12 +0200, Bernd Kuhls wrote:
> diff --git a/package/Config.in b/package/Config.in
> index db06310..26dc69c 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -917,6 +917,7 @@ menu "Miscellaneous"
> source "package/aespipe/Config.in"
> source "package/bc/Config.in"
> source "package/collectd/Config.in"
> + source "package/clamav/Config.in"
Nit: clamav is before collectd by alphabetic ordering.
> diff --git a/package/clamav/Config.in b/package/clamav/Config.in
> new file mode 100644
> index 0000000..9840228
> --- /dev/null
> +++ b/package/clamav/Config.in
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_CLAMAV
> + select BR2_PACKAGE_OPENSSL
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_USE_MMU # fork()
> + bool "clamav"
Though it's not a written rule, I generally prefer to have the bool
"pkgname" line as the first line, before the select and dependencies.
> diff --git a/package/clamav/clamav-0002-static_linking.patch b/package/clamav/clamav-0002-static_linking.patch
> new file mode 100644
> index 0000000..71e4590
> --- /dev/null
> +++ b/package/clamav/clamav-0002-static_linking.patch
> @@ -0,0 +1,56 @@
> +Fix detection of statically linked libraries
> +
> +Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Has this patch been sent upstream like the first one?
Also, in the patch file name, I'd prefer to see static-linking.patch
rather than static_linking.patch. We tend to use - more commonly as a
separator in patch file names.
> diff --git a/package/clamav/clamav.mk b/package/clamav/clamav.mk
> new file mode 100644
> index 0000000..2db8577
> --- /dev/null
> +++ b/package/clamav/clamav.mk
> @@ -0,0 +1,53 @@
> +################################################################################
> +#
> +# clamav
> +#
> +################################################################################
> +
> +CLAMAV_VERSION = 0.98.4
> +CLAMAV_SITE = http://sourceforge.net/projects/clamav/files/clamav/$(CLAMAV_VERSION)
> +CLAMAV_LICENSE = GPLv2
I've checked the license and it's indeed GPLv2 only, not GPLv2+.
> +CLAMAV_LICENSE_FILES = COPYING
There are many other COPYING files, for some portion of source code
that ClamAV has imported. Even though the whole result is distributed
under GPLv2, I believe those additional COPYING.* files must be kept,
because some of them are related to BSD licensed software that requires
the copyright holder name to be preserved.
> +CLAMAV_AUTORECONF = YES
> +CLAMAV_DEPENDENCIES = openssl zlib \
> + $(if $(BR2_PACKAGE_LIBICONV),libiconv) \
Same comment as for the dovecot package: you should have a select
BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE if iconv support is needed
for your package.
> + $(if $(BR2_NEEDS_GETTEXT),gettext)
See
http://buildroot.org/downloads/manual/manual.html#_gettext_integration_and_interaction_with_packages
for details about the gettext handling: you need to do some stuff in
your Config.in file.
> +
> +# mmap cannot be detected when cross-compiling, needed for mempool support
> +CLAMAV_CONF_ENV = \
> + ac_cv_c_mmap_private=yes
> +
> +CLAMAV_CONF_OPT = \
> + --sysconfdir=/etc \
> + --with-dbdir=/var/lib/clamav \
> + --with-openssl=$(STAGING_DIR)/usr \
> + --with-zlib=$(STAGING_DIR)/usr \
Are OpenSSL and Zlib mandatory or optional?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-30 17:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-28 14:42 [Buildroot] [PATCH 1/2] package/clamav: New package Bernd Kuhls
2014-09-28 14:42 ` [Buildroot] [PATCH 2/2] package/exim: Add ClamAV support Bernd Kuhls
2014-09-30 17:40 ` [Buildroot] [PATCH 1/2] package/clamav: New package Thomas Petazzoni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.