wok annotate clamav/receipt @ rev 1104

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