wok-6.x annotate clamav/receipt @ rev 1319
Linux: CONFIG_HZ=1000
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Aug 28 10:01:41 2008 +0000 (2008-08-28) |
parents | 4a84b1fa39c3 |
children | e4688a3bbc50 |
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@1115 | 8 DEPENDS="gmp" |
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..." |
pascal@1137 | 50 cd $1/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..." |
pascal@1137 | 57 cd $1/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 |
pascal@1137 | 64 if ! grep -q clamav $1/etc/passwd; then |
paul@1104 | 65 echo "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@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 |