4.10.3-2: add gtktreeviewmodel fixes
[arch-packages.git] / clamav / trunk / PKGBUILD
blobfe9b07480baa3b87d692c84ddcd4f12390052f16
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
3 # Contributor: Dale Blount <dale@archlinux.org>
4 # Contributor: Gregor Ibic <gregor.ibic@intelicom.si>
5 # Contributor: Gaetan Bisson <bisson@archlinux.org>
7 pkgname=clamav
8 pkgver=1.0.1
9 pkgrel=1
10 pkgdesc='Anti-virus toolkit for Unix'
11 url='https://www.clamav.net/'
12 license=('GPL')
13 arch=('x86_64')
14 depends=('bzip2' 'libltdl' 'libxml2' 'curl' 'systemd-libs' 'pcre2' 'json-c' 'libmspack'
15          'ncurses' libsystemd.so libncursesw.so libcurl.so libjson-c.so libbz2.so)
16 makedepends=('libmilter' 'systemd' 'cmake' 'ninja' 'python' 'cargo')
17 checkdepends=('check')
18 backup=('etc/clamav/clamd.conf'
19         'etc/clamav/freshclam.conf'
20         'etc/clamav/clamav-milter.conf'
21         'etc/logrotate.d/clamav')
22 provides=(libclamav.so libclamunrar.so libclamunrar_iface.so)
23 source=(https://www.clamav.net/downloads/production/${pkgname}-${pkgver}.tar.gz{,.sig}
24         clamav.logrotate
25         clamav.tmpfiles
26         clamav.sysusers)
27 sha512sums=('924e2f197baddd693dc25c30fcf32aa459e9c6461ff0b22303a1854deb9e2a9c4ce01ae892ed60975ec19105acbb36cb8ac1b4cbf9dee3f7fe51f670af32e3d5'
28             'SKIP'
29             '9cb168c1c16bb43c99900d7ef34456e3f3b593d4d1943c875a0306bc86fd3872cb78e9e1413dcba93579e01b96d466c9eea1975e24190193663b7986c4525d48'
30             'c5443634399bd87fe0d0192518538ffdb7296a8437b5b0160a0fbd58696b01285de3237e3feb552c0095c49e576832dec2e2b2107eef2be42424ed7edd13cd19'
31             'b984836f6c34d97b90d81fa5d17361a2e3f8c0cc709e3350a4d25cf088dc04f7bf2504359980c8be489c96b1b8798c60e6da533069d3378d49d4f50f929a2c90')
32 validpgpkeys=('E34DB95B374B31570496CD3F609B024F2B3EDD07') # Talos (Talos, Cisco Systems Inc.) <research@sourcefire.com>
34 prepare() {
35   cd ${pkgname}-${pkgver}
36   sed -E 's|^(Example)$|#\1|' -i etc/{clamd,freshclam,clamav-milter}.conf.sample
37   sed -E 's|#(User) .+|\1 clamav|' -i etc/{clamd,freshclam,clamav-milter}.conf.sample
38   sed -E 's|#(LogFile) .+|\1 /var/log/clamav/clamd.log|' -i etc/clamd.conf.sample
39   sed -E 's|#(LogTime) .+|\1 yes|' -i etc/clamd.conf.sample etc/clamav-milter.conf.sample
40   sed -E 's|#(PidFile) .+|\1 /run/clamav/clamd.pid|' -i etc/clamd.conf.sample
41   sed -E 's|#(TemporaryDirectory) .+|\1 /tmp|' -i etc/{clamd,clamav-milter}.conf.sample
42   sed -E 's|#(LocalSocket) .+|\1 /run/clamav/clamd.ctl|' -i etc/clamd.conf.sample
43   sed -E 's|#(UpdateLogFile) .+|\1 /var/log/clamav/freshclam.log|' -i etc/freshclam.conf.sample
44   sed -E 's|#(DatabaseMirror) .+|\1 database.clamav.net|' -i etc/freshclam.conf.sample
45   sed -E 's|#(NotifyClamd) .+|\1 /etc/clamav/clamd.conf|' -i etc/freshclam.conf.sample
46   sed -E 's|#(PidFile) .+|\1 /run/clamav/freshclam.pid|' -i etc/freshclam.conf.sample
47   sed -E 's|#(LogFile) .+|\1 /var/log/clamav/clamav-milter.log|' -i etc/clamav-milter.conf.sample
48   sed -E 's|#(PidFile) .+|\1 /run/clamav/clamav-milter.pid|' -i etc/clamav-milter.conf.sample
49   sed -E "s|(\\[Unit\\])|\\1\\nWants=network-online.target\\nAfter=network-online.target|" -i freshclam/clamav-freshclam.service.in
52 build() {
53   cd ${pkgname}-${pkgver}
54   cmake \
55     -DCMAKE_BUILD_TYPE='None' \
56     -DCMAKE_INSTALL_PREFIX=/usr \
57     -DCMAKE_INSTALL_SBINDIR=bin \
58     -DAPP_CONFIG_DIRECTORY=/etc/clamav \
59     -DDATABASE_DIRECTORY=/var/lib/clamav \
60     -DENABLE_EXTERNAL_MSPACK=ON \
61     -Wno-dev \
62     -B build \
63     -G Ninja \
64     -S .
65   ninja -C build
68 check() {
69   cd ${pkgname}-${pkgver}
70   ninja -C build test
73 package() {
74   cd ${pkgname}-${pkgver}
75   DESTDIR="${pkgdir}" ninja -C build install
77   mv "${pkgdir}"/etc/clamav/freshclam.conf{.sample,}
78   mv "${pkgdir}"/etc/clamav/clamd.conf{.sample,}
79   mv "${pkgdir}"/etc/clamav/clamav-milter.conf{.sample,}
81   install -Dm 644 ../clamav.sysusers "${pkgdir}"/usr/lib/sysusers.d/clamav.conf
82   install -Dm 644 ../clamav.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/clamav.conf
83   install -Dm 644 ../clamav.logrotate "${pkgdir}"/etc/logrotate.d/clamav
86 # vim: ts=2 sw=2 et: