# Contributor: Valery Kartel # Contributor: Ɓukasz Jendrysik # Contributor: Carlo Landmeter # Maintainer: Carlo Landmeter pkgname=clamav pkgver=0.99 pkgrel=2 pkgusers="clamav" pkggroups="clamav" pkgdesc="An anti-virus toolkit for UNIX" url="http://www.clamav.net/" arch="all" license="GPL2" depends="$pkgname-scanner $pkgname-daemon" depends_dev="openssl-dev" install="freshclam.pre-install clamav-daemon.pre-install clamav-daemon.pre-upgrade" makedepends="ncurses-dev zlib-dev bzip2-dev linux-headers $depends_dev fts-dev" subpackages="$pkgname-doc $pkgname-dev $pkgname-lib $pkgname-libunrar $pkgname-daemon $pkgname-scanner $pkgname-db freshclam" source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz clamd.initd clamd.confd freshclam.initd freshclam.confd clamd.logrotate freshclam.logrotate " _builddir="$srcdir/$pkgname-$pkgver" prepare() { local i cd "$_builddir" update_config_sub || return 1 for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir" LIBS=-lfts ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --libdir=/usr/lib \ --sysconfdir=/etc/clamav \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --without-iconv \ --disable-llvm \ --with-user=clamav \ --with-group=clamav \ --with-dbdir=/var/lib/clamav \ --enable-clamdtop \ --enable-bigstack \ || return 1 make || return 1 } package() { cd "$_builddir" make DESTDIR="$pkgdir" install || return 1 # set proper defaults sed -i -e "s:^\(Example\):\# \1:" \ -e "s:.*\(PidFile\) .*:\1 /run/clamav/freshclam.pid:" \ -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \ -e "s:^\#\(UpdateLogFile\) .*:\1 /var/log/clamav/freshclam.log:" \ -e "s:^\#\(NotifyClamd\).*:\1 /etc/clamav/clamd.conf:" \ -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \ -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \ "$pkgdir"/etc/clamav/freshclam.conf.sample # set proper defaults sed -i -e "s:^\(Example\):\# \1:" \ -e "s:.*\(PidFile\) .*:\1 /run/clamav/clamd.pid:" \ -e "s:.*\(LocalSocket\) .*:\1 /run/clamav/clamd.sock:" \ -e "s:.*\(User\) .*:\1 clamav:" \ -e "s:^\#\(LogFile\) .*:\1 /var/log/clamav/clamd.log:" \ -e "s:^\#\(LogTime\).*:\1 yes:" \ -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \ "$pkgdir"/etc/clamav/clamd.conf.sample } lib() { pkgdesc="ClamAV library" depends="" replaces="clamav" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libclamav.so.* \ "$subpkgdir"/usr/lib/ } libunrar() { pkgdesc="ClamAV unrar libraries" depends="" replaces="clamav" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libclamunrar* \ "$subpkgdir"/usr/lib/ } freshclam() { pkgdesc="Auto-updater for the Clam Antivirus scanner data-files" depends="logrotate" replaces="clamav clamav-db" mkdir -p "$subpkgdir"/usr/bin \ "$subpkgdir"/etc/init.d \ "$subpkgdir"/etc/conf.d \ "$subpkgdir"/etc/clamav mv "$pkgdir"/usr/bin/freshclam "$subpkgdir"/usr/bin || return 1 mv "$pkgdir"/etc/clamav/freshclam.conf.sample \ "$subpkgdir"/etc/clamav/ || return 1 install -d -m755 -o clamav -g clamav \ "$subpkgdir"/var/log/clamav \ "$subpkgdir"/var/lib/clamav || return 1 install -m755 -D "$srcdir"/freshclam.initd \ "$subpkgdir"/etc/init.d/freshclam || return 1 install -m644 -D "$srcdir"/freshclam.confd \ "$subpkgdir"/etc/conf.d/freshclam || return 1 install -m644 -D "$srcdir"/freshclam.logrotate \ "$pkgdir"/etc/logrotate.d/freshclam || return 1 } db() { pkgdesc="ClamAV dummy package for compatibility" replaces="clamav" depends="freshclam" mkdir -p "$subpkgdir"/var/lib/ \ "$subpkgdir"/usr/bin \ "$subpkgdir"/etc/clamav \ || return 1 install -d -m755 -o clamav -g clamav \ "$subpkgdir"/var/log/clamav \ "$subpkgdir"/var/lib/clamav || return 1 } scanner() { pkgdesc="ClamAV command-line scanner and utils" replaces="clamav" depends="freshclam" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/clamscan \ "$subpkgdir"/usr/bin/ || return 1 mv "$pkgdir"/usr/bin/sigtool \ "$subpkgdir"/usr/bin/ || return 1 mv "$pkgdir"/usr/bin/clambc \ "$subpkgdir"/usr/bin/ || return 1 } daemon() { pkgdesc="ClamAV daemon scanner" replaces="clamav" depends="freshclam logrotate" mkdir -p "$subpkgdir"/usr/bin \ "$subpkgdir"/usr/sbin \ "$subpkgdir"/etc/clamav \ || return 1 install -d -m 755 -o clamav -g clamav \ "$subpkgdir"/var/log/clamav \ "$subpkgdir"/var/lib/clamav mv "$pkgdir"/usr/bin/clamconf \ "$subpkgdir"/usr/bin/ || return 1 mv "$pkgdir"/usr/sbin/clamd \ "$subpkgdir"/usr/sbin/ || return 1 mv "$pkgdir"/usr/bin/clamdtop \ "$subpkgdir"/usr/bin/ || return 1 mv "$pkgdir"/usr/bin/clamdscan \ "$subpkgdir"/usr/bin/ || return 1 mv "$pkgdir"/etc/clamav/clamd.conf.sample \ "$subpkgdir"/etc/clamav/ || return 1 install -m755 -D "$srcdir"/clamd.initd \ "$subpkgdir"/etc/init.d/clamd || return 1 install -m644 -D "$srcdir"/clamd.confd \ "$subpkgdir"/etc/conf.d/clamd || return 1 install -m644 -D "$srcdir"/clamd.logrotate \ "$pkgdir"/etc/logrotate.d/clamd || return 1 } md5sums="ae79c3982761ba1815dbce17f846bab6 clamav-0.99.tar.gz 191b7b6b29eaef0af9f745e331058618 clamd.initd e8a03fad6ce603631e8fe71a24d387c6 clamd.confd 6c79b77c35ce35ba3846b5a4f363a1d4 freshclam.initd e48466ddfb56f66c623b83e58777b778 freshclam.confd 2fb0399fbad82ab17c1c04f2d331214a clamd.logrotate 56e88ff24d3490af599e34e6f3346d5b freshclam.logrotate" sha256sums="d2792c8cfadd685fffc40b2199679628815df031fd3149ccf961649fc8787ea9 clamav-0.99.tar.gz 0ac8e153aea4422c82956e083358a83b9c77a6400e5bafbfcec2ddb97eb3e733 clamd.initd 4d978313004f66d871564b873df27c5459d3cc504788b179e41edba0f04b74dc clamd.confd 4ba12be50d010269bcd170c1d14a91e6ddcfe85df3f5cbf68803e6e75a420bb5 freshclam.initd 75551ce7e04bbef4a889bc94a357b160d9da88f06eba32df594ba3cbb2c81ed1 freshclam.confd 2fee72877bc1fdc788b298319479de9495db85bdae4433143ce83a450a09dae3 clamd.logrotate 5127ebd370d8c62f3558c9605b4f33f7fb54bac3acf7831dc5f8c4dda1509dfa freshclam.logrotate" sha512sums="328e66fa412ba61f5e44c839b254c7a84d2ce7821fda6cf29e4ee9532c06e45bdec62f202ca561223e984fff170bfd8280e5cc8e306c09a3017b17e7db3bbf56 clamav-0.99.tar.gz c3e1c9efe8744ec96627ea7fe8d54e1c07a45da40907e774ee664d9880bb8e77a98902fb831171acb2b5df2bf797ce712b3b68a17c35657ad86826add7177e35 clamd.initd 59c561b3dcb0b616b647cd8e4ebc46a2cc5e7144c8c7ea0054cc1c3021d1da8f67e4dad5c083c3fe712ed887aaabfca91b538f4759537e7c4c9ab71ba4fd5794 clamd.confd 00daed8afb67a6e4a29893340246c8840cce970dd9103d26557ecdd26ef60b12551d2291c214fc657faaaa339484052079347411b0cad65e3a33ece56d57cf16 freshclam.initd ba181fe1abaac7b898ccb40b0713455aa3c9d5e25ad21d687b6cac09b0105b9e376526e7c776a44636234d8db819709d8d6a6cc76119bc3e98b637b1a3f26c08 freshclam.confd 3ae493dd1610a819402c015f6b8c0f080f926b72dc43d2bded60030bf6a55040e4b88e0f64d3aae299dc1133d7e1b89855e7346b4665a64e8b82592f7b75cf6a clamd.logrotate 30cff378bc28c76b795e00c92ae5ee623f3abe4a19bed61dd8403c96e72658bb02b7f040d26a6258104af754464d25ea7d9646918c4b47d2ba9a8cbf4687056c freshclam.logrotate"