[PATCH] gnu: Add clamav.

  • Done
  • quality assurance status badge
Details
2 participants
  • Eric Bavier
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 6 Oct 2018 21:08
(address . guix-patches@gnu.org)
20181006190855.3537-1-mail@cbaines.net
* 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

Toggle diff (139 lines)
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 = \
%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 © 2018 Christopher Baines <mail@cbaines.net>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(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=1")
+ #:configure-flags (list "--enable-check"
+ "--with-dbdir=/var/lib/clamav"
+ "--sysconfdir=/etc/clamav"
+ "--with-system-libmspack"
+ "--without-included-ltdl"
+ (string-append "--with-zlib="
+ (assoc-ref %build-inputs
+ "zlib"))
+ (string-append "--with-libjson="
+ (assoc-ref %build-inputs
+ "json-c"))
+ (string-append "--with-xml="
+ (assoc-ref %build-inputs
+ "libxml2"))
+ (string-append "--with-libcurl="
+ (assoc-ref %build-inputs
+ "curl"))
+ (string-append "--with-openssl="
+ (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 sample
+ ;; 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, viruses,
+malware and other malicious software. This package provides a flexible and
+scalable multi-threaded daemon, a command-line scanner and a tool to fetch
+up-to-date virus definitions.")
+ (home-page "https://www.clamav.net/")
+ (license
+ (list license:gpl2 ;; clamav-milter, clambc, clamconf, clamd, clamdscan,
+ ;; libclamav, libfreshclam
+ license:gpl2+ ;; many files
+ ;; some files in libclamav
+ bsd-2 zlib asl2.0))))
--
2.19.0
C
C
Christopher Baines wrote on 6 Oct 2018 21:56
(address . 32958@debbugs.gnu.org)
87d0sm26jc.fsf@cbaines.net
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.
-----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-----

E
E
Eric Bavier wrote on 7 Oct 2018 03:49
(name . Christopher Baines)(address . mail@cbaines.net)(address . 32958@debbugs.gnu.org)
20181006204919.67c71003@centurylink.net
Hi Christopher,

On Sat, 06 Oct 2018 20:56:23 +0100
Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (6 lines)
> 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.

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
-----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-----


C
C
Christopher Baines wrote on 7 Oct 2018 10:36
(name . Eric Bavier)(address . ericbavier@centurylink.net)(address . 32958@debbugs.gnu.org)
87bm8617cv.fsf@cbaines.net
Eric Bavier <ericbavier@centurylink.net> writes:

Toggle quote (16 lines)
> Hi Christopher,
>
> On Sat, 06 Oct 2018 20:56:23 +0100
> Christopher Baines <mail@cbaines.net> wrote:
>
>> 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.
>
> 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 :)
-----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-----

E
E
Eric Bavier wrote on 24 Oct 2018 18:09
(name . Christopher Baines)(address . mail@cbaines.net)(address . 32958@debbugs.gnu.org)
20181024110927.7442ebf1@centurylink.net
On Sun, 07 Oct 2018 09:36:16 +0100
Christopher Baines <mail@cbaines.net> wrote:

Toggle quote (20 lines)
> Eric Bavier <ericbavier@centurylink.net> writes:
>
> > Hi Christopher,
> >
> > On Sat, 06 Oct 2018 20:56:23 +0100
> > Christopher Baines <mail@cbaines.net> wrote:
> >
> >> 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.
> >
> > 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 :)

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
From 90e3dc98e1657964041f576b785524816394b03a Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
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 the
llvm libraries.

* gnu/packages/llvm.scm (llvm-with-rtti): Remove variable.
(llvm)[arguments]: Add '-DLLVM_REQUIRES_RTTI=1' to #:configure-flags.
* gnu/packages/audio.scm (faust-2)[native-inputs]: 'llvm-with-rtti' -> 'llvm'.
---
gnu/packages/audio.scm | 2 +-
gnu/packages/llvm.scm | 14 ++------------
2 files changed, 3 insertions(+), 13 deletions(-)

Toggle diff (52 lines)
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=" (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 © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2016, 2018 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
@@ -65,6 +65,7 @@
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
"-DBUILD_SHARED_LIBS:BOOL=TRUE"
"-DLLVM_ENABLE_FFI:BOOL=TRUE"
+ "-DLLVM_REQUIRES_RTTI=1" ; For some third-party utilities
"-DLLVM_INSTALL_UTILS=ON") ; Needed for rustc.
;; Don't use '-g' during the build, to save space.
@@ -90,17 +91,6 @@ languages is in development. The compiler infrastructure includes mirror sets
of programming tools as well as libraries with equivalent functionality.")
(license license:ncsa)))
-(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=FALSE"
- "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
- "-DLLVM_REQUIRES_RTTI=1")
- ,flags))))))
-
(define* (clang-runtime-from-llvm llvm hash
#:optional (patches '()))
(package
--
2.19.1
-----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-----


E
E
Eric Bavier wrote on 17 Nov 2018 07:41
(name . Christopher Baines)(address . mail@cbaines.net)(address . 32958-close@debbugs.gnu.org)
20181117004146.7ffd7bfc@centurylink.net
On Wed, 24 Oct 2018 11:09:27 -0500
Eric Bavier <ericbavier@centurylink.net> wrote:
Toggle quote (11 lines)
>
> 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've pushed these patches in commits:

fc9dbf41311d99d0fd8befc789ea7c0e35911890
7ed018e8a2f885246461ad65420bf39d741d343c
0a41123f01d5d2466d6f533be3644ac8c9a2bdf9

`~Eric
-----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-----


?
Your comment

This issue is archived.

To comment on this conversation send an email to 32958@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 32958
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch