Date: Thursday, October 28, 2010 @ 07:05:54 Author: bisson Revision: 97292
minor upstream update, plus rewrite of install script Modified: clamav/trunk/PKGBUILD clamav/trunk/clamav.install ----------------+ PKGBUILD | 30 ++++++++++-------------------- clamav.install | 21 +++++++++------------ 2 files changed, 19 insertions(+), 32 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2010-10-28 10:45:24 UTC (rev 97291) +++ PKGBUILD 2010-10-28 11:05:54 UTC (rev 97292) @@ -3,7 +3,7 @@ # Contributor: Gregor Ibic <gregor.i...@intelicom.si> pkgname=clamav -pkgver=0.96.3 +pkgver=0.96.4 pkgrel=1 pkgdesc='Anti-virus toolkit for Unix' arch=('i686' 'x86_64') @@ -15,20 +15,18 @@ url='http://www.clamav.net/' source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz" 'clamav' - 'clamav.confd' - 'clamav.logrotate') + 'clamav.confd' + 'clamav.logrotate') -sha1sums=('b4566c83bc7ca8bdc3783a9487cfe5eaf6084c65' +sha1sums=('ffff540b330f3d33c9ff9e8d551763b4e0028d72' '7f15f0b13a1c11235bc99ef0add01efd8a442f07' 'cb116cdab49a810381a515cbcfb6a6c148547f07' 'be3310d2b41a68ce06e33c84ab68ffe59fdce104') build() { cd "$srcdir/$pkgname-$pkgver" - ./configure --prefix=/usr --sysconfdir=/etc/clamav \ --with-dbdir=/var/lib/clamav --disable-clamav - # will add clamav user with clamav.install make } @@ -38,20 +36,13 @@ # make sure conf files get installed, cause make install # doesn't do that if clamav is already installed upon building. - for i in clamd freshclam; do - install -D -m644 etc/$i.conf "$pkgdir/etc/clamav/$i.conf" - done + install -D -m644 etc/clamd.conf "$pkgdir/etc/clamav/clamd.conf" + install -D -m644 etc/freshclam.conf "$pkgdir/etc/clamav/freshclam.conf" - install -D -m644 "$srcdir/clamav.confd" "$pkgdir/etc/conf.d/clamav" - install -D -m755 "$srcdir/clamav" "$pkgdir/etc/rc.d/clamav" - install -D -m644 "$srcdir/clamav.logrotate" "$pkgdir/etc/logrotate.d/clamav" + install -D -m644 ../clamav.logrotate "$pkgdir/etc/logrotate.d/clamav" + install -D -m644 ../clamav.confd "$pkgdir/etc/conf.d/clamav" + install -D -m755 ../clamav "$pkgdir/etc/rc.d/clamav" - # create log dirs/files & fix conf files. - mkdir -p "$pkgdir/var/log/clamav/" - mkdir -p "$pkgdir/var/run/clamav/" - chown 64.root "$pkgdir/var/log/clamav/" - chown 64.root "$pkgdir/var/run/clamav/" - sed -i -e "s:\#LogFile /tmp/clamd.log:LogFile /var/log/clamav/clamd.log:" \ -e "s:\#PidFile /var/run/clamd.pid:PidFile /var/run/clamav/clamd.pid:" \ -e "s:\#User clamav:User clamav:" \ @@ -64,7 +55,6 @@ -e "s:\#NotifyClamd /path/to/clamd.conf$:NotifyClamd /etc/clamav/clamd.conf:" \ "$pkgdir/etc/clamav/freshclam.conf" - # fix perms on virus database directory and un-distribute databases to require freshclam + # un-distribute databases to require freshclam rm "$pkgdir"/var/lib/clamav/*.cvd - chown 64:64 -R "$pkgdir/var/lib/clamav/" } Modified: clamav.install =================================================================== --- clamav.install 2010-10-28 10:45:24 UTC (rev 97291) +++ clamav.install 2010-10-28 11:05:54 UTC (rev 97292) @@ -1,17 +1,14 @@ post_install() { - if [ -z "`getent group clamav`" ]; then - groupadd -g 64 clamav - fi - if [ -z "`getent passwd clamav`" ]; then - useradd -u 64 -g clamav -c "Clam AntiVirus" -d /dev/null -s /bin/false clamav - fi -} + getent group clamav &>/dev/null || groupadd -r -g 64 clamav >/dev/null + getent passwd clamav &>/dev/null || useradd -r -u 64 -g clamav -d /dev/null -s /bin/false -c "Clam AntiVirus" clamav >/dev/null -post_upgrade() { - post_install $1 + install -d /var/{log,run}/clamav + chown clamav:root /var/{log,run}/clamav + chown -R clamav:clamav /var/lib/clamav } -pre_remove() { - userdel clamav &> /dev/null - groupdel clamav &> /dev/null +post_remove() { + getent passwd clamav &>/dev/null && userdel clamav >/dev/null + getent group clamav &>/dev/null && groupdel clamav >/dev/null + return 0 }