wok-next annotate clamav/receipt @ rev 6121
tazbb: show wanted version mismatch
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Sep 05 12:43:51 2010 +0200 (2010-09-05) |
parents | c32663be11f3 |
children | 820fd6180443 |
rev | line source |
---|---|
paul@1104 | 1 # SliTaz package receipt. |
paul@1104 | 2 |
paul@1104 | 3 PACKAGE="clamav" |
paul@5652 | 4 VERSION="0.96.1" |
paul@1104 | 5 CATEGORY="security" |
paul@1341 | 6 SHORT_DESC="Antivirus." |
paul@1104 | 7 MAINTAINER="paul@slitaz.org" |
pankso@3075 | 8 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses" |
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/" |
paul@1104 | 12 WGET_URL="http://downloads.sourceforge.net/clamav/$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 |
pascal@5721 | 19 adduser clamav -s /bin/false -h /tmp -H -D -S |
pascal@5721 | 20 addgroup clamav |
paul@1104 | 21 |
paul@1104 | 22 cd $src |
paul@1104 | 23 ./configure \ |
paul@1104 | 24 --prefix=/usr \ |
paul@1104 | 25 --sysconfdir=/etc/clamav \ |
paul@1104 | 26 --infodir=/usr/share/info \ |
paul@1104 | 27 --mandir=/usr/share/man \ |
pascal@3076 | 28 --with-iconv=no \ |
pascal@2608 | 29 $CONFIGURE_ARGS && |
pascal@5801 | 30 make -j 4 && |
paul@1104 | 31 make DESTDIR=$PWD/_pkg install |
paul@1104 | 32 } |
paul@1104 | 33 |
paul@1104 | 34 # Rules to gen a SliTaz package suitable for Tazpkg. |
paul@1104 | 35 genpkg_rules() |
paul@1104 | 36 { |
erjo@3463 | 37 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d |
paul@1104 | 38 cp -a $_pkg/usr/bin $fs/usr |
paul@1104 | 39 cp -a $_pkg/usr/sbin $fs/usr |
paul@1104 | 40 cp -a $_pkg/etc $fs |
paul@1104 | 41 # Copy only shared lib (.so) |
paul@1104 | 42 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib |
paul@1104 | 43 cp -a $_pkg/usr/share/clamav $fs/usr/share |
paul@1104 | 44 # Copy daemon from /stuff |
paul@1104 | 45 cp stuff/daemon-clamd $fs/etc/init.d/clamd |
paul@1104 | 46 } |
paul@1104 | 47 |
paul@1104 | 48 post_install() |
paul@1104 | 49 { |
paul@1104 | 50 echo "Processing post-install commands..." |
paul@1104 | 51 |
paul@1104 | 52 # Enable freshclam update |
paul@1104 | 53 echo -n "Enabling freshclam update..." |
pascal@1137 | 54 cd $1/etc/clamav |
paul@5652 | 55 sed -i 's/^Example/#Example/' freshclam.conf |
paul@1104 | 56 status |
paul@1104 | 57 |
paul@1104 | 58 # Enable clamd configuration |
paul@1104 | 59 echo -n "Enabling clamd daemon..." |
pascal@1137 | 60 cd $1/etc/clamav |
paul@5652 | 61 sed -i 's/^Example/#Example/; s/^#PidFile/PidFile/' clamd.conf |
paul@5652 | 62 status |
paul@5652 | 63 |
paul@5652 | 64 # Enable local socket |
paul@5652 | 65 echo -n "Enabling local socket..." |
paul@5652 | 66 cd $1/etc/clamav |
paul@5652 | 67 sed -i 's/^#LocalSocket /LocalSocket /' clamd.conf |
paul@1104 | 68 status |
paul@1104 | 69 |
paul@1104 | 70 # adduser clamav if needed |
pascal@1137 | 71 if ! grep -q clamav $1/etc/passwd; then |
paul@1341 | 72 echo -n "Adding user clamav..." |
pascal@1137 | 73 chroot $1/ adduser clamav -s /bin/false -H -D -S |
paul@1104 | 74 status |
paul@1104 | 75 fi |
paul@1595 | 76 |
paul@1707 | 77 # Enable daily.cvd updates (sometimes needed for new version) |
paul@1722 | 78 chown -R clamav:clamav /usr/share/clamav |
paul@1104 | 79 } |
paul@1104 | 80 |
paul@1104 | 81 # Del user clamav when pkg is removed. |
paul@1104 | 82 post_remove() |
paul@1104 | 83 { |
paul@1104 | 84 deluser clamav |
paul@1104 | 85 } |
paul@1104 | 86 |