wok-4.x annotate clamav/receipt @ rev 7827

remind: add post install
author Paul Issott <paul@slitaz.org>
date Sun Dec 26 20:04:30 2010 +0000 (2010-12-26)
parents e62b6b97629b
children f6df58d6487e
rev   line source
paul@1104 1 # SliTaz package receipt.
paul@1104 2
paul@1104 3 PACKAGE="clamav"
slaxemulator@7479 4 VERSION="0.96.5"
paul@1104 5 CATEGORY="security"
paul@1341 6 SHORT_DESC="Antivirus."
paul@1104 7 MAINTAINER="paul@slitaz.org"
paul@7101 8 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libtool"
slaxemulator@5411 9 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash"
paul@1104 10 TARBALL="$PACKAGE-$VERSION.tar.gz"
paul@1104 11 WEB_SITE="http://www.clamav.net/"
slaxemulator@7479 12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
jozee@4933 13 TAGS="antivirus"
paul@1104 14
paul@1104 15 # Rules to configure and make the package.
paul@1104 16 compile_rules()
paul@1104 17 {
paul@1104 18 # Have to create clamav user/group to be able to compile
paul@7101 19 adduser clamav -s /bin/false -H -D
paul@1104 20
paul@1104 21 cd $src
paul@1104 22 ./configure \
paul@1104 23 --prefix=/usr \
paul@1104 24 --sysconfdir=/etc/clamav \
paul@1104 25 --infodir=/usr/share/info \
paul@1104 26 --mandir=/usr/share/man \
pascal@3076 27 --with-iconv=no \
pascal@2608 28 $CONFIGURE_ARGS &&
pascal@5801 29 make -j 4 &&
paul@1104 30 make DESTDIR=$PWD/_pkg install
paul@1104 31 }
paul@1104 32
paul@1104 33 # Rules to gen a SliTaz package suitable for Tazpkg.
paul@1104 34 genpkg_rules()
paul@1104 35 {
erjo@3463 36 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d
paul@1104 37 cp -a $_pkg/usr/bin $fs/usr
paul@1104 38 cp -a $_pkg/usr/sbin $fs/usr
paul@1104 39 cp -a $_pkg/etc $fs
paul@1104 40 # Copy only shared lib (.so)
paul@1104 41 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
paul@1104 42 cp -a $_pkg/usr/share/clamav $fs/usr/share
paul@1104 43 # Copy daemon from /stuff
paul@1104 44 cp stuff/daemon-clamd $fs/etc/init.d/clamd
paul@1104 45 }
paul@1104 46
paul@1104 47 post_install()
paul@1104 48 {
paul@1104 49 echo "Processing post-install commands..."
paul@1104 50
paul@1104 51 # Enable freshclam update
paul@1104 52 echo -n "Enabling freshclam update..."
pascal@1137 53 cd $1/etc/clamav
paul@5652 54 sed -i 's/^Example/#Example/' freshclam.conf
paul@1104 55 status
paul@1104 56
paul@1104 57 # Enable clamd configuration
paul@1104 58 echo -n "Enabling clamd daemon..."
pascal@1137 59 cd $1/etc/clamav
paul@5652 60 sed -i 's/^Example/#Example/; s/^#PidFile/PidFile/' clamd.conf
paul@5652 61 status
paul@5652 62
paul@5652 63 # Enable local socket
paul@5652 64 echo -n "Enabling local socket..."
paul@5652 65 cd $1/etc/clamav
paul@5652 66 sed -i 's/^#LocalSocket /LocalSocket /' clamd.conf
paul@1104 67 status
paul@1104 68
paul@1104 69 # adduser clamav if needed
pascal@1137 70 if ! grep -q clamav $1/etc/passwd; then
paul@1341 71 echo -n "Adding user clamav..."
paul@7101 72 chroot $1/ adduser clamav -s /bin/false -H -D
paul@1104 73 status
paul@1104 74 fi
paul@1595 75
paul@1707 76 # Enable daily.cvd updates (sometimes needed for new version)
paul@7101 77 chown -R clamav:clamav $1/usr/share/clamav
paul@1104 78 }
paul@1104 79
paul@1104 80 # Del user clamav when pkg is removed.
paul@1104 81 post_remove()
paul@1104 82 {
paul@1104 83 deluser clamav
paul@1104 84 }
paul@1104 85