wok-next annotate clamav/receipt @ rev 15826
Up: clamav to 0.97.5.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Fri Jan 24 10:27:10 2014 +0000 (2014-01-24) |
parents | 7896f0694ef6 |
children | 65eeddf9a0a0 |
rev | line source |
---|---|
paul@1104 | 1 # SliTaz package receipt. |
paul@1104 | 2 |
paul@1104 | 3 PACKAGE="clamav" |
slaxemulator@15826 | 4 VERSION="0.97.5" |
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@15826 | 20 adduser -s /bin/false -H -D -u 64 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 \ |
slaxemulator@15826 | 26 $CONFIGURE_ARGS && |
slaxemulator@15826 | 27 make && |
slaxemulator@15826 | 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@11931 | 34 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d \ |
erjo@11931 | 35 $fs/var/log/clamav $fs/var/run/clamav |
erjo@11931 | 36 cp -a $install/usr/bin $fs/usr |
slaxemulator@15826 | 37 rm -f $fs/usr/bin/clamav-config |
erjo@11931 | 38 cp -a $install/usr/sbin $fs/usr |
erjo@11931 | 39 cp -a $install/etc $fs |
paul@1104 | 40 # Copy only shared lib (.so) |
erjo@11931 | 41 cp -a $install/usr/lib/*.so* $fs/usr/lib |
erjo@11931 | 42 cp -a $install/usr/share/clamav $fs/usr/share |
pankso@9697 | 43 # Copy daemon from /$stuff |
pankso@9697 | 44 cp $stuff/daemon-clamd $fs/etc/init.d/clamd |
erjo@11931 | 45 |
erjo@11931 | 46 # Customize config |
erjo@11931 | 47 sed -i -e "s/^Example/#Example/" \ |
erjo@11931 | 48 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \ |
erjo@11931 | 49 -e "s|^#PidFile.*|PidFile /var/run/clamav/clamd.pid|" \ |
erjo@11931 | 50 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /var/run/clamav/clamd.ctl|" \ |
erjo@11931 | 51 $fs/etc/clamav/clamd.conf |
erjo@11931 | 52 |
paul@1104 | 53 } |
paul@1104 | 54 |
paul@1104 | 55 post_install() |
paul@1104 | 56 { |
erjo@11931 | 57 |
erjo@11931 | 58 local user |
erjo@11931 | 59 local group |
erjo@11931 | 60 |
erjo@11931 | 61 user=clamav |
erjo@11931 | 62 group=clamav |
erjo@11931 | 63 |
paul@1104 | 64 echo "Processing post-install commands..." |
paul@1104 | 65 |
paul@1104 | 66 # Enable freshclam update |
paul@1104 | 67 echo -n "Enabling freshclam update..." |
pascal@1137 | 68 cd $1/etc/clamav |
paul@5652 | 69 sed -i 's/^Example/#Example/' freshclam.conf |
paul@1104 | 70 status |
paul@1104 | 71 |
paul@1104 | 72 # adduser clamav if needed |
erjo@11931 | 73 if ! grep -q "${user}:" $1/etc/passwd; then |
erjo@11931 | 74 echo -n "Adding user/group $user..." |
erjo@11931 | 75 chroot $1/ addgroup -S $group |
erjo@11931 | 76 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user |
paul@1104 | 77 status |
paul@1104 | 78 fi |
paul@1595 | 79 |
paul@1707 | 80 # Enable daily.cvd updates (sometimes needed for new version) |
erjo@11931 | 81 chown -R ${user}:${group} $1/usr/share/clamav |
erjo@11931 | 82 |
erjo@11931 | 83 # Fix perms |
erjo@11931 | 84 chroot $1/ chown -R ${user}.${group} /var/log/clamav \ |
erjo@11931 | 85 /var/run/clamav |
erjo@11931 | 86 |
paul@1104 | 87 } |
paul@1104 | 88 |
paul@1104 | 89 # Del user clamav when pkg is removed. |
paul@1104 | 90 post_remove() |
paul@1104 | 91 { |
slaxemulator@10996 | 92 chroot "$1/" deluser clamav |
paul@1104 | 93 } |
paul@1104 | 94 |