From unknown Thu Jun 19 14:00:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#32958 <32958@debbugs.gnu.org> To: bug#32958 <32958@debbugs.gnu.org> Subject: Status: [PATCH] gnu: Add clamav. Reply-To: bug#32958 <32958@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:00:58 +0000 retitle 32958 [PATCH] gnu: Add clamav. reassign 32958 guix-patches submitter 32958 Christopher Baines severity 32958 normal tag 32958 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 06 15:16:31 2018 Received: (at submit) by debbugs.gnu.org; 6 Oct 2018 19:16:31 +0000 Received: from localhost ([127.0.0.1]:38843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8s3u-00037a-Hv for submit@debbugs.gnu.org; Sat, 06 Oct 2018 15:16:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55473) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8s3p-00037B-Td for submit@debbugs.gnu.org; Sat, 06 Oct 2018 15:16:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8s3f-0003by-7U for submit@debbugs.gnu.org; Sat, 06 Oct 2018 15:16:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g8s3f-0003bm-3r for submit@debbugs.gnu.org; Sat, 06 Oct 2018 15:16:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8s3b-0007fx-PN for guix-patches@gnu.org; Sat, 06 Oct 2018 15:16:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8rwf-00052I-TK for guix-patches@gnu.org; Sat, 06 Oct 2018 15:09:01 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:39988 helo=mira.cbaines.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8rwf-00051v-K1 for guix-patches@gnu.org; Sat, 06 Oct 2018 15:08:57 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id C4B74166BC; Sat, 6 Oct 2018 20:08:56 +0100 (BST) Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 4C790166B7 for ; Sat, 6 Oct 2018 20:08:56 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id c5481026 for ; Sat, 6 Oct 2018 19:08:55 +0000 (UTC) From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH] gnu: Add clamav. Date: Sat, 6 Oct 2018 20:08:55 +0100 Message-Id: <20181006190855.3537-1-mail@cbaines.net> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * gnu/packages/antivirus.scm: New file. * gnu-system.am: Add it. --- gnu/local.mk | 1 + gnu/packages/antivirus.scm | 119 +++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 gnu/packages/antivirus.scm diff --git a/gnu/local.mk b/gnu/local.mk index 8f854e98b5..c480be9f30 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -60,6 +60,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/android.scm \ %D%/packages/animation.scm \ %D%/packages/anthy.scm \ + %D%/packages/antivirus.scm \ %D%/packages/apl.scm \ %D%/packages/apr.scm \ %D%/packages/aspell.scm \ diff --git a/gnu/packages/antivirus.scm b/gnu/packages/antivirus.scm new file mode 100644 index 0000000000..513a5affc0 --- /dev/null +++ b/gnu/packages/antivirus.scm @@ -0,0 +1,119 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2018 Christopher Baines +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (a= t +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages antivirus) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages curl) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages tls) + #:use-module (gnu packages web) + #:use-module (gnu packages xml)) + +(define-public clamav + (package + (name "clamav") + (version "0.100.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/Cisco-Talos/clamav-devel/archive= /clamav-" + version ".tar.gz")) + (sha256 + (base32 + "0wpamsp3lhlj9dhj5s9nzbyvhrbbnyifm8cjvnssh80sdmkd0dqf")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "win32") + (delete-file-recursively "libclamav/c++/llvm") + #t)))) + (build-system gnu-build-system) + (arguments + '(;; TODO Tests seem to fail, not sure why yet. + #:tests? #f + #:make-flags '("VERBOSE=3D1") + #:configure-flags (list "--enable-check" + "--with-dbdir=3D/var/lib/clamav" + "--sysconfdir=3D/etc/clamav" + "--with-system-libmspack" + "--without-included-ltdl" + (string-append "--with-zlib=3D" + (assoc-ref %build-inputs + "zlib")) + (string-append "--with-libjson=3D" + (assoc-ref %build-inputs + "json-c")) + (string-append "--with-xml=3D" + (assoc-ref %build-inputs + "libxml2")) + (string-append "--with-libcurl=3D" + (assoc-ref %build-inputs + "curl")) + (string-append "--with-openssl=3D" + (assoc-ref %build-inputs + "openssl"))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (substitute* "Makefile.in" + ;; Prevent writing to /etc upon install, instead the samp= le + ;; files are copied in to the output in the 'install-etc = phase + ((" etc ") " ")))) + (add-after 'install 'install-etc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (etc (string-append out "/etc"))) + (for-each (lambda (file) + (install-file file etc)) + (find-files "etc" ".*\\.sample")))))))) + (native-inputs + `(("check" ,check))) + (inputs + `(("openssl" ,openssl) + ("libmspack" ,libmspack) + ("libltdl", libltdl) + ("json-c" ,json-c) + ("ncurses" ,ncurses) + ("perl" ,perl) + ("pcre2" ,pcre2) + ("libxml2" ,libxml2) + ("curl" ,curl) + ("zlib" ,zlib))) + (synopsis "Antivirus engine for viruses and other malicious software= ") + (description + "Clam AntiVirus is an anti-virus toolkit, for detecting trojans, vi= ruses, +malware and other malicious software. This package provides a flexible = and +scalable multi-threaded daemon, a command-line scanner and a tool to fet= ch +up-to-date virus definitions.") + (home-page "https://www.clamav.net/") + (license + (list license:gpl2 ;; clamav-milter, clambc, clamconf, clamd, clamd= scan, + ;; libclamav, libfreshclam + license:gpl2+ ;; many files + ;; some files in libclamav + bsd-2 zlib asl2.0)))) --=20 2.19.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 06 15:56:31 2018 Received: (at 32958) by debbugs.gnu.org; 6 Oct 2018 19:56:31 +0000 Received: from localhost ([127.0.0.1]:38863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8sgg-00065v-Qk for submit@debbugs.gnu.org; Sat, 06 Oct 2018 15:56:31 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:57962 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8sgd-00065k-IW for 32958@debbugs.gnu.org; Sat, 06 Oct 2018 15:56:30 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id BEA02166BF; Sat, 6 Oct 2018 20:56:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 9E44E166BC for <32958@debbugs.gnu.org>; Sat, 6 Oct 2018 20:56:26 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 42a3faf4 for <32958@debbugs.gnu.org>; Sat, 6 Oct 2018 19:56:26 +0000 (UTC) References: <20181006190855.3537-1-mail@cbaines.net> User-agent: mu4e 1.0; emacs 26.1 From: Christopher Baines To: 32958@debbugs.gnu.org Subject: Re: [bug#32958] [PATCH] gnu: Add clamav. In-reply-to: <20181006190855.3537-1-mail@cbaines.net> Date: Sat, 06 Oct 2018 20:56:23 +0100 Message-ID: <87d0sm26jc.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32958 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Tags: moreinfo This probably isn't ready quite yet, as the source release includes quite a bit of bundled software, and I've only had an initial attempt at cleaning it up. I also haven't looked in to the test suite in detail. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlu5E2dfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xc/1g/+Ot6csP6pRuuKTmSTsRYrKFUjGsvNgKu5Nx1IF93WDZ7rGsndrV/9/P/X Kul+7SyEfK1MGyVqo6WzKwAPrYArr1oPkg5fPf8TEgGIpYuU4k0G+ofCBJ7jiM0i B5wT7Ye44vu2a9nksHT1BMMI32eeGqyY1uD3AU/RoDXJmfEWxyQN/6VLUuT04s7f f0U7uyBm6PA6S+k39nNi7V0D5PissgfgdCk6BTrnodgHGy9TUQ1niCaUd7r3qyKb CKGccMqzA4Eybkwq30gXE1lZqPACqB3rKU5cdcB8VQrz+qpfleGFdBRAZJ/V0j4d YOV9LZpanv6gWrtbl0M5L8RYXm1rCrZt1HIpgCl1qsLO2ipFuuEe+HJc7IisnsjE 4rYOtUP23gEgrgynDEPCWtPJd8JPANlITqqhbQomogsCCKi2sPHE4RaJ5WUw5u8o MXfqnz0hI6nMWlOniQS+2v9ly8UzKkDBzrlcAw3a6LH7JnNVc6tbWFAtBcdxhPVy 0dqTiA0FvnF6PCSITKUs1QT1cjksk2yBnQqzrphHej8M+LjDWPXXP4+rnsbPND62 f7FAsuR5e9Wq/jco3ua1HCdgw3/F8WAlXikoL4s9+11RxDInxuRXTIwgV4WBeNSU YxbUVz/n8e/nmJGCXHmo7yhzbxMb8Xqxnz8NZkaASo/W1btt7sw= =RWuF -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 06 21:49:30 2018 Received: (at 32958) by debbugs.gnu.org; 7 Oct 2018 01:49:30 +0000 Received: from localhost ([127.0.0.1]:38952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8yCI-0005sf-44 for submit@debbugs.gnu.org; Sat, 06 Oct 2018 21:49:30 -0400 Received: from mail.onyx.syn-alias.com ([206.152.134.66]:30693 helo=smtp.centurylink.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g8yCG-0005sS-7B for 32958@debbugs.gnu.org; Sat, 06 Oct 2018 21:49:28 -0400 DKIM-Signature: v=1; a=rsa-sha1; d=centurylink.net; s=ctl201402; c=relaxed/simple; q=dns/txt; i=@centurylink.net; t=1538876962; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=92O/JxbssgPWdFAr4YdpQmVIlvg=; b=hG42YyPV5uIwrOwkytDlS3yENWmhGgbPi//w/Dg6ZAU0vqXkASKtrymhx+2GZlOv SEjJD/L8U4DNk/Cio43/EqMKM++zqN66ixL/pRoBc+MNwcLP1hPqnkBLUwC7T/mH 09Ojq3uTk2Sv8RiUhk51JkJIuPnq1qUwT4IUHzzUp4ImRie5QpkvTk+aSBn7P13b 5UhqrwGBabHMzbdqMdvU1Kj3TB95mbouk+/GfrivKmPpRo6nZc2A/1mAFEfvvW0B xcmEBZuxlGMSAq3JWURlk1fb43V06ZmNnK/1gIkwjgmDzQumYu6L9wh/zepJJdxe eHI0xNcmHUZOsTuJrzAxAg==; X_CMAE_Category: , , X-CNFS-Analysis: v=2.2 cv=VYG1Bxh9 c=1 sm=1 tr=0 a=Vu7z8M9e1LIwUEYGhYu9hw==:117 a=Vu7z8M9e1LIwUEYGhYu9hw==:17 a=KGjhK52YXX0A:10 a=smKx5t2vBNcA:10 a=zSv6zi-ZgakA:10 a=6p5tJGysAAAA:8 a=4IKM6APNKHlRztx9xC4A:9 a=CjuIK1q_8ugA:10 a=SoZxF0eGzvPigWOA8tYA:9 a=_0FUqLgETZhrmoPQVCW9:22 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine X-Authed-Username: ZXJpY2JhdmllckBjZW50dXJ5bGluay5uZXQ= Authentication-Results: smtp01.onyx.dfw.sync.lan smtp.user=ericbavier@centurylink.net; auth=pass (LOGIN) Received: from [97.116.113.123] ([97.116.113.123:37782] helo=localhost) by smtp.centurylink.net (envelope-from ) (ecelerity 3.6.25.56547 r(Core:3.6.25.0)) with ESMTPSA (cipher=AES256-GCM-SHA384) id F2/60-09542-22669BB5; Sat, 06 Oct 2018 21:49:22 -0400 Date: Sat, 6 Oct 2018 20:49:19 -0500 From: Eric Bavier To: Christopher Baines Subject: Re: [bug#32958] [PATCH] gnu: Add clamav. Message-ID: <20181006204919.67c71003@centurylink.net> In-Reply-To: <87d0sm26jc.fsf@cbaines.net> References: <20181006190855.3537-1-mail@cbaines.net> <87d0sm26jc.fsf@cbaines.net> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/5g.yLtndxoocDFm6WbDAe0M"; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32958 Cc: 32958@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Sig_/5g.yLtndxoocDFm6WbDAe0M Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Christopher, On Sat, 06 Oct 2018 20:56:23 +0100 Christopher Baines wrote: > Tags: moreinfo >=20 > This probably isn't ready quite yet, as the source release includes > quite a bit of bundled software, and I've only had an initial attempt at > cleaning it up. I also haven't looked in to the test suite in detail. I've had a local clamav patch for a while now, and had just recently picked it up to dust it off for the 0.100.2 release. Much is similar to your patch, and I had started writing a clamd service. Do you mind if I merge some parts of your patch into mine and then send it here? `~Eric --Sig_/5g.yLtndxoocDFm6WbDAe0M Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlu5ZiAACgkQ/XPKxxnT JWa7CQ//djl0PmSqgeGftaO3RO4hBUijUyvwyfBHbs0uc6JB0R08RQ+XOE6YOB6n cxkIItzOs7TyQeJecncPC9WHnxvwv3fivtIKl3zspEWpPOGJs5G+jL6m0YSiF9RJ BmXk5GUhkf5HdRUhSA/c9KInpnhsEVpjkwe8RPyyXN1bzwAuRBkiU6I8y9ONxnri Pt9M6LQGgO6iBN4JFhxi+5ygxswndvOXVo/ITaPjCqjUWoo25TumLgy4+U6GgQvG fGe6yPQrF7KjjlETKyoM+dIHjaXqAzVgkvZnMcJWI8QKLjTPgzrboWD89b291qBc sv4vy2CBn5+WUsyaAqH44Nbodm8MEZFVCoIPUzwgmxAMGWOT0MlL4JrtMPESbYXt P5UyhfkVkUY0+P5qCiUe/jZK8+L8d52fybcb65JtPHkXv3Z5FV6TlnM/sqKux/d9 J4muTqawG/0cq5D2PniFNyZrF+qUEOLXkzF5ILhVMxniNsML/Qgkst6yxHHwqUoU pQOKmU4eDjJODAVXBaFn0Dv4vdFKCSgmiWodC6KnbjCR9/aB7e8L21HOe/k1fjW8 ppJHXu/GtvetogAjewjKCe7KQKZsc1Hro6A6WHmTNG+sZtEDykNsfAh8PJfQwCnk YcfA4e1j084Vl6sUIZ/0VLf3vRdJYP/vMsmwXK+4/W584C8ONu4= =+siO -----END PGP SIGNATURE----- --Sig_/5g.yLtndxoocDFm6WbDAe0M-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 07 04:36:20 2018 Received: (at 32958) by debbugs.gnu.org; 7 Oct 2018 08:36:20 +0000 Received: from localhost ([127.0.0.1]:39033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g94Y0-0007YC-1D for submit@debbugs.gnu.org; Sun, 07 Oct 2018 04:36:20 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:58084 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g94Xy-0007Y3-4Y for 32958@debbugs.gnu.org; Sun, 07 Oct 2018 04:36:18 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 4F82E1667F; Sun, 7 Oct 2018 09:36:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id DA8B21663D; Sun, 7 Oct 2018 09:36:16 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id c86b8289; Sun, 7 Oct 2018 08:36:16 +0000 (UTC) References: <20181006190855.3537-1-mail@cbaines.net> <87d0sm26jc.fsf@cbaines.net> <20181006204919.67c71003@centurylink.net> User-agent: mu4e 1.0; emacs 26.1 From: Christopher Baines To: Eric Bavier Subject: Re: [bug#32958] [PATCH] gnu: Add clamav. In-reply-to: <20181006204919.67c71003@centurylink.net> Date: Sun, 07 Oct 2018 09:36:16 +0100 Message-ID: <87bm8617cv.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32958 Cc: 32958@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eric Bavier writes: > Hi Christopher, > > On Sat, 06 Oct 2018 20:56:23 +0100 > Christopher Baines wrote: > >> Tags: moreinfo >>=20 >> This probably isn't ready quite yet, as the source release includes >> quite a bit of bundled software, and I've only had an initial attempt at >> cleaning it up. I also haven't looked in to the test suite in detail. > > I've had a local clamav patch for a while now, and had just recently > picked it up to dust it off for the 0.100.2 release. Much is similar > to your patch, and I had started writing a clamd service. Do you mind > if I merge some parts of your patch into mine and then send it here? Not at all Eric, that sounds great :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlu5xYBfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xcqxw/+MsP/B/NGWrqtUbPSUJ3yi9Cv/KT+d4dvPfVPz9ax86nQWvrZdemTqlPk P+B06r/khSdKFEJJYDA20rr+/Bk934JpEMJrR12Zwr1s9rI1A23EcmdtmLnnVc0d QJtwlP8jvXJ0/je59YCKfegbWuxaM7G+jgza3t6WyfO+95rZpNoRuMf6CX4f19CW yrgR9UO5yToB2p4pv6BOUDZ2PfB0BnTxek5tEhahF+GAGTsA2HMc5wXoeXPBiqKZ 3SVgPN52usnoE9SGXevzIGfTi8srtijjV9YGDfMbD/2ETY/tdDoSznX3BwTP0gsm 40GFKQVHMP0eXmJ/K0OX1/JJRLRgLkADJOkbuLMS1QNqR+2w125Ow9bEjNFEc4Rw 8Gv6JQTGOTWqFuR9eEN6N8PiHP0voHjzm+G0bLnTYsUzcBAQFQP5kzxjcdF5Zxgj 8treLDtPtgrn9ocoqoWkp9B7CRboN4Fy3CbkekjbKJiZHDT/W3pxbYs0SvsulnbR MsxvQhREuxPAh3PcEd1F3rZceehK5dkwOphEO04Gnl1jAJ8w2NCnzyXJvGfb6tW7 Jsit4eibG+wxd2uy2hfJq6Mqtj3auIYbsw/iH5YZkICkz0qCjTeYRbSklKhNBg0Z CF3kaJNGtBz+vQ7fxclAwwVW2far7FMlNfXRd6rEKnTmeetzGao= =BaB3 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 24 12:09:56 2018 Received: (at 32958) by debbugs.gnu.org; 24 Oct 2018 16:09:56 +0000 Received: from localhost ([127.0.0.1]:40407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFLj8-0005TQ-SC for submit@debbugs.gnu.org; Wed, 24 Oct 2018 12:09:56 -0400 Received: from mail.onyx.syn-alias.com ([206.152.134.66]:19488 helo=smtp.centurylink.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFLj4-0005TA-Eq for 32958@debbugs.gnu.org; Wed, 24 Oct 2018 12:09:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; d=centurylink.net; s=ctl201402; c=relaxed/simple; q=dns/txt; i=@centurylink.net; t=1540397376; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=7xS/E3QuBtSs6XUB2Wlh8iFUzb0=; b=fs4EwQDgY6zdKdcCE50QC+i/31UA2yHQ3cATuViQun8ELxSLt9psD80SLjA/623l 7x6ybgU9dEDKRiycci83E2D6oHdFLBzQazIDD8ITQaGlxXBQ8ajnJxlkyIhwc59x AMxDJYWH9mRFpdfOxj1FWuxIz8DPc4AdhVWk80GE8NinOSy/ylK9rBNQjeYyYjOd oWIeuOVW7I8G7YEH+Lm5OXhsiiTZM4x09sl0jpG/CJcKbbBYnPWJsCqemB7udcw2 BtTXeuyrWDEXkNwtCPpKY8vHCZgDipS+a2IUlWP69k+WPcOiKXLB0uuaRDnPhRyt N+niT+swRk1GWOlsA9/HsQ==; X_CMAE_Category: , , X-CNFS-Analysis: v=2.2 cv=dM7ko6Rb c=1 sm=1 tr=0 a=MhzntBxPsQQsyKet5jur4A==:117 a=MhzntBxPsQQsyKet5jur4A==:17 a=KGjhK52YXX0A:10 a=smKx5t2vBNcA:10 a=zSv6zi-ZgakA:10 a=6p5tJGysAAAA:8 a=I_5RNyk1AAAA:8 a=m3aR0QT-H4MJpKmTA9EA:9 a=CjuIK1q_8ugA:10 a=inoG4m36AAAA:8 a=DeTtaYkFAAAA:8 a=mDV3o1hIAAAA:8 a=pGLkceISAAAA:8 a=mnYKqw1PrJMJn6RJHVcA:9 a=NEAV23lmAAAA:8 a=LC3U6v5cAAAA:8 a=DN4mnMEKBpwP8ickrTEA:9 a=tPundid6AAAA:8 a=mK_AVkanAAAA:8 a=iQMAAHXTKVChP_hzixMA:9 a=AkD41feu_dcGFPaPxSQA:9 a=_0FUqLgETZhrmoPQVCW9:22 a=Eh9yxdLE6B1twWrs3SXz:22 a=_Qgj-RFg6mImvLaOgLPg:22 a=u3kAxhQgt60KRQjNhRLG:22 a=_FVE-zBwftR9WsbkzFJk:22 a=krHwHidONISgUGlGLXRm:22 a=aPicV9olnlo_TREvANR5:22 a=3gWm3jAn84ENXaBijsEo:22 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine X-Authed-Username: ZXJpY2JhdmllckBjZW50dXJ5bGluay5uZXQ= Authentication-Results: smtp02.onyx.dfw.sync.lan smtp.user=ericbavier@centurylink.net; auth=pass (LOGIN) Received: from [97.116.181.145] ([97.116.181.145:35168] helo=localhost) by smtp.centurylink.net (envelope-from ) (ecelerity 3.6.25.56547 r(Core:3.6.25.0)) with ESMTPSA (cipher=AES256-GCM-SHA384) id 1B/B0-07019-F3990DB5; Wed, 24 Oct 2018 12:09:35 -0400 Date: Wed, 24 Oct 2018 11:09:27 -0500 From: Eric Bavier To: Christopher Baines Subject: Re: [bug#32958] [PATCH] gnu: Add clamav. Message-ID: <20181024110927.7442ebf1@centurylink.net> In-Reply-To: <87bm8617cv.fsf@cbaines.net> References: <20181006190855.3537-1-mail@cbaines.net> <87d0sm26jc.fsf@cbaines.net> <20181006204919.67c71003@centurylink.net> <87bm8617cv.fsf@cbaines.net> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/ACGh4sw+sLwMgI6h1pZ+qEv"; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32958 Cc: 32958@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Sig_/ACGh4sw+sLwMgI6h1pZ+qEv Content-Type: multipart/mixed; boundary="MP_/12oL99DRp5kU36ymTJmk02z" --MP_/12oL99DRp5kU36ymTJmk02z Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sun, 07 Oct 2018 09:36:16 +0100 Christopher Baines wrote: > Eric Bavier writes: >=20 > > Hi Christopher, > > > > On Sat, 06 Oct 2018 20:56:23 +0100 > > Christopher Baines wrote: > > =20 > >> Tags: moreinfo > >>=20 > >> This probably isn't ready quite yet, as the source release includes > >> quite a bit of bundled software, and I've only had an initial attempt = at > >> cleaning it up. I also haven't looked in to the test suite in detail. = =20 > > > > I've had a local clamav patch for a while now, and had just recently > > picked it up to dust it off for the 0.100.2 release. Much is similar > > to your patch, and I had started writing a clamd service. Do you mind > > if I merge some parts of your patch into mine and then send it here? =20 >=20 > Not at all Eric, that sounds great :) Here is my small series of patches. 1. Turns on RTTI in llvm by default. 2. Adds a TomsFastMath package that is otherwise bundled in clamav 3. Adds clamav. Uses a patch borrowed from debian to use a system tomsfastmath and uses a system llvm. A few tests that cannot pass inside the build container are skipped. I'm not posting my clamd-service at this time because it needs quite a bit more work. `~Eric --MP_/12oL99DRp5kU36ymTJmk02z Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-llvm-Build-with-RTTI-by-default.patch =46rom 90e3dc98e1657964041f576b785524816394b03a Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 5 Oct 2018 22:58:43 -0500 Subject: [PATCH 1/4] llvm: Build with RTTI by default. Increases size of llvm@6 by 2.5MiB (2.5%), but saves building specialized llvm's with rtti enabled for packages that require RTTI when linking with t= he llvm libraries. * gnu/packages/llvm.scm (llvm-with-rtti): Remove variable. (llvm)[arguments]: Add '-DLLVM_REQUIRES_RTTI=3D1' to #:configure-flags. * gnu/packages/audio.scm (faust-2)[native-inputs]: 'llvm-with-rtti' -> 'llv= m'. --- gnu/packages/audio.scm | 2 +- gnu/packages/llvm.scm | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index ee18b0022..389bf429d 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -1194,7 +1194,7 @@ PS, and DAB+.") `(list (string-append "prefix=3D" (assoc-ref %outputs "out")) "world")))) (native-inputs - `(("llvm" ,llvm-with-rtti) + `(("llvm" ,llvm) ("which" ,which) ("xxd" ,xxd) ("ctags" ,emacs-minimal) ; for ctags diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index d0791d00c..beca92650 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2014, 2016 Eric Bavier +;;; Copyright =C2=A9 2014, 2016, 2018 Eric Bavier ;;; Copyright =C2=A9 2015 Mark H Weaver ;;; Copyright =C2=A9 2015, 2017, 2018 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2016 Dennis Mungai @@ -65,6 +65,7 @@ "-DCMAKE_BUILD_WITH_INSTALL_RPATH=3DFALSE" "-DBUILD_SHARED_LIBS:BOOL=3DTRUE" "-DLLVM_ENABLE_FFI:BOOL=3DTRUE" + "-DLLVM_REQUIRES_RTTI=3D1" ; For some third-par= ty utilities "-DLLVM_INSTALL_UTILS=3DON") ; Needed for rustc. =20 ;; Don't use '-g' during the build, to save space. @@ -90,17 +91,6 @@ languages is in development. The compiler infrastructur= e includes mirror sets of programming tools as well as libraries with equivalent functionality.") (license license:ncsa))) =20 -(define-public llvm-with-rtti - (package (inherit llvm) - (name "llvm-with-rtti") - (arguments - (substitute-keyword-arguments (package-arguments llvm) - ((#:configure-flags flags) - `(append '("-DCMAKE_SKIP_BUILD_RPATH=3DFALSE" - "-DCMAKE_BUILD_WITH_INSTALL_RPATH=3DFALSE" - "-DLLVM_REQUIRES_RTTI=3D1") - ,flags)))))) - (define* (clang-runtime-from-llvm llvm hash #:optional (patches '())) (package --=20 2.19.1 --MP_/12oL99DRp5kU36ymTJmk02z Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0002-gnu-Add-TomsFastMath.patch =46rom 8161999c7e11536d2d5d2bdc6bdcde94d06d98dc Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Oct 2016 23:26:49 -0500 Subject: [PATCH 2/4] gnu: Add TomsFastMath. * gnu/packages/multiprecision.scm (tomsfastmath): New variable. * gnu/packages/patches/tomsfastmath-constness.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/multiprecision.scm | 66 ++++++++++++++++ .../patches/tomsfastmath-constness.patch | 76 +++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 gnu/packages/patches/tomsfastmath-constness.patch diff --git a/gnu/local.mk b/gnu/local.mk index 47883f829..62e264f29 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1174,6 +1174,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/tk-find-library.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/ttfautohint-source-date-epoch.patch \ + %D%/packages/patches/tomsfastmath-constness.patch \ %D%/packages/patches/totem-meson-easy-codec.patch \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %D%/packages/patches/twinkle-include-qregexpvalidator.patch \ diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.= scm index 4f5eac16b..71e1efcd8 100644 --- a/gnu/packages/multiprecision.scm +++ b/gnu/packages/multiprecision.scm @@ -26,6 +26,7 @@ (define-module (gnu packages multiprecision) #:use-module (guix licenses) #:use-module (gnu packages) + #:use-module (gnu packages autotools) #:use-module (gnu packages m4) #:use-module (gnu packages gcc) #:use-module (guix packages) @@ -225,3 +226,68 @@ minor changes to the source code. In most cases only = a few type statements and (for Fortran-90 programs) read/write statements need to be changed. P= SLQ and numerical quadrature programs are included.") (license bsd-3))) + +(define-public tomsfastmath + (package + (name "tomsfastmath") + (version "0.13.0") + (synopsis "Large integer arithmetic library") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/libtom/tomsfastmath/" + "releases/download/v" version "/" + "tfm-" (version-major+minor version) ".t= ar.bz2")) + (sha256 + (base32 + "01rlsvp6lskk2a0gfdi24ak5h8vdwi6kqbvbwjnmb92r0zrfdvwd")) + (patches (search-patches "tomsfastmath-constness.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("libtool" ,libtool))) + (arguments + `(#:make-flags (list "-f" "makefile.shared" + (string-append "LIBPATH=3D" %output "/lib") + (string-append "INCPATH=3D" %output "/include") + "GROUP=3Droot" "USER=3Droot" + "CC=3Dgcc") + #:phases + (modify-phases %standard-phases + (delete 'configure) ;no configuration + (replace 'check + (lambda* (#:key make-flags #:allow-other-keys) + (and (zero? (apply system* "make" + "stest" "test_standalone" + make-flags)) + (zero? (system* "./stest")) + (zero? (system* "./test"))))) + (add-before 'install 'install-nogroup + (lambda _ + ;; Let permissions inherit from the current process + (substitute* "makefile.shared" + (("-g \\$\\(GROUP\\) -o \\$\\(USER\\)") "")) + #t)) + (add-after 'install 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + (let ((docdir (string-append (assoc-ref outputs "out") + "/share/doc/tomsfastmath"))) + (install-file "doc/tfm.pdf" docdir) + #t))) + (add-after 'install 'install-pc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (pc-dir (string-append out "/lib/pkgconfig"))) + (call-with-output-file "tomsfastmath.pc" + (lambda (port) + (format port "~ +Name: TomsFastMath +Description: ~a +Version: ~a +Libs: -L~a/lib -ltfm~%" + ,synopsis ,version out))) + (install-file "tomsfastmath.pc" pc-dir) + #t)))))) + (home-page "http://www.libtom.org/TomsFastMath/") + (description "TomsFastMath is a large integer library written in porta= ble +ISO C. It is a port of LibTomMath with optional support for inline assemb= ler +multiplies.") + (license public-domain))) diff --git a/gnu/packages/patches/tomsfastmath-constness.patch b/gnu/packag= es/patches/tomsfastmath-constness.patch new file mode 100644 index 000000000..7c6ab5bbe --- /dev/null +++ b/gnu/packages/patches/tomsfastmath-constness.patch @@ -0,0 +1,76 @@ +From dac089515901d6bf315cd15a6e744b8d2c02c1cb Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Sat, 31 Oct 2015 22:48:07 +0100 +Subject: [PATCH] tfm: make a few functions static + +clamav expects them to be static and it does not seem bad to do so. + +Signed-off-by: Sebastian Andrzej Siewior +--- + src/bin/fp_read_radix.c | 2 +- + src/bin/fp_read_signed_bin.c | 2 +- + src/bin/fp_read_unsigned_bin.c | 2 +- + src/headers/tfm.h | 6 +++--- + 4 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/bin/fp_read_radix.c b/src/bin/fp_read_radix.c +index 0b5e826..431afa0 100644 +--- a/src/bin/fp_read_radix.c ++++ b/src/bin/fp_read_radix.c +@@ -9,7 +9,7 @@ + */ + #include +=20 +-int fp_read_radix(fp_int *a, char *str, int radix) ++int fp_read_radix(fp_int *a, const char *str, int radix) + { + int y, neg; + char ch; +diff --git a/src/bin/fp_read_signed_bin.c b/src/bin/fp_read_signed_bin.c +index e2b8003..6467d19 100644 +--- a/src/bin/fp_read_signed_bin.c ++++ b/src/bin/fp_read_signed_bin.c +@@ -9,7 +9,7 @@ + */ + #include +=20 +-void fp_read_signed_bin(fp_int *a, unsigned char *b, int c) ++void fp_read_signed_bin(fp_int *a, const unsigned char *b, int c) + { + /* read magnitude */ + fp_read_unsigned_bin (a, b + 1, c - 1); +diff --git a/src/bin/fp_read_unsigned_bin.c b/src/bin/fp_read_unsigned_bin= .c +index 3ee64c0..2ee89cb 100644 +--- a/src/bin/fp_read_unsigned_bin.c ++++ b/src/bin/fp_read_unsigned_bin.c +@@ -9,7 +9,7 @@ + */ + #include +=20 +-void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c) ++void fp_read_unsigned_bin(fp_int *a, const unsigned char *b, int c) + { + /* zero the int */ + fp_zero (a); +diff --git a/src/headers/tfm.h b/src/headers/tfm.h +index af87b56..f406388 100644 +--- a/src/headers/tfm.h ++++ b/src/headers/tfm.h +@@ -467,14 +467,14 @@ int fp_prime_random_ex(fp_int *a, int t, int size, i= nt flags, tfm_prime_callback + int fp_count_bits(fp_int *a); +=20 + int fp_unsigned_bin_size(fp_int *a); +-void fp_read_unsigned_bin(fp_int *a, unsigned char *b, int c); ++void fp_read_unsigned_bin(fp_int *a, const unsigned char *b, int c); + void fp_to_unsigned_bin(fp_int *a, unsigned char *b); +=20 + int fp_signed_bin_size(fp_int *a); +-void fp_read_signed_bin(fp_int *a, unsigned char *b, int c); ++void fp_read_signed_bin(fp_int *a, const unsigned char *b, int c); + void fp_to_signed_bin(fp_int *a, unsigned char *b); +=20 +-int fp_read_radix(fp_int *a, char *str, int radix); ++int fp_read_radix(fp_int *a, const char *str, int radix); +=20 + int fp_radix_size(fp_int *a, int radix, int *size); + int fp_toradix(fp_int *a, char *str, int radix); --=20 2.19.1 --MP_/12oL99DRp5kU36ymTJmk02z Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0003-gnu-Add-ClamAV.patch =46rom 6f9dfe688d0e7119f477d5418ffbf529c5a3f411 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 28 Oct 2016 22:42:59 -0500 Subject: [PATCH 3/4] gnu: Add ClamAV. * gnu/packages/antivirus.scm: New file. * gnu/packages/patches/clamav-system-tomsfastmath.patch, gnu/packages/patches/clamav-config-llvm-libs.patch: New files. * gnu/local.mk (GNU_SYSTEM_MODULES): Add new module. (dist_patch_DATA): Add patches. Co-authored-by: Christopher Baines --- gnu/local.mk | 4 +- gnu/packages/antivirus.scm | 156 ++++++++++++++++++ .../patches/clamav-config-llvm-libs.patch | 14 ++ .../patches/clamav-system-tomsfastmath.patch | 102 ++++++++++++ 4 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/antivirus.scm create mode 100644 gnu/packages/patches/clamav-config-llvm-libs.patch create mode 100644 gnu/packages/patches/clamav-system-tomsfastmath.patch diff --git a/gnu/local.mk b/gnu/local.mk index 62e264f29..be27be6df 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -60,6 +60,7 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/android.scm \ %D%/packages/animation.scm \ %D%/packages/anthy.scm \ + %D%/packages/antivirus.scm \ %D%/packages/apl.scm \ %D%/packages/apr.scm \ %D%/packages/aspell.scm \ @@ -612,7 +613,8 @@ dist_patch_DATA =3D \ %D%/packages/patches/ceph-skip-collect-sys-info-test.patch \ %D%/packages/patches/ceph-skip-unittest_blockdev.patch \ %D%/packages/patches/chmlib-inttypes.patch \ - %D%/packages/patches/clang-3.5-libc-search-path.patch \ + %D%/packages/patches/clamav-config-llvm-libs.patch \ + %D%/packages/patches/clamav-system-tomsfastmath.patch \ %D%/packages/patches/clang-3.8-libc-search-path.patch \ %D%/packages/patches/clang-6.0-libc-search-path.patch \ %D%/packages/patches/clang-runtime-asan-build-fixes.patch \ diff --git a/gnu/packages/antivirus.scm b/gnu/packages/antivirus.scm new file mode 100644 index 000000000..f117e3080 --- /dev/null +++ b/gnu/packages/antivirus.scm @@ -0,0 +1,156 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2016, 2017, 2018 Eric Bavier +;;; Copyright =C2=A9 2018 Christopher Baines +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages antivirus) + #:use-module (guix licenses) + #:use-module (guix build-system gnu) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix utils) + #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages bison) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages curl) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages flex) + #:use-module (gnu packages llvm) + #:use-module (gnu packages multiprecision) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages pcre) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages tls) + #:use-module (gnu packages web) + #:use-module (gnu packages xml)) + +(define-public clamav + (package + (name "clamav") + (version "0.100.2") + (source (origin + (method url-fetch) + (uri (string-append "https://www.clamav.net/downloads/produc= tion/" + "clamav-" version ".tar.gz")) + (sha256 + (base32 + "1mkd41sxbjkfjinpx5b9kb85q529gj2s3d0klysssqhysh64ybja")) + (modules '((guix build utils))) + (snippet + '(begin + (for-each delete-file-recursively + '("win32" ;unnecessary + "libclamav/c++/llvm" ;use system llvm + "libclamunrar")))) ;non-free license + (patches + (search-patches "clamav-system-tomsfastmath.patch" + "clamav-config-llvm-libs.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("bison" ,bison) + ("check" ,check) ;for tests + ("flex" ,flex) + ("pkg-config" ,pkg-config) + ;; The tomsfastmath patch touches configure.ac and Makefile.am + ("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool))) + (inputs + `(("bzip2" ,bzip2) + ("libcurl" ,curl) + ("libjson" ,json-c) + ("libltdl" ,libltdl) + ("libmspack" ,libmspack) + ("llvm" ,llvm-3.6) ;requires <3.7, for JIT/verifier + ("ncurses" ,ncurses) + ("openssl" ,libressl) + ("pcre" ,pcre "bin") ;for pcre-config + ("sasl" ,cyrus-sasl) ;for linking curl with libtool + ("tomsfastmath" ,tomsfastmath) + ("xml" ,libxml2) + ("zlib" ,zlib))) + (arguments + `(#:configure-flags + (let-syntax ((with (syntax-rules () + ((_ name) + (string-append "--with-" name "=3D" + (assoc-ref %build-inputs name)= ))))) + (list "--disable-unrar" + "--enable-llvm" + "--with-system-llvm" + "--with-system-libmspack" + "--without-included-ltdl" + (with "xml") + (with "openssl") + (with "libjson") + (with "pcre") + (with "zlib") + (with "libcurl") + ;; For sanity, specifying --enable-* flags turns + ;; "support unavailable" warnings into errors. + "--enable-bzip2" + "--enable-check" + "--sysconfdir=3D/etc/clamav" + ;; Default database directory needs to be writeable + "--with-dbdir=3D/var/db/clamav")) + ;; install sample .conf files to %output/etc rather than /etc/clamav + #:make-flags (list (string-append "sysconfdir=3D" %output "/etc")) + #:phases (modify-phases %standard-phases + (add-after 'unpack 'reconf + (lambda _ (zero? (system* "autoreconf" "-vfi")))) + (add-before 'configure 'patch-llvm-config + (lambda _ + (substitute* '("libclamav/c++/detect.cpp" + "libclamav/c++/ClamBCRTChecks.cpp" + "libclamav/c++/bytecode2llvm.cpp") + (("llvm/Config/config.h") "llvm/Config/llvm-config= .h")) + ;; `llvm-config --libfiles` inappropriately lists li= b*.a + ;; libraries, rather than the lib*.so's that our llvm + ;; contains. They're used only for listing extra bu= ild + ;; dependencies, so ignore them until that's fixed. + (substitute* "libclamav/c++/Makefile.in" + (("@LLVMCONFIG_LIBFILES@") "")) + #t)) + (add-before 'check 'skip-clamd-tests + ;; XXX: The check?_clamd tests fail inside the build + ;; chroot, but pass outside. + (lambda _ + (substitute* "unit_tests/Makefile" + (("check2_clamd.sh.*check4_clamd.sh") "")) + #t))))) + (home-page "https://www.clamav.net") + (synopsis "Antivirus engine") + (description + "Clam AntiVirus is an anti-virus toolkit, designed especially for e-m= ail +scanning on mail gateways. It provides a number of utilities including a +flexible and scalable multi-threaded daemon, a command line scanner, and +advanced tool for automatic database updates. The core of the package is = an +anti-virus engine available in the form of a shared library.") + (license (list license:gpl2+ ;ClamAV itself + license:lgpl2.1 ;libclamav/mspack.[ch] + license:public-domain ;libclamav/7z/*, libclamav/rijnda= el.[ch], etc... + (package-license bzip2) ;modified bzip2 source in libcl= amav/nsis + license:bsd-2 ;several files in libclamav + license:bsd-3 ;libclamav/{regex,qsort.c,swf.[ch] + license:ncsa ;libclamav/c++/PointerTracking.cpp + license:zlib ;libclamav/inf*.h + license:x11 ;libclamav/lzw + (license:non-copyleft "libclamav/strlcat.c") ;"OpenBSD"= license + license:asl2.0 ;libclamav/yara* + license:expat)))) ;shared/getopt.[ch] diff --git a/gnu/packages/patches/clamav-config-llvm-libs.patch b/gnu/packa= ges/patches/clamav-config-llvm-libs.patch new file mode 100644 index 000000000..054264ee2 --- /dev/null +++ b/gnu/packages/patches/clamav-config-llvm-libs.patch @@ -0,0 +1,14 @@ +Our llvm does not contain a single top-level library, so consult llvm-conf= ig +for the libraries that need to be linked against. + +--- clamav-0.100.2/libclamav/c++/configure.ac 2018-09-19 14:29:07.00000000= 0 -0500 ++++ clamav-0.100.2/libclamav/c++/configure.ac 2018-10-06 21:45:09.37724915= 8 -0500 +@@ -105,7 +105,7 @@ +=20 + if test "x$llvm_linking" =3D "xdynamic"; then + AC_SUBST(LLVMCONFIG_LDFLAGS, [`$llvmconfig --ldflags`]) +- AC_SUBST(LLVMCONFIG_LIBS, [-lLLVM-$llvmver]) ++ AC_SUBST(LLVMCONFIG_LIBS, [`$llvmconfig --libs $llvmcomp`]) + AC_SUBST(LLVMCONFIG_LIBFILES, []) + else + if test $llvmver_test -ge 350; then diff --git a/gnu/packages/patches/clamav-system-tomsfastmath.patch b/gnu/pa= ckages/patches/clamav-system-tomsfastmath.patch new file mode 100644 index 000000000..07ab79f3f --- /dev/null +++ b/gnu/packages/patches/clamav-system-tomsfastmath.patch @@ -0,0 +1,102 @@ +From 756ff89526b5ffaa7a4f49b1bbecf2ecbd6f85f9 Mon Sep 17 00:00:00 2001 +From: Andreas Cadhalpun +Date: Wed, 11 Mar 2015 20:03:15 +0100 +Subject: add support for system tomsfastmath + +Patch-Name: add-support-for-system-tomsfastmath.patch +--- + configure.ac | 2 ++ + libclamav/Makefile.am | 10 ++++++++-- + libclamav/bignum.h | 6 +++++- + libclamav/xdp.c | 2 +- + m4/reorganization/libs/tomsfastmath.m4 | 12 ++++++++++++ + 5 files changed, 28 insertions(+), 4 deletions(-) + create mode 100644 m4/reorganization/libs/tomsfastmath.m4 + +--- a/configure.ac ++++ b/configure.ac +@@ -82,6 +82,7 @@ m4_include([m4/reorganization/libs/xml.m + m4_include([m4/reorganization/libs/openssl.m4]) + m4_include([m4/reorganization/libs/json.m4]) + m4_include([m4/reorganization/libs/pcre.m4]) ++m4_include([m4/reorganization/libs/tomsfastmath.m4]) +=20 + AM_MAINTAINER_MODE + m4_include([m4/reorganization/libs/libz.m4]) +@@ -285,6 +286,7 @@ else + fi + CL_MSG_STATUS([yara ],[$enable_yara],[$enable_yara]) + CL_MSG_STATUS([fts ],[yes],[$lfs_fts_msg]) ++CL_MSG_STATUS([tomsfastmath],[yes],[$tomsfastmath_msg]) +=20 +=20 + # Yep, downgrading the compiler avoids the bug too: +--- a/libclamav/Makefile.am ++++ b/libclamav/Makefile.am +@@ -496,8 +496,10 @@ libclamav_la_SOURCES +=3D yara_arena.c \ + yara_clam.h + endif +=20 +-libclamav_la_SOURCES +=3D bignum.h\ +- bignum_fast.h\ ++libclamav_la_SOURCES +=3D bignum.h ++ ++if !SYSTEM_TOMSFASTMATH ++libclamav_la_SOURCES +=3D bignum_fast.h\ + tomsfastmath/addsub/fp_add.c\ + tomsfastmath/addsub/fp_add_d.c\ + tomsfastmath/addsub/fp_addmod.c\ +@@ -579,6 +581,10 @@ libclamav_la_SOURCES +=3D bignum.h\ + tomsfastmath/sqr/fp_sqr_comba_generic.c\ + tomsfastmath/sqr/fp_sqr_comba_small_set.c\ + tomsfastmath/sqr/fp_sqrmod.c ++else ++libclamav_la_CFLAGS +=3D $(TOMSFASTMATH_CFLAGS) ++libclamav_la_LIBADD +=3D $(TOMSFASTMATH_LIBS) ++endif +=20 + .PHONY: version.h.tmp + version.c: version.h +--- a/libclamav/bignum.h ++++ b/libclamav/bignum.h +@@ -1,9 +1,13 @@ + #ifndef BIGNUM_H_ + #define BIGNUM_H_ +=20 ++#if HAVE_SYSTEM_TOMSFASTMATH ++#include ++#else + #define TFM_CHECK +- + #include "bignum_fast.h" ++#endif ++ + typedef fp_int mp_int; + #define mp_cmp fp_cmp + #define mp_toradix_n(a,b,c,d) fp_toradix_n(a,b,c,d) +--- a/libclamav/xdp.c ++++ b/libclamav/xdp.c +@@ -57,7 +57,7 @@ + #include "scanners.h" + #include "conv.h" + #include "xdp.h" +-#include "bignum_fast.h" ++#include "bignum.h" + #include "filetypes.h" +=20 + static char *dump_xdp(cli_ctx *ctx, const char *start, size_t sz); +--- /dev/null ++++ b/m4/reorganization/libs/tomsfastmath.m4 +@@ -0,0 +1,12 @@ ++dnl Check for system tomsfastmath ++PKG_CHECK_MODULES([TOMSFASTMATH], [tomsfastmath], [have_system_tomsfastma= th=3Dyes], [have_system_tomsfastmath=3Dno]) ++ ++AM_CONDITIONAL([SYSTEM_TOMSFASTMATH], [test "x$have_system_tomsfastmath" = =3D "xyes"]) ++ ++if test "x$have_system_tomsfastmath" =3D "xyes"; then ++ AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [1], [link against system-wide = tomsfastmath library]) ++ tomsfastmath_msg=3D"External, $TOMSFASTMATH_CFLAGS $TOMSFASTMATH_LIBS" ++else ++ AC_DEFINE([HAVE_SYSTEM_TOMSFASTMATH], [0], [don't link against system= -wide tomsfastmath library]) ++ tomsfastmath_msg=3D"Internal" ++fi --=20 2.19.1 --MP_/12oL99DRp5kU36ymTJmk02z-- --Sig_/ACGh4sw+sLwMgI6h1pZ+qEv Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIyBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlvQmTcACgkQ/XPKxxnT JWYhbg/2Oco2baF192cOVy0+cDsQsG0b2XhHrBJxlWfbHfAg2owjQH/LJeSmAUlj an/93HKmTuFFy71PTzFVaqwrk6RbjQQOrbKEZIR9k18aw9i+5kUIdhbK+VzjeFer NPokf0JNhuKBEZOkQPqgJtb956PZGn23nbxboFej057QOoPMpCEKvbEfcWe2Fam8 Xk/qxtQuuIQ+Wkqeg01VZa5LuRZsxUUZmfzXxMgTIpdZXh34GfkLlo9TIAvzpdHa 3b0rVy5iuxLpk+5YWi+eyJ4jXvrVE9S2tczC7gp2LZvOZ3IXaI6ZuabQLL4T81m8 ZIB3Kcp6mkbXYbtfCq188PR72CbHubUFDvHQOQ6iNcq18FGN/8Egl4BMTNFStQ65 /OMGX+8kxkN6J7aMJlUYjpMC8bqUV9qMg6nq2AxZgskUZFXWtCy8C7OMbzAS2dFT /zoc8nAyC/DIkCvrOCo2wZxpAR03U9LsNlcN6csAKAw+z6Kr3YX7Dqolw1oKIPdL z6A1rDLBye78+KA1lEzwEun2xDQzKk+Wo1D+jEaqqrvkFG4Hp9WB61omoGkwDg8N 5dSYlSUZcfH7nGPa90qemM2mpIhQzPtH02MGtd4m9GamsGxRKZs7q2h4/fEZmOpf 1mLnCXO7w4atiaqz2IP+pPP2oaq+43iXic5QLlxjjqmEsY4qNg== =Wfzb -----END PGP SIGNATURE----- --Sig_/ACGh4sw+sLwMgI6h1pZ+qEv-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 17 01:42:07 2018 Received: (at 32958-close) by debbugs.gnu.org; 17 Nov 2018 06:42:07 +0000 Received: from localhost ([127.0.0.1]:57007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNuIx-0004DP-J6 for submit@debbugs.gnu.org; Sat, 17 Nov 2018 01:42:07 -0500 Received: from mail.onyx.syn-alias.com ([206.152.134.66]:6371 helo=smtp.centurylink.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gNuIv-0004Cu-4a for 32958-close@debbugs.gnu.org; Sat, 17 Nov 2018 01:42:05 -0500 DKIM-Signature: v=1; a=rsa-sha1; d=centurylink.net; s=ctl201402; c=relaxed/simple; q=dns/txt; i=@centurylink.net; t=1542436919; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=3oiG/82alj27LqYRQEkdOlyQXtw=; b=kQR6K1VGn7MrMXAwzevrO1lXnRMziHsv0wVAaBu5lEaOS4VG9lRBIGqbRNzy2LKH aNV0sXbrzWjxBTsrzje+dbQERGsiB9oOVu7GLzkeztCIqoW5X/QgtI2ICDWEw29R ov3oKT1LaRUxNQKPT3YWXHDW7F7+o1VP0lJToSGWO0s+aOB0zbF6DN2/hLzTt4bo XQbnABqR5UVCt4z+zR+Li+r6Rsw573zjjAJTmPJAZHmGZYaD6joX/nVdmnK/qljP OfBICxMYi37HxAdJFnbhjTc6zcT64dmd36vvLdTOwSo16o4qB4tmJJYU2IHCbkRa YY4DhJ1umTjAhvrO2HM93Q==; X_CMAE_Category: , , X-CNFS-Analysis: v=2.2 cv=INJAMUnG c=1 sm=1 tr=0 a=Bk8UOtVc4jldDOnqC3PU2w==:117 a=Bk8UOtVc4jldDOnqC3PU2w==:17 a=KGjhK52YXX0A:10 a=JHtHm7312UAA:10 a=zSv6zi-ZgakA:10 a=I_5RNyk1AAAA:8 a=-OGMA_I6dPWRAn5XrBIA:9 a=CjuIK1q_8ugA:10 a=pwM6wCeN800Gyjl_NRwA:9 a=Eh9yxdLE6B1twWrs3SXz:22 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine X-Authed-Username: ZXJpY2JhdmllckBjZW50dXJ5bGluay5uZXQ= Authentication-Results: smtp03.onyx.dfw.sync.lan smtp.user=ericbavier@centurylink.net; auth=pass (LOGIN) Received: from [97.116.109.182] ([97.116.109.182:55816] helo=localhost) by smtp.centurylink.net (envelope-from ) (ecelerity 3.6.25.56547 r(Core:3.6.25.0)) with ESMTPSA (cipher=AES256-GCM-SHA384) id 7C/FB-25380-638BFEB5; Sat, 17 Nov 2018 01:41:59 -0500 Date: Sat, 17 Nov 2018 00:41:46 -0600 From: Eric Bavier To: Christopher Baines Subject: Re: [bug#32958] [PATCH] gnu: Add clamav. Message-ID: <20181117004146.7ffd7bfc@centurylink.net> In-Reply-To: <20181024110927.7442ebf1@centurylink.net> References: <20181006190855.3537-1-mail@cbaines.net> <87d0sm26jc.fsf@cbaines.net> <20181006204919.67c71003@centurylink.net> <87bm8617cv.fsf@cbaines.net> <20181024110927.7442ebf1@centurylink.net> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/l9lMOuptDiT+9NigsKgkzFP"; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32958-close Cc: 32958-close@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Sig_/l9lMOuptDiT+9NigsKgkzFP Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Wed, 24 Oct 2018 11:09:27 -0500 Eric Bavier wrote:=20 >=20 > Here is my small series of patches. >=20 > 1. Turns on RTTI in llvm by default. >=20 > 2. Adds a TomsFastMath package that is otherwise bundled in clamav >=20 > 3. Adds clamav. Uses a patch borrowed from debian to use a system > tomsfastmath and uses a system llvm. A few tests that cannot pass > inside the build container are skipped. I've pushed these patches in commits: fc9dbf41311d99d0fd8befc789ea7c0e35911890 7ed018e8a2f885246461ad65420bf39d741d343c 0a41123f01d5d2466d6f533be3644ac8c9a2bdf9 `~Eric --Sig_/l9lMOuptDiT+9NigsKgkzFP Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlvvuCoACgkQ/XPKxxnT JWazAw/8Ch/DKk7Ia4Scv+vntQm1NSGtSDPF2IOe5CzPIDNwPji0DSwZDehRTTn4 tRBbA4lcX7if2pcLklXX8OzppfTnEikLDC7yyRxwVMQprUepqrNqmouC3XO7U5wA hha6At4Kyq6DJJiExFDG/PED0/dpbkSXUiQH5u3FwXNDpPvoHiAlQwq0zhBI+1X2 yz8DIJDsj7VwUeTKpdDGdjbhdUmrSKy2XnZilCZFPzZGm907hiHU4EV8UnSzf0gH 0vAjFzygLgQ9kCA73Xy5fGnJ1QM/IIvw+xAh5v2cLXNb3P1fqQLRSJVdKFJ7TGbA ozdAhVMnmTwOn6RbxKJ78y2mQnV5hm1XUhNpPu9mHCN/X0pvKX4U1N6+KwOAaFFi ikEyGpGpgXFYG2IICQzQc07CZZLqzs4Bk7H1RSN7g3FlJ9Kj1fm4JKMZhN9VaJbb d15OUUwsrrDcWOvbmC0do75aZU5znjVCKF///oJvbQwq3UWOq+wyNZ3wyQ7zB2om Bh2bcgyO1Ei8Jjy5xbTpnMHfU7tmhoqtxX33toLVlKVcWi+4MejiXjG+/HQO4Y0D JZbNAkxM5vv3SnhgXpbwei149RrEIq12H4Jh4SAU98LFtUopHDPVFT5EcjAwU17/ Rm5Dn0YYGTMt7bBjchdGYBE0NqfqtP1LOwKHVRbsWth2wj+rzCU= =fUWT -----END PGP SIGNATURE----- --Sig_/l9lMOuptDiT+9NigsKgkzFP-- From unknown Thu Jun 19 14:00:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 15 Dec 2018 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator