summaryrefslogtreecommitdiff
path: root/libre/clamav/PKGBUILD
blob: 7faa780e679e8ca9d4ee2e7fa8522b4808c6252d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
# Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: André Silva <emulatorman@riseup.net>
# Contributor: Isaac David <isacdaavid@at@isacdaavid@dot@info>
# Contributor (Arch): Dale Blount <dale@archlinux.org>
# Contributor (Arch): Gregor Ibic <gregor.ibic@intelicom.si>
# Maintainer (Arch): Gaetan Bisson <bisson@archlinux.org>

_pkgname=clamav-libre
pkgname=clamav
pkgver=0.99.2
pkgrel=6.parabola2
pkgdesc='Anti-virus toolkit for Unix, without nonfree decompression engine for RAR archives'
url='http://www.clamav.net/'
license=('GPL')
arch=('i686' 'x86_64' 'armv7h')
makedepends=('libmilter')
depends=('bzip2' 'libltdl' 'libxml2' 'curl' 'pcre')
validpgpkeys=('B964E6D7BC7D7C82CCB8D45840B8EA2364221D53'
              'F79FB2D08751574C5D3FDFFBB3D5342C260429A0')
mksource=("http://www.clamav.net/downloads/production/${pkgname}-${pkgver}.tar.gz"{,.sig})
source=("https://repo.parabola.nu/other/${_pkgname}/${_pkgname}-${pkgver}.tar.gz"
        'logrotate'
        'tmpfiles.d'
        'clamd.conf'
        'freshclam.conf'
        'clamd.service'
        'freshclamd.service'
        'clamav-0.99.2-gcc-6.patch'
        'make_it_compile_against_openssl_1_1_0.patch')
mksha256sums=('167bd6a13e05ece326b968fdb539b05c2ffcfef6018a274a10aeda85c2c0027a'
              'SKIP')
sha256sums=('9cbca11e54c78129c0c9495ff40f42e83c34a430e832fdf86c9408bc397d6d07'
            'ce4b9b8c300614641af600c9a73b52a00ee8e47ccc9f91b2428a113b0ecff21b'
            '0a61abee3b9bba94126afe3344e7d8e82da5120ca6dbd2b413b10f75da5b0b0d'
            'afdb95f93f7e11e163d368caccd5f6814206c6f0d74816b4f712c0267b50572a'
            '127b39e13525ffb4242198cfb76f99d4d517e5f2fd9fa8dcad3f31fc9f82f952'
            'e376ab0cefeefa5ac5f1cd611718452ea8646198e854aca3cc0026f5ffe58fb4'
            'dd5ff6c79ee360da5f2221c4d9110a2a8886d86293f6c93c16bf74fdb126593c'
            'b2960553243392a4298f37d5ef537296e989e95f7cc084800b8e3ab6a251be6d'
            '0a8e02a91bc3f2c99bd52dc475592637376baa991fe3f899b7745b840fc586c5')

backup=('etc/clamav/clamd.conf'
        'etc/clamav/freshclam.conf'
        'etc/logrotate.d/clamav')

install=install

mksource() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  msg2 "remove nonfree unRAR utility files from the source"
  rm -rv libclamunrar
  rm -v COPYING.unrar
}

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  patch -Np1 -i ../clamav-0.99.2-gcc-6.patch
  patch -Np1 -i ../make_it_compile_against_openssl_1_1_0.patch
  autoreconf -fi
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # --disable-zlib-vcheck:
  #    the configure script thinks that zlib 1.2.11 is older than 1.2.2
  # --enable-llvm=no:
  #    workaround for database update issues
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc/clamav \
    --with-dbdir=/var/lib/clamav \
    --disable-clamav \
    --disable-zlib-vcheck \
    --enable-milter \
    --disable-unrar \
    --enable-llvm=no

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install

  install -Dm644 ../clamd.conf "${pkgdir}"/etc/clamav/clamd.conf
  install -Dm644 ../freshclam.conf "${pkgdir}"/etc/clamav/freshclam.conf
  install -Dm644 ../freshclamd.service "${pkgdir}"/usr/lib/systemd/system/freshclamd.service
  install -Dm644 ../clamd.service "${pkgdir}"/usr/lib/systemd/system/clamd.service
  install -Dm644 ../tmpfiles.d "${pkgdir}"/usr/lib/tmpfiles.d/clamav.conf
  install -Dm644 ../logrotate "${pkgdir}"/etc/logrotate.d/clamav

  install -d -o 64 -g 64 "${pkgdir}"/var/log/clamav
  install -d -o 64 -g 64 "${pkgdir}"/var/lib/clamav
}