wok-next annotate clamav/receipt @ rev 20472
Add new LFS packages meson, ninja; py3k -> python3; gcc49, gcc54, gcc61: fix $ARCH_ARGS, --disable-multilib; misc. unsuccessful patches...
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Mar 10 13:48:53 2018 +0200 (2018-03-10) |
parents | a7b1395df64a |
children | 757d032c55c7 |
rev | line source |
---|---|
al@20459 | 1 # SliTaz package receipt v2. |
paul@1104 | 2 |
paul@1104 | 3 PACKAGE="clamav" |
al@20472 | 4 VERSION="0.99.4" |
paul@1104 | 5 CATEGORY="security" |
al@20472 | 6 SHORT_DESC="Antivirus" |
paul@1104 | 7 MAINTAINER="paul@slitaz.org" |
pascal@16051 | 8 LICENSE="GPL2" |
al@20472 | 9 WEB_SITE="https://www.clamav.net/" |
al@20459 | 10 |
paul@1104 | 11 TARBALL="$PACKAGE-$VERSION.tar.gz" |
al@20472 | 12 WGET_URL="https://www.clamav.net/downloads/production/$TARBALL" |
paul@1104 | 13 |
al@20472 | 14 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash \ |
al@20472 | 15 libxml2-dev openssl-dev" |
al@20459 | 16 SPLIT="clamav-dev" |
slaxemulator@10996 | 17 |
al@20459 | 18 compile_rules() { |
pascal@19704 | 19 grep -rl 'alignof(' * | xargs sed -i 's|alignof(|alignof_(|' |
pascal@19704 | 20 grep -rl 'alignof<' * | xargs sed -i 's|alignof<|alignof_<|' |
pascal@19704 | 21 grep -rl '__alignof_' * | xargs sed -i 's|__alignof_|__alignof|' |
pascal@19704 | 22 sed -i 's|make_pair<.*>|make_pair|' libclamav/c++/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp |
pascal@19704 | 23 sed -i 's|~0|~0U|g' libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp \ |
pascal@19704 | 24 libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp |
pascal@19704 | 25 |
paul@1104 | 26 # Have to create clamav user/group to be able to compile |
slaxemulator@15826 | 27 adduser -s /bin/false -H -D -u 64 clamav |
paul@1104 | 28 |
paul@1104 | 29 ./configure \ |
paul@16157 | 30 --prefix=/usr \ |
paul@1104 | 31 --sysconfdir=/etc/clamav \ |
paul@16157 | 32 --with-dbdir=/var/lib/clamav \ |
pascal@3076 | 33 --with-iconv=no \ |
slaxemulator@15826 | 34 $CONFIGURE_ARGS && |
slaxemulator@15826 | 35 make && |
slaxemulator@15826 | 36 make DESTDIR=$DESTDIR install |
paul@1104 | 37 } |
paul@1104 | 38 |
al@20459 | 39 genpkg_rules() { |
al@20459 | 40 case $PACKAGE in |
al@20459 | 41 clamav) |
al@20459 | 42 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \ |
al@20459 | 43 $fs/var/log/clamav $fs/run/clamav |
al@20459 | 44 cp -a $install/usr/bin $fs/usr |
al@20459 | 45 rm -f $fs/usr/bin/clamav-config |
al@20459 | 46 cp -a $install/usr/sbin $fs/usr |
al@20459 | 47 cp -a $install/etc $fs |
al@20459 | 48 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf |
al@20459 | 49 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf |
al@20459 | 50 # Copy only shared lib (.so) |
al@20459 | 51 cp -a $install/usr/lib/*.so* $fs/usr/lib |
al@20459 | 52 # Copy daemon from /$stuff |
al@20459 | 53 cp $stuff/daemon-clamd $fs/etc/init.d/clamd |
al@18734 | 54 |
al@20459 | 55 # Customize config |
al@20459 | 56 sed -i -e "s/^Example/#Example/" \ |
al@20459 | 57 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \ |
al@20459 | 58 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \ |
al@20459 | 59 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \ |
al@20459 | 60 $fs/etc/clamav/clamd.conf |
al@20459 | 61 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl" |
al@20459 | 62 TAGS="antivirus" |
al@20459 | 63 ;; |
al@20459 | 64 *-dev) |
al@20459 | 65 mkdir -p $fs/usr/lib \ |
al@20459 | 66 $fs/usr/bin |
al@20459 | 67 |
al@20459 | 68 cp -a $install/usr/include $fs/usr |
al@20459 | 69 cp -a $install/usr/lib/pkgconfig $fs/usr/lib |
al@20459 | 70 cp -a $install/usr/lib/*.*a $fs/usr/lib |
al@20459 | 71 cp -a $install/usr/bin/clamav-config $fs/usr/bin |
al@20459 | 72 ;; |
al@20459 | 73 esac |
paul@1104 | 74 } |
paul@1104 | 75 |
al@20459 | 76 post_install_clamav() { |
al@18734 | 77 local user=clamav |
al@18734 | 78 local group=clamav |
al@18734 | 79 |
paul@1104 | 80 # Enable freshclam update |
al@18734 | 81 echo; action 'Enabling freshclam update...' |
pascal@18730 | 82 cd "$1/etc/clamav" |
al@18734 | 83 sed -i 's/^Example/#Example/' freshclam.conf |
paul@1104 | 84 status |
paul@1104 | 85 |
paul@1104 | 86 # adduser clamav if needed |
pascal@18730 | 87 if ! grep -q "${user}:" "$1/etc/passwd"; then |
al@18734 | 88 action 'Adding user/group $user...' |
pascal@18730 | 89 chroot "$1/" addgroup -S $group |
pascal@18730 | 90 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user |
paul@1104 | 91 status |
paul@1104 | 92 fi |
paul@1595 | 93 |
paul@1707 | 94 # Enable daily.cvd updates (sometimes needed for new version) |
pascal@18730 | 95 #chown -R ${user}:${group} "$1/var/lib/clamav" |
al@18734 | 96 |
erjo@11931 | 97 # Fix perms |
pascal@18730 | 98 chroot "$1/" chown -R ${user}.${group} /var/log/clamav \ |
paul@16157 | 99 /run/clamav /var/lib/clamav |
paul@1104 | 100 } |
paul@1104 | 101 |
al@20459 | 102 post_remove_clamav() { |
al@18734 | 103 chroot "$1/" deluser clamav |
paul@1104 | 104 } |