[arch-commits] Commit in clamav/trunk (2 files)

Jan de Groot jgc at archlinux.org
Thu Mar 9 14:50:17 UTC 2017


    Date: Thursday, March 9, 2017 @ 14:50:17
  Author: jgc
Revision: 290208

upgpkg: clamav 0.99.2-4

OpenSSL 1.1

Added:
  clamav/trunk/make_it_compile_against_openssl_1_1_0.patch
Modified:
  clamav/trunk/PKGBUILD

---------------------------------------------+
 PKGBUILD                                    |   15 ++-
 make_it_compile_against_openssl_1_1_0.patch |   98 ++++++++++++++++++++++++++
 2 files changed, 108 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-03-09 14:49:27 UTC (rev 290207)
+++ PKGBUILD	2017-03-09 14:50:17 UTC (rev 290208)
@@ -5,13 +5,13 @@
 
 pkgname=clamav
 pkgver=0.99.2
-pkgrel=3
+pkgrel=4
 pkgdesc='Anti-virus toolkit for Unix'
 url='http://www.clamav.net/'
 license=('GPL')
 arch=('i686' 'x86_64')
 makedepends=('libmilter' 'llvm')
-depends=('bzip2' 'libltdl' 'llvm-libs' 'libxml2' 'curl')
+depends=('bzip2' 'libltdl' 'llvm-libs' 'libxml2' 'curl' 'pcre')
 validpgpkeys=('B964E6D7BC7D7C82CCB8D45840B8EA2364221D53'
               'F79FB2D08751574C5D3FDFFBB3D5342C260429A0')
 source=("http://www.clamav.net/downloads/production/${pkgname}-${pkgver}.tar.gz"{,.sig}
@@ -23,7 +23,8 @@
         'freshclamd.service'
         'Add-support-for-LLVM-3.7.patch'
         'Add-support-for-LLVM-3.8.patch'
-        'Add-support-for-LLVM-3.9.patch')
+        'Add-support-for-LLVM-3.9.patch'
+        'make_it_compile_against_openssl_1_1_0.patch')
 sha256sums=('167bd6a13e05ece326b968fdb539b05c2ffcfef6018a274a10aeda85c2c0027a'
             'SKIP'
             'ce4b9b8c300614641af600c9a73b52a00ee8e47ccc9f91b2428a113b0ecff21b'
@@ -34,7 +35,8 @@
             'dd5ff6c79ee360da5f2221c4d9110a2a8886d86293f6c93c16bf74fdb126593c'
             '2862fe2b5579c5bd59041c22326155c135946613ece1c3f2a6bd6f25b7af99a4'
             'c8d710f1d7f71bd754a7c4f58a1e1b6a23295b5eb18f7df3a098697e52e38b96'
-            'e71225e55b42a06741feaaa303133e947a98898751994645f5b34dd6503b61df')
+            'e71225e55b42a06741feaaa303133e947a98898751994645f5b34dd6503b61df'
+            '0a8e02a91bc3f2c99bd52dc475592637376baa991fe3f899b7745b840fc586c5')
 
 backup=('etc/clamav/clamd.conf'
         'etc/clamav/freshclam.conf'
@@ -47,7 +49,8 @@
 	patch -Np1 -i ../Add-support-for-LLVM-3.7.patch
 	patch -Np1 -i ../Add-support-for-LLVM-3.8.patch
 	patch -Np1 -i ../Add-support-for-LLVM-3.9.patch
-	autoreconf -vi libclamav/c++
+        patch -Np1 -i ../make_it_compile_against_openssl_1_1_0.patch
+	autoreconf -fi
 }
 
 build() {
@@ -64,6 +67,8 @@
 		--enable-milter \
 		--with-system-llvm \
 		--with-llvm-linking=dynamic
+
+        sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
 	make
 }
 

Added: make_it_compile_against_openssl_1_1_0.patch
===================================================================
--- make_it_compile_against_openssl_1_1_0.patch	                        (rev 0)
+++ make_it_compile_against_openssl_1_1_0.patch	2017-03-09 14:50:17 UTC (rev 290208)
@@ -0,0 +1,98 @@
+From 088af365ce4f715b9f1d41754651e01db6ebf39a Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
+Date: Sat, 2 Jul 2016 00:12:01 +0200
+Subject: make it compile against openssl 1.1.0
+
+- SSL_library_init() is no longer a function but a define invoking
+  another function with parameters. Thus a link check against this
+  function will fail. As a fix AC_LINK_IFELSE is used so the header file
+  can be included.
+
+- X509_CRL is opaque and needs an accessor. X509_CRL_get_nextUpdate() is
+  around since OpenSSL 0.9.1c. X509_cmp_current_time() seems to be
+  around since SSLeay 0.8.1b.
+
+BTS: https://bugs.debian.org/828083
+clamav: https://bugzilla.clamav.net/show_bug.cgi?id=11594
+Patch-Name: make_it_compile_against_openssl_1_1_0.patch
+
+Signed-off-by: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
+---
+ libclamav/crypto.c                | 21 ++++++---------------
+ m4/reorganization/libs/openssl.m4 | 12 +++++++++---
+ 2 files changed, 15 insertions(+), 18 deletions(-)
+
+diff --git a/libclamav/crypto.c b/libclamav/crypto.c
+index c62c65a..4be900f 100644
+--- a/libclamav/crypto.c
++++ b/libclamav/crypto.c
+@@ -1096,7 +1096,6 @@ X509_CRL *cl_load_crl(const char *file)
+ {
+     X509_CRL *x=NULL;
+     FILE *fp;
+-    struct tm *tm;
+ 
+     if (!(file))
+         return NULL;
+@@ -1110,21 +1109,13 @@ X509_CRL *cl_load_crl(const char *file)
+     fclose(fp);
+ 
+     if ((x)) {
+-        tm = cl_ASN1_GetTimeT(x->crl->nextUpdate);
+-        if (!(tm)) {
+-            X509_CRL_free(x);
+-            return NULL;
+-        }
++	ASN1_TIME *tme;
+ 
+-#if !defined(_WIN32)
+-        if (timegm(tm) < time(NULL)) {
+-            X509_CRL_free(x);
+-            free(tm);
+-            return NULL;
+-        }
+-#endif
+-
+-        free(tm);
++	tme = X509_CRL_get_nextUpdate(x);
++	if (!tme || X509_cmp_current_time(tme) < 0) {
++		X509_CRL_free(x);
++		return NULL;
++	}
+     }
+ 
+     return x;
+diff --git a/m4/reorganization/libs/openssl.m4 b/m4/reorganization/libs/openssl.m4
+index 78e2c23..45ee02d 100644
+--- a/m4/reorganization/libs/openssl.m4
++++ b/m4/reorganization/libs/openssl.m4
+@@ -26,12 +26,13 @@ save_LDFLAGS="$LDFLAGS"
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ 
+-SSL_LIBS="-lssl -lcrypto -lz"
++SSL_LIBS="$LIBS -lssl -lcrypto -lz"
++LIBS="$LIBS $SSL_LIBS"
+ 
+ if test "$LIBSSL_HOME" != "/usr"; then
+     SSL_LDFLAGS="-L$LIBSSL_HOME/lib"
+     SSL_CPPFLAGS="-I$LIBSSL_HOME/include"
+-    LDFLAGS="-L$LIBSSL_HOME/lib $SSL_LIBS"
++    LDFLAGS="-L$LIBSSL_HOME/lib"
+     CFLAGS="$SSL_CPPFLAGS"
+ else
+     SSL_LDFLAGS=""
+@@ -41,7 +42,12 @@ fi
+ 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 -lz])
++AC_LINK_IFELSE(
++	       [AC_LANG_PROGRAM([[#include <openssl/ssl.h>]],
++				[[SSL_library_init();]])],
++	       [have_ssl="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])
+ 


More information about the arch-commits mailing list