wok-current annotate clamav/receipt @ rev 1750

perl-dbd-mysql: update DEPENDS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Nov 23 12:23:06 2008 +0000 (2008-11-23)
parents b1ccbfb29477
children 65c4ca6ce76a
rev   line source
paul@1104 1 # SliTaz package receipt.
paul@1104 2
paul@1104 3 PACKAGE="clamav"
paul@1707 4 VERSION="0.94.1"
paul@1104 5 CATEGORY="security"
paul@1341 6 SHORT_DESC="Antivirus."
paul@1104 7 MAINTAINER="paul@slitaz.org"
paul@1341 8 DEPENDS="zlib gmp bzip2"
paul@1711 9 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev"
paul@1104 10 TARBALL="$PACKAGE-$VERSION.tar.gz"
paul@1104 11 WEB_SITE="http://www.clamav.net/"
paul@1104 12 WGET_URL="http://downloads.sourceforge.net/clamav/$TARBALL"
paul@1104 13
paul@1104 14 # Rules to configure and make the package.
paul@1104 15 compile_rules()
paul@1104 16 {
paul@1104 17 # Have to create clamav user/group to be able to compile
paul@1104 18 adduser clamav -s /bin/false -H -D -S
paul@1104 19
paul@1104 20 cd $src
paul@1104 21 ./configure \
paul@1104 22 --prefix=/usr \
paul@1104 23 --sysconfdir=/etc/clamav \
paul@1104 24 --infodir=/usr/share/info \
paul@1104 25 --mandir=/usr/share/man \
paul@1104 26 $CONFIGURE_ARGS
paul@1104 27 make
paul@1104 28 make DESTDIR=$PWD/_pkg install
paul@1104 29 }
paul@1104 30
paul@1104 31 # Rules to gen a SliTaz package suitable for Tazpkg.
paul@1104 32 genpkg_rules()
paul@1104 33 {
paul@1104 34 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d
paul@1104 35 cp -a $_pkg/usr/bin $fs/usr
paul@1104 36 cp -a $_pkg/usr/sbin $fs/usr
paul@1104 37 cp -a $_pkg/etc $fs
paul@1104 38 # Copy only shared lib (.so)
paul@1104 39 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
paul@1104 40 cp -a $_pkg/usr/share/clamav $fs/usr/share
paul@1104 41 # Copy daemon from /stuff
paul@1104 42 cp stuff/daemon-clamd $fs/etc/init.d/clamd
paul@1104 43 }
paul@1104 44
paul@1104 45 post_install()
paul@1104 46 {
paul@1104 47 echo "Processing post-install commands..."
paul@1104 48
paul@1104 49 # Enable freshclam update
paul@1104 50 echo -n "Enabling freshclam update..."
pascal@1137 51 cd $1/etc/clamav
paul@1104 52 sed 's/^Example/#Example/' < freshclam.conf > temp.file
paul@1104 53 mv temp.file freshclam.conf
paul@1104 54 status
paul@1104 55
paul@1104 56 # Enable clamd configuration
paul@1104 57 echo -n "Enabling clamd daemon..."
pascal@1137 58 cd $1/etc/clamav
paul@1104 59 sed 's/^Example/#Example/; s/^#PidFile/PidFile/' < clamd.conf > temp.file
paul@1104 60 mv temp.file clamd.conf
paul@1104 61 status
paul@1104 62
paul@1104 63 # adduser clamav if needed
pascal@1137 64 if ! grep -q clamav $1/etc/passwd; then
paul@1341 65 echo -n "Adding user clamav..."
pascal@1137 66 chroot $1/ adduser clamav -s /bin/false -H -D -S
paul@1104 67 status
paul@1104 68 fi
paul@1595 69
paul@1707 70 # Enable daily.cvd updates (sometimes needed for new version)
paul@1722 71 chown -R clamav:clamav /usr/share/clamav
paul@1104 72 }
paul@1104 73
paul@1104 74 # Del user clamav when pkg is removed.
paul@1104 75 post_remove()
paul@1104 76 {
paul@1104 77 deluser clamav
paul@1104 78 }
paul@1104 79