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