wok-6.x annotate clamav/receipt @ rev 15374
Up apache-mod-perl (2.0.8)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Oct 17 18:09:17 2013 +0000 (2013-10-17) |
parents | af696f5ac1e7 |
children | 5d0d0906801e |
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" |
pascal@15002 | 8 LICENSE="GPL2" |
paul@1104 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
paul@1104 | 10 WEB_SITE="http://www.clamav.net/" |
slaxemulator@7479 | 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
jozee@4933 | 12 TAGS="antivirus" |
paul@1104 | 13 |
slaxemulator@10996 | 14 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl" |
slaxemulator@10996 | 15 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash" |
slaxemulator@10996 | 16 |
paul@1104 | 17 # Rules to configure and make the package. |
paul@1104 | 18 compile_rules() |
paul@1104 | 19 { |
paul@1104 | 20 # Have to create clamav user/group to be able to compile |
slaxemulator@7963 | 21 adduser -s /bin/false -H -D clamav |
paul@1104 | 22 |
paul@1104 | 23 cd $src |
paul@1104 | 24 ./configure \ |
paul@1104 | 25 --sysconfdir=/etc/clamav \ |
pascal@3076 | 26 --with-iconv=no \ |
erjo@11931 | 27 $CONFIGURE_ARGS && make && make 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 { |
erjo@11931 | 33 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d \ |
erjo@11931 | 34 $fs/var/log/clamav $fs/var/run/clamav |
erjo@11931 | 35 cp -a $install/usr/bin $fs/usr |
erjo@11931 | 36 cp -a $install/usr/sbin $fs/usr |
erjo@11931 | 37 cp -a $install/etc $fs |
paul@1104 | 38 # Copy only shared lib (.so) |
erjo@11931 | 39 cp -a $install/usr/lib/*.so* $fs/usr/lib |
erjo@11931 | 40 cp -a $install/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 |
erjo@11931 | 43 |
erjo@11931 | 44 # Customize config |
erjo@11931 | 45 sed -i -e "s/^Example/#Example/" \ |
erjo@11931 | 46 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \ |
erjo@11931 | 47 -e "s|^#PidFile.*|PidFile /var/run/clamav/clamd.pid|" \ |
erjo@11931 | 48 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /var/run/clamav/clamd.ctl|" \ |
erjo@11931 | 49 $fs/etc/clamav/clamd.conf |
erjo@11931 | 50 |
paul@1104 | 51 } |
paul@1104 | 52 |
paul@1104 | 53 post_install() |
paul@1104 | 54 { |
erjo@11931 | 55 |
erjo@11931 | 56 local user |
erjo@11931 | 57 local group |
erjo@11931 | 58 |
erjo@11931 | 59 user=clamav |
erjo@11931 | 60 group=clamav |
erjo@11931 | 61 |
paul@1104 | 62 echo "Processing post-install commands..." |
paul@1104 | 63 |
paul@1104 | 64 # Enable freshclam update |
paul@1104 | 65 echo -n "Enabling freshclam update..." |
pascal@1137 | 66 cd $1/etc/clamav |
paul@5652 | 67 sed -i 's/^Example/#Example/' freshclam.conf |
paul@1104 | 68 status |
paul@1104 | 69 |
paul@1104 | 70 # adduser clamav if needed |
erjo@11931 | 71 if ! grep -q "${user}:" $1/etc/passwd; then |
erjo@11931 | 72 echo -n "Adding user/group $user..." |
erjo@11931 | 73 chroot $1/ addgroup -S $group |
erjo@11931 | 74 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user |
paul@1104 | 75 status |
paul@1104 | 76 fi |
paul@1595 | 77 |
paul@1707 | 78 # Enable daily.cvd updates (sometimes needed for new version) |
erjo@11931 | 79 chown -R ${user}:${group} $1/usr/share/clamav |
erjo@11931 | 80 |
erjo@11931 | 81 # Fix perms |
erjo@11931 | 82 chroot $1/ chown -R ${user}.${group} /var/log/clamav \ |
erjo@11931 | 83 /var/run/clamav |
erjo@11931 | 84 |
paul@1104 | 85 } |
paul@1104 | 86 |
paul@1104 | 87 # Del user clamav when pkg is removed. |
paul@1104 | 88 post_remove() |
paul@1104 | 89 { |
slaxemulator@10996 | 90 chroot "$1/" deluser clamav |
paul@1104 | 91 } |
paul@1104 | 92 |