From ColdSphinX, 6 Years ago, written in Bash.
This paste is a reply to PKGBUILD from ColdSphinX - view diff
Embed
  1. # $Id$
  2. # Contributor: Dale Blount <dale@archlinux.org>
  3. # Contributor: Gregor Ibic <gregor.ibic@intelicom.si>
  4. # Maintainer: Gaetan Bisson <bisson@archlinux.org>
  5.  
  6. pkgname=clamav
  7. pkgver=0.99.3
  8. pkgrel=0
  9. pkgdesc='Anti-virus toolkit for Unix'
  10. url='http://www.clamav.net/'
  11. license=('GPL')
  12. arch=('i686' 'x86_64')
  13. makedepends=('libmilter')
  14. depends=('bzip2' 'libltdl' 'libxml2' 'curl' 'pcre')
  15. validpgpkeys=('B964E6D7BC7D7C82CCB8D45840B8EA2364221D53'
  16.               'F79FB2D08751574C5D3FDFFBB3D5342C260429A0'
  17.               '65ED513993F08DA06F9639A6F13F9E16BCA5BFAD')
  18. source=("http://www.clamav.net/downloads/production/${pkgname}-${pkgver}.tar.gz"{,.sig}
  19.         'logrotate'
  20.         'tmpfiles.d'
  21.         'clamd.conf'
  22.         'freshclam.conf'
  23.         'clamd.service'
  24.         'freshclamd.service'
  25.         'https://gist.githubusercontent.com/manuelm/dbc94001c77c07363cdcb5b390c2cb04/raw/31dbf8a95f5484c3e26f219a881c60332ff37c80/clamav-0.99.3-scanners.patch')
  26. sha256sums=('00fa5292a6e00a3a4035b826267748965d5d2c4943d8ff417d740238263e8e84'
  27.             'd6284f26d1c4f745b42b77695fb245101d12f04fac69487367e61031b2ae2d3a'
  28.             'ce4b9b8c300614641af600c9a73b52a00ee8e47ccc9f91b2428a113b0ecff21b'
  29.             '0a61abee3b9bba94126afe3344e7d8e82da5120ca6dbd2b413b10f75da5b0b0d'
  30.             'afdb95f93f7e11e163d368caccd5f6814206c6f0d74816b4f712c0267b50572a'
  31.             '127b39e13525ffb4242198cfb76f99d4d517e5f2fd9fa8dcad3f31fc9f82f952'
  32.             'e376ab0cefeefa5ac5f1cd611718452ea8646198e854aca3cc0026f5ffe58fb4'
  33.             'dd5ff6c79ee360da5f2221c4d9110a2a8886d86293f6c93c16bf74fdb126593c'
  34.             '23973fb62ade1e0c128b5a271cb4e290299df661b3db93556076e3a8d9494d29')
  35.  
  36. backup=('etc/clamav/clamd.conf'
  37.         'etc/clamav/freshclam.conf'
  38.         'etc/logrotate.d/clamav')
  39.  
  40. install=install
  41.  
  42. prepare() {
  43.         cd "${srcdir}/${pkgname}-${pkgver}"
  44.         patch -Np1 -i ../clamav-0.99.3-scanners.patch
  45.         autoreconf -fi
  46. }
  47.  
  48. build() {
  49.         cd "${srcdir}/${pkgname}-${pkgver}"
  50.         # --disable-zlib-vcheck because the configure script thinks that
  51.         # zlib 1.2.11 is older than 1.2.2
  52.         ./configure \
  53.                 --prefix=/usr \
  54.                 --sbindir=/usr/bin \
  55.                 --sysconfdir=/etc/clamav \
  56.                 --with-dbdir=/var/lib/clamav \
  57.                 --disable-clamav \
  58.                 --disable-llvm \
  59.                 --disable-zlib-vcheck \
  60.                 --enable-milter
  61.  
  62.         sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  63.         make
  64. }
  65.  
  66. package() {
  67.         cd "${srcdir}/${pkgname}-${pkgver}"
  68.         make DESTDIR="${pkgdir}" install
  69.  
  70.         install -Dm644 ../clamd.conf "${pkgdir}"/etc/clamav/clamd.conf
  71.         install -Dm644 ../freshclam.conf "${pkgdir}"/etc/clamav/freshclam.conf
  72.         install -Dm644 ../freshclamd.service "${pkgdir}"/usr/lib/systemd/system/freshclamd.service
  73.         install -Dm644 ../clamd.service "${pkgdir}"/usr/lib/systemd/system/clamd.service
  74.         install -Dm644 ../tmpfiles.d "${pkgdir}"/usr/lib/tmpfiles.d/clamav.conf
  75.         install -Dm644 ../logrotate "${pkgdir}"/etc/logrotate.d/clamav
  76.  
  77.         install -d -o 64 -g 64 "${pkgdir}"/var/log/clamav
  78.         install -d -o 64 -g 64 "${pkgdir}"/var/lib/clamav
  79. }
  80.