wok-current annotate clamav/receipt @ rev 11173

Up: clamav to 0.97.3.
author Christopher Rogers <slaxemulator@gmail.com>
date Wed Nov 02 15:36:42 2011 +0000 (2011-11-02)
parents e554dc108e47
children af696f5ac1e7
rev   line source
paul@1104 1 # SliTaz package receipt.
paul@1104 2
paul@1104 3 PACKAGE="clamav"
slaxemulator@11173 4 VERSION="0.97.3"
paul@1104 5 CATEGORY="security"
paul@1341 6 SHORT_DESC="Antivirus."
paul@1104 7 MAINTAINER="paul@slitaz.org"
paul@1104 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
paul@1104 9 WEB_SITE="http://www.clamav.net/"
slaxemulator@7479 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
jozee@4933 11 TAGS="antivirus"
paul@1104 12
slaxemulator@10996 13 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl"
slaxemulator@10996 14 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash"
slaxemulator@10996 15
paul@1104 16 # Rules to configure and make the package.
paul@1104 17 compile_rules()
paul@1104 18 {
paul@1104 19 # Have to create clamav user/group to be able to compile
slaxemulator@7963 20 adduser -s /bin/false -H -D clamav
paul@1104 21
paul@1104 22 cd $src
paul@1104 23 ./configure \
paul@1104 24 --sysconfdir=/etc/clamav \
pascal@3076 25 --with-iconv=no \
pascal@2608 26 $CONFIGURE_ARGS &&
slaxemulator@10996 27 make &&
slaxemulator@10996 28 make DESTDIR=$DESTDIR 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 {
erjo@3463 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
pankso@9697 41 # Copy daemon from /$stuff
pankso@9697 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@5652 52 sed -i 's/^Example/#Example/' freshclam.conf
paul@1104 53 status
paul@1104 54
paul@1104 55 # Enable clamd configuration
paul@1104 56 echo -n "Enabling clamd daemon..."
pascal@1137 57 cd $1/etc/clamav
paul@5652 58 sed -i 's/^Example/#Example/; s/^#PidFile/PidFile/' clamd.conf
paul@5652 59 status
paul@5652 60
paul@5652 61 # Enable local socket
paul@5652 62 echo -n "Enabling local socket..."
paul@5652 63 cd $1/etc/clamav
paul@5652 64 sed -i 's/^#LocalSocket /LocalSocket /' clamd.conf
paul@1104 65 status
paul@1104 66
paul@1104 67 # adduser clamav if needed
pascal@1137 68 if ! grep -q clamav $1/etc/passwd; then
paul@1341 69 echo -n "Adding user clamav..."
slaxemulator@7963 70 chroot $1/ adduser -s /bin/false -H -D -u 64 clamav
slaxemulator@7963 71 status
slaxemulator@7963 72 fi
slaxemulator@7963 73
slaxemulator@7963 74 # addgroup clamav if needed
slaxemulator@7963 75 if ! grep -q clamav $1/etc/group; then
slaxemulator@7963 76 echo -n "Adding group clamav..."
slaxemulator@7963 77 chroot $1/ addgroup -g 64 clamav
paul@1104 78 status
paul@1104 79 fi
paul@1595 80
paul@1707 81 # Enable daily.cvd updates (sometimes needed for new version)
paul@7101 82 chown -R clamav:clamav $1/usr/share/clamav
paul@1104 83 }
paul@1104 84
paul@1104 85 # Del user clamav when pkg is removed.
paul@1104 86 post_remove()
paul@1104 87 {
slaxemulator@10996 88 chroot "$1/" deluser clamav
paul@1104 89 }
paul@1104 90