wok annotate clamav/receipt @ rev 25680
updated gnu-efi (3.0.14 -> 3.0.17)
author | Hans-G?nter Theisgen |
---|---|
date | Mon Mar 18 18:46:02 2024 +0100 (5 months ago) |
parents | 1be16cc1cd50 |
children |
rev | line source |
---|---|
paul@1104 | 1 # SliTaz package receipt. |
paul@1104 | 2 |
paul@1104 | 3 PACKAGE="clamav" |
Hans-G?nter@24406 | 4 VERSION="0.104.2" |
paul@1104 | 5 CATEGORY="security" |
Hans-G?nter@20789 | 6 TAGS="antivirus" |
paul@1341 | 7 SHORT_DESC="Antivirus." |
paul@1104 | 8 MAINTAINER="paul@slitaz.org" |
pascal@16051 | 9 LICENSE="GPL2" |
pascal@25361 | 10 WEB_SITE="https://github.com/Cisco-Talos/clamav" |
Hans-G?nter@20789 | 11 |
paul@1104 | 12 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@25021 | 13 WGET_URL="https://www.clamav.net/downloads/production/$TARBALL" |
paul@1104 | 14 |
Hans-G?nter@24406 | 15 DEPENDS="bzip2 gmp libcurl libjson-c libltdl libssl libxml2 ncurses |
Hans-G?nter@24406 | 16 pcre2 slitaz-base-files zlib" |
Hans-G?nter@24406 | 17 BUILD_DEPENDS="bzip2-dev check-dev cmake curl-dev gmp-dev libjson-c-dev |
Hans-G?nter@24407 | 18 libxml2-dev ncurses-dev openssl-dev pcre2-dev py3k zlib-dev" |
slaxemulator@10996 | 19 |
pascal@24759 | 20 # What is the latest version available today? |
pascal@24759 | 21 current_version() |
pascal@24759 | 22 { |
pascal@24759 | 23 wget -O - https://blog.clamav.net/ 2>/dev/null | \ |
pascal@24759 | 24 sed '/^ClamAV/!d;/ release/!d;/candidate/d;s|and|\n&|' | \ |
pascal@24759 | 25 sed 's|[^ ]* ||;s| .*||' | sort -Vr | sed q |
pascal@24759 | 26 } |
pascal@24759 | 27 |
paul@1104 | 28 # Rules to configure and make the package. |
paul@1104 | 29 compile_rules() |
paul@1104 | 30 { |
Hans-G?nter@24406 | 31 # export LDFLAGS="$LDFLAGS -ltinfo" |
paul@1104 | 32 # Have to create clamav user/group to be able to compile |
Hans-G?nter@24406 | 33 # adduser -s /bin/false -H -D -u 64 clamav |
paul@1104 | 34 |
Hans-G?nter@24406 | 35 # ./configure \ |
Hans-G?nter@24406 | 36 # --prefix=/usr \ |
Hans-G?nter@24406 | 37 # --sysconfdir=/etc/clamav \ |
Hans-G?nter@24406 | 38 # --with-dbdir=/var/lib/clamav \ |
Hans-G?nter@24406 | 39 # --with-iconv=no \ |
Hans-G?nter@24406 | 40 # --disable-zlib-vcheck \ |
Hans-G?nter@24406 | 41 # $CONFIGURE_ARGS && |
Hans-G?nter@24406 | 42 |
Hans-G?nter@24406 | 43 mkdir _build && |
Hans-G?nter@24406 | 44 cd _build && |
Hans-G?nter@24406 | 45 cmake .. \ |
Hans-G?nter@24406 | 46 -D CMAKE_INSTALL_PREFIX=/usr \ |
Hans-G?nter@24406 | 47 -D APP_CONFIG_DIRECTORY=/etc/clamav \ |
Hans-G?nter@24406 | 48 -D DATABASE_DIRECTORY=/var/lib/clamav \ |
Hans-G?nter@24406 | 49 -D ENABLE_MILTER=OFF \ |
Hans-G?nter@24406 | 50 -D ENABLE_STATIC_LIB=ON && |
slaxemulator@15826 | 51 make && |
Hans-G?nter@24406 | 52 make install |
paul@1104 | 53 } |
paul@1104 | 54 |
paul@1104 | 55 # Rules to gen a SliTaz package suitable for Tazpkg. |
paul@1104 | 56 genpkg_rules() |
paul@1104 | 57 { |
Hans-G?nter@24406 | 58 mkdir -p $fs/etc/clamav |
Hans-G?nter@24406 | 59 mkdir -p $fs/etc/init.d |
Hans-G?nter@24406 | 60 mkdir -p $fs/run/clamav |
Hans-G?nter@24406 | 61 mkdir -p $fs/usr/lib |
Hans-G?nter@24406 | 62 mkdir -p $fs/var/lib/clamav |
Hans-G?nter@24406 | 63 mkdir -p $fs/var/log/clamav |
al@18734 | 64 |
Hans-G?nter@24406 | 65 cp -a $install/etc/clamav/clamd.conf* \ |
Hans-G?nter@24406 | 66 $fs/etc/clamav/clamd.conf |
Hans-G?nter@24406 | 67 cp -a $install/etc/clamav/freshclam.conf* \ |
Hans-G?nter@24406 | 68 $fs/etc/clamav/freshclam.conf |
Hans-G?nter@24406 | 69 |
Hans-G?nter@24406 | 70 # Copy daemon from $stuff |
Hans-G?nter@24406 | 71 cp $stuff/daemon-clamd $fs/etc/init.d/clamd |
Hans-G?nter@24406 | 72 |
Hans-G?nter@24406 | 73 cp -a $install/usr/bin $fs/usr |
Hans-G?nter@24406 | 74 rm -f $fs/usr/bin/clamav-config |
Hans-G?nter@24406 | 75 cp -a $install/usr/sbin $fs/usr |
Hans-G?nter@24406 | 76 |
Hans-G?nter@24406 | 77 # Copy only shared libraries (.so) |
Hans-G?nter@24406 | 78 cp -a $install/usr/lib/*.so* $fs/usr/lib |
Hans-G?nter@24406 | 79 |
Hans-G?nter@24406 | 80 # Customize configuration file |
Hans-G?nter@24406 | 81 sed -i -e "s/^Example/#Example/" \ |
erjo@11931 | 82 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \ |
paul@16157 | 83 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \ |
paul@16157 | 84 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \ |
erjo@11931 | 85 $fs/etc/clamav/clamd.conf |
paul@1104 | 86 } |
paul@1104 | 87 |
paul@1104 | 88 post_install() |
paul@1104 | 89 { |
al@18734 | 90 local user=clamav |
al@18734 | 91 local group=clamav |
al@18734 | 92 |
paul@1104 | 93 # Enable freshclam update |
Hans-G?nter@24406 | 94 echo |
Hans-G?nter@24406 | 95 action 'Enabling freshclam update...' |
pascal@18730 | 96 cd "$1/etc/clamav" |
Hans-G?nter@24406 | 97 sed -i 's/^Example/#Example/' freshclam.conf |
paul@1104 | 98 status |
Hans-G?nter@24406 | 99 [ "$quiet" ] || cat <<EOT |
Hans-G?nter@24406 | 100 Before starting clamd for the first time, |
Hans-G?nter@24406 | 101 create signature database with freshclam." |
Hans-G?nter@24406 | 102 EOT |
paul@1104 | 103 |
paul@1104 | 104 # adduser clamav if needed |
Hans-G?nter@24406 | 105 if ! grep -q "${user}:" "$1/etc/passwd" |
Hans-G?nter@24406 | 106 then |
Hans-G?nter@24406 | 107 action 'Adding user and group $user...' |
pascal@18730 | 108 chroot "$1/" addgroup -S $group |
pascal@18730 | 109 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user |
paul@1104 | 110 status |
paul@1104 | 111 fi |
paul@1595 | 112 |
paul@1707 | 113 # Enable daily.cvd updates (sometimes needed for new version) |
pascal@18730 | 114 #chown -R ${user}:${group} "$1/var/lib/clamav" |
al@18734 | 115 |
Hans-G?nter@24406 | 116 # Fix permissions |
Hans-G?nter@24406 | 117 chroot "$1/" chown -R ${user}.${group} /run/clamav |
Hans-G?nter@24406 | 118 chroot "$1/" chown -R ${user}.${group} /var/lib/clamav |
Hans-G?nter@24406 | 119 chroot "$1/" chown -R ${user}.${group} /var/log/clamav |
paul@1104 | 120 } |
paul@1104 | 121 |
Hans-G?nter@24406 | 122 # Delete user clamav when package is removed. |
paul@1104 | 123 post_remove() |
paul@1104 | 124 { |
al@18734 | 125 chroot "$1/" deluser clamav |
paul@1104 | 126 } |
Hans-G?nter@24409 | 127 |