wok annotate clamav/receipt @ rev 20398
Up miniupnpc (2.1)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jun 27 12:45:10 2018 +0200 (2018-06-27) |
parents | 56d11b20b04d |
children | d6dd3c2092ae |
rev | line source |
---|---|
paul@1104 | 1 # SliTaz package receipt. |
paul@1104 | 2 |
paul@1104 | 3 PACKAGE="clamav" |
erkan@20084 | 4 VERSION="0.99.2" |
paul@1104 | 5 CATEGORY="security" |
paul@1341 | 6 SHORT_DESC="Antivirus." |
paul@1104 | 7 MAINTAINER="paul@slitaz.org" |
pascal@16051 | 8 LICENSE="GPL2" |
paul@1104 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
paul@1104 | 10 WEB_SITE="http://www.clamav.net/" |
pascal@20086 | 11 WGET_URL="${WEB_SITE}downloads/production/$TARBALL" |
jozee@4933 | 12 TAGS="antivirus" |
paul@1104 | 13 |
pascal@20087 | 14 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl libssl" |
pascal@20087 | 15 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev openssl-dev bash" |
slaxemulator@10996 | 16 |
paul@1104 | 17 # Rules to configure and make the package. |
paul@1104 | 18 compile_rules() |
paul@1104 | 19 { |
pascal@17670 | 20 export LDFLAGS="$LDFLAGS -ltinfo" |
paul@1104 | 21 # Have to create clamav user/group to be able to compile |
slaxemulator@15826 | 22 adduser -s /bin/false -H -D -u 64 clamav |
paul@1104 | 23 |
paul@1104 | 24 ./configure \ |
paul@16157 | 25 --prefix=/usr \ |
paul@1104 | 26 --sysconfdir=/etc/clamav \ |
paul@16157 | 27 --with-dbdir=/var/lib/clamav \ |
pascal@3076 | 28 --with-iconv=no \ |
pascal@20087 | 29 --disable-zlib-vcheck \ |
slaxemulator@15826 | 30 $CONFIGURE_ARGS && |
slaxemulator@15826 | 31 make && |
slaxemulator@15826 | 32 make DESTDIR=$DESTDIR install |
paul@1104 | 33 } |
paul@1104 | 34 |
paul@1104 | 35 # Rules to gen a SliTaz package suitable for Tazpkg. |
paul@1104 | 36 genpkg_rules() |
paul@1104 | 37 { |
paul@16157 | 38 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \ |
paul@16157 | 39 $fs/var/log/clamav $fs/run/clamav |
erjo@11931 | 40 cp -a $install/usr/bin $fs/usr |
slaxemulator@15826 | 41 rm -f $fs/usr/bin/clamav-config |
erjo@11931 | 42 cp -a $install/usr/sbin $fs/usr |
erjo@11931 | 43 cp -a $install/etc $fs |
pascal@16052 | 44 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf |
pascal@16052 | 45 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf |
paul@1104 | 46 # Copy only shared lib (.so) |
erjo@11931 | 47 cp -a $install/usr/lib/*.so* $fs/usr/lib |
pankso@9697 | 48 # Copy daemon from /$stuff |
pankso@9697 | 49 cp $stuff/daemon-clamd $fs/etc/init.d/clamd |
al@18734 | 50 |
erjo@11931 | 51 # Customize config |
erjo@11931 | 52 sed -i -e "s/^Example/#Example/" \ |
erjo@11931 | 53 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \ |
paul@16157 | 54 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \ |
paul@16157 | 55 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \ |
erjo@11931 | 56 $fs/etc/clamav/clamd.conf |
erjo@11931 | 57 |
paul@1104 | 58 } |
paul@1104 | 59 |
paul@1104 | 60 post_install() |
paul@1104 | 61 { |
al@18734 | 62 local user=clamav |
al@18734 | 63 local group=clamav |
al@18734 | 64 |
paul@1104 | 65 # Enable freshclam update |
al@18734 | 66 echo; action 'Enabling freshclam update...' |
pascal@18730 | 67 cd "$1/etc/clamav" |
al@18734 | 68 sed -i 's/^Example/#Example/' freshclam.conf |
paul@1104 | 69 status |
paul@1104 | 70 |
paul@1104 | 71 # adduser clamav if needed |
pascal@18730 | 72 if ! grep -q "${user}:" "$1/etc/passwd"; then |
al@18734 | 73 action 'Adding user/group $user...' |
pascal@18730 | 74 chroot "$1/" addgroup -S $group |
pascal@18730 | 75 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user |
paul@1104 | 76 status |
paul@1104 | 77 fi |
paul@1595 | 78 |
paul@1707 | 79 # Enable daily.cvd updates (sometimes needed for new version) |
pascal@18730 | 80 #chown -R ${user}:${group} "$1/var/lib/clamav" |
al@18734 | 81 |
erjo@11931 | 82 # Fix perms |
pascal@18730 | 83 chroot "$1/" chown -R ${user}.${group} /var/log/clamav \ |
paul@16157 | 84 /run/clamav /var/lib/clamav |
paul@1104 | 85 } |
paul@1104 | 86 |
paul@1104 | 87 # Del user clamav when pkg is removed. |
paul@1104 | 88 post_remove() |
paul@1104 | 89 { |
al@18734 | 90 chroot "$1/" deluser clamav |
paul@1104 | 91 } |