wok-next annotate clamav/receipt @ rev 20534
Clean default configure options when site script used.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Mar 30 19:31:50 2018 +0300 (2018-03-30) |
parents | 3e3205b3b68f |
children | 835b3b8ce6ac |
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@1104 | 30 --sysconfdir=/etc/clamav \ |
paul@16157 | 31 --with-dbdir=/var/lib/clamav \ |
pascal@3076 | 32 --with-iconv=no \ |
slaxemulator@15826 | 33 $CONFIGURE_ARGS && |
slaxemulator@15826 | 34 make && |
slaxemulator@15826 | 35 make DESTDIR=$DESTDIR install |
paul@1104 | 36 } |
paul@1104 | 37 |
al@20459 | 38 genpkg_rules() { |
al@20459 | 39 case $PACKAGE in |
al@20459 | 40 clamav) |
al@20459 | 41 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \ |
al@20459 | 42 $fs/var/log/clamav $fs/run/clamav |
al@20459 | 43 cp -a $install/usr/bin $fs/usr |
al@20459 | 44 rm -f $fs/usr/bin/clamav-config |
al@20459 | 45 cp -a $install/usr/sbin $fs/usr |
al@20459 | 46 cp -a $install/etc $fs |
al@20459 | 47 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf |
al@20459 | 48 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf |
al@20459 | 49 # Copy only shared lib (.so) |
al@20459 | 50 cp -a $install/usr/lib/*.so* $fs/usr/lib |
al@20459 | 51 # Copy daemon from /$stuff |
al@20459 | 52 cp $stuff/daemon-clamd $fs/etc/init.d/clamd |
al@18734 | 53 |
al@20459 | 54 # Customize config |
al@20459 | 55 sed -i -e "s/^Example/#Example/" \ |
al@20459 | 56 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \ |
al@20459 | 57 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \ |
al@20459 | 58 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \ |
al@20459 | 59 $fs/etc/clamav/clamd.conf |
al@20459 | 60 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl" |
al@20459 | 61 TAGS="antivirus" |
al@20459 | 62 ;; |
al@20459 | 63 *-dev) |
al@20534 | 64 copy @dev |
al@20459 | 65 ;; |
al@20459 | 66 esac |
paul@1104 | 67 } |
paul@1104 | 68 |
al@20459 | 69 post_install_clamav() { |
al@18734 | 70 local user=clamav |
al@18734 | 71 local group=clamav |
al@18734 | 72 |
paul@1104 | 73 # Enable freshclam update |
al@18734 | 74 echo; action 'Enabling freshclam update...' |
pascal@18730 | 75 cd "$1/etc/clamav" |
al@18734 | 76 sed -i 's/^Example/#Example/' freshclam.conf |
paul@1104 | 77 status |
paul@1104 | 78 |
paul@1104 | 79 # adduser clamav if needed |
pascal@18730 | 80 if ! grep -q "${user}:" "$1/etc/passwd"; then |
al@18734 | 81 action 'Adding user/group $user...' |
pascal@18730 | 82 chroot "$1/" addgroup -S $group |
pascal@18730 | 83 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user |
paul@1104 | 84 status |
paul@1104 | 85 fi |
paul@1595 | 86 |
paul@1707 | 87 # Enable daily.cvd updates (sometimes needed for new version) |
pascal@18730 | 88 #chown -R ${user}:${group} "$1/var/lib/clamav" |
al@18734 | 89 |
erjo@11931 | 90 # Fix perms |
pascal@18730 | 91 chroot "$1/" chown -R ${user}.${group} /var/log/clamav \ |
paul@16157 | 92 /run/clamav /var/lib/clamav |
paul@1104 | 93 } |
paul@1104 | 94 |
al@20459 | 95 post_remove_clamav() { |
al@18734 | 96 chroot "$1/" deluser clamav |
paul@1104 | 97 } |