PKGBUILD 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Maintainer (arch): Levente Polyak <anthraxx[at]archlinux[dot]org>
  2. # Maintainer (arch): 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>
  6. # Contributor: André Silva <emulatorman@hyperbola.info>
  7. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  8. # Contributor: Isaac David <isacdaavid@at@isacdaavid@dot@info>
  9. # Contributor: Andreas Grapentin <andreas@grapentin.org>
  10. pkgname=clamav
  11. pkgver=0.103.3
  12. pkgrel=1
  13. pkgrel+=.parabola1
  14. pkgdesc='Anti-virus toolkit for Unix'
  15. pkgdesc+=', without nonfree decompression engine for RAR archives'
  16. url='https://www.clamav.net/'
  17. license=('GPL')
  18. arch=('x86_64')
  19. arch+=('i686' 'armv7h')
  20. depends=('bzip2' 'libltdl' 'libxml2' 'curl' 'systemd-libs' 'pcre2' 'json-c' 'libmspack')
  21. makedepends=('libmilter' 'systemd')
  22. checkdepends=('check')
  23. backup=('etc/clamav/clamd.conf'
  24. 'etc/clamav/freshclam.conf'
  25. 'etc/clamav/clamav-milter.conf'
  26. 'etc/logrotate.d/clamav')
  27. provides=(libclamav.so libclamunrar.so libclamunrar_iface.so)
  28. source=(https://www.clamav.net/downloads/production/${pkgname}-${pkgver}.tar.gz{,.sig}
  29. clamav.logrotate
  30. clamav.tmpfiles
  31. clamav.sysusers)
  32. sha512sums=('c2ee24a6f63735c064140aa5baa347d51e8240b2f7eced3480d05435202aedd481fa7057fd40ecbc2e93a62fe8b0cefb574d8accdf9acede643ffbe0d396686f'
  33. 'SKIP'
  34. '9cb168c1c16bb43c99900d7ef34456e3f3b593d4d1943c875a0306bc86fd3872cb78e9e1413dcba93579e01b96d466c9eea1975e24190193663b7986c4525d48'
  35. 'c5443634399bd87fe0d0192518538ffdb7296a8437b5b0160a0fbd58696b01285de3237e3feb552c0095c49e576832dec2e2b2107eef2be42424ed7edd13cd19'
  36. 'b984836f6c34d97b90d81fa5d17361a2e3f8c0cc709e3350a4d25cf088dc04f7bf2504359980c8be489c96b1b8798c60e6da533069d3378d49d4f50f929a2c90')
  37. validpgpkeys=('E34DB95B374B31570496CD3F609B024F2B3EDD07') # Talos (Talos, Cisco Systems Inc.) <research@sourcefire.com>
  38. prepare() {
  39. cd ${pkgname}-${pkgver}
  40. msg2 "remove nonfree unRAR utility files from the source"
  41. rm -rv libclamunrar
  42. rm -v COPYING.unrar
  43. sed -E 's|^(Example)$|#\1|' -i etc/{clamd,freshclam,clamav-milter}.conf.sample
  44. sed -E 's|#(User) .+|\1 clamav|' -i etc/{clamd,freshclam,clamav-milter}.conf.sample
  45. sed -E 's|#(LogFile) .+|\1 /var/log/clamav/clamd.log|' -i etc/clamd.conf.sample
  46. sed -E 's|#(LogTime) .+|\1 yes|' -i etc/clamd.conf.sample etc/clamav-milter.conf.sample
  47. sed -E 's|#(PidFile) .+|\1 /run/clamav/clamd.pid|' -i etc/clamd.conf.sample
  48. sed -E 's|#(TemporaryDirectory) .+|\1 /tmp|' -i etc/{clamd,clamav-milter}.conf.sample
  49. sed -E 's|#(LocalSocket) .+|\1 /run/clamav/clamd.ctl|' -i etc/clamd.conf.sample
  50. sed -E 's|#(UpdateLogFile) .+|\1 /var/log/clamav/freshclam.log|' -i etc/freshclam.conf.sample
  51. sed -E 's|#(DatabaseMirror) .+|\1 database.clamav.net|' -i etc/freshclam.conf.sample
  52. sed -E 's|#(NotifyClamd) .+|\1 /etc/clamav/clamd.conf|' -i etc/freshclam.conf.sample
  53. sed -E 's|#(PidFile) .+|\1 /run/clamav/freshclam.pid|' -i etc/freshclam.conf.sample
  54. sed -E 's|#(LogFile) .+|\1 /var/log/clamav/clamav-milter.log|' -i etc/clamav-milter.conf.sample
  55. sed -E 's|#(PidFile) .+|\1 /run/clamav/clamav-milter.pid|' -i etc/clamav-milter.conf.sample
  56. sed -E "s|(\\[Unit\\])|\\1\\nWants=network-online.target\\nAfter=network-online.target|" -i freshclam/clamav-freshclam.service.in
  57. autoreconf -fiv
  58. }
  59. build() {
  60. cd ${pkgname}-${pkgver}
  61. # --disable-zlib-vcheck because the configure script thinks that
  62. # zlib 1.2.11 is older than 1.2.2
  63. # --enable-llvm=no:
  64. # workaround for database update issues
  65. ./configure \
  66. --prefix=/usr \
  67. --sbindir=/usr/bin \
  68. --sysconfdir=/etc/clamav \
  69. --with-dbdir=/var/lib/clamav \
  70. --with-user=clamav \
  71. --with-group=clamav \
  72. --with-system-libmspack \
  73. --disable-rpath \
  74. --disable-clamav \
  75. --disable-llvm \
  76. --enable-zlib-vcheck \
  77. --enable-milter \
  78. --enable-clamdtop \
  79. --disable-unrar \
  80. --enable-llvm=no
  81. sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  82. make
  83. }
  84. check() {
  85. cd ${pkgname}-${pkgver}
  86. make check
  87. }
  88. package() {
  89. cd ${pkgname}-${pkgver}
  90. make DESTDIR="${pkgdir}" install
  91. mv "${pkgdir}"/etc/clamav/freshclam.conf{.sample,}
  92. mv "${pkgdir}"/etc/clamav/clamd.conf{.sample,}
  93. mv "${pkgdir}"/etc/clamav/clamav-milter.conf{.sample,}
  94. install -Dm 644 ../clamav.sysusers "${pkgdir}"/usr/lib/sysusers.d/clamav.conf
  95. install -Dm 644 ../clamav.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/clamav.conf
  96. install -Dm 644 ../clamav.logrotate "${pkgdir}"/etc/logrotate.d/clamav
  97. }