wok view clamav/receipt @ rev 24427

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 12 11:42:56 2022 +0000 (2022-02-12)
parents 061d49c68c42
children b01314c762e9
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.104.2"
5 CATEGORY="security"
6 TAGS="antivirus"
7 SHORT_DESC="Antivirus."
8 MAINTAINER="paul@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="https://www.clamav.net/"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="${WEB_SITE}downloads/production/$TARBALL"
15 DEPENDS="bzip2 gmp libcurl libjson-c libltdl libssl libxml2 ncurses
16 pcre2 slitaz-base-files zlib"
17 BUILD_DEPENDS="bzip2-dev check-dev cmake curl-dev gmp-dev libjson-c-dev
18 libxml2-dev ncurses-dev openssl-dev pcre2-dev py3k zlib-dev"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 # export LDFLAGS="$LDFLAGS -ltinfo"
24 # Have to create clamav user/group to be able to compile
25 # adduser -s /bin/false -H -D -u 64 clamav
27 # ./configure \
28 # --prefix=/usr \
29 # --sysconfdir=/etc/clamav \
30 # --with-dbdir=/var/lib/clamav \
31 # --with-iconv=no \
32 # --disable-zlib-vcheck \
33 # $CONFIGURE_ARGS &&
35 mkdir _build &&
36 cd _build &&
37 cmake .. \
38 -D CMAKE_INSTALL_PREFIX=/usr \
39 -D APP_CONFIG_DIRECTORY=/etc/clamav \
40 -D DATABASE_DIRECTORY=/var/lib/clamav \
41 -D ENABLE_MILTER=OFF \
42 -D ENABLE_STATIC_LIB=ON &&
43 make &&
44 make install
45 }
47 # Rules to gen a SliTaz package suitable for Tazpkg.
48 genpkg_rules()
49 {
50 mkdir -p $fs/etc/clamav
51 mkdir -p $fs/etc/init.d
52 mkdir -p $fs/run/clamav
53 mkdir -p $fs/usr/lib
54 mkdir -p $fs/var/lib/clamav
55 mkdir -p $fs/var/log/clamav
57 cp -a $install/etc/clamav/clamd.conf* \
58 $fs/etc/clamav/clamd.conf
59 cp -a $install/etc/clamav/freshclam.conf* \
60 $fs/etc/clamav/freshclam.conf
62 # Copy daemon from $stuff
63 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
65 cp -a $install/usr/bin $fs/usr
66 rm -f $fs/usr/bin/clamav-config
67 cp -a $install/usr/sbin $fs/usr
69 # Copy only shared libraries (.so)
70 cp -a $install/usr/lib/*.so* $fs/usr/lib
72 # Customize configuration file
73 sed -i -e "s/^Example/#Example/" \
74 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
75 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \
76 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \
77 $fs/etc/clamav/clamd.conf
78 }
80 post_install()
81 {
82 local user=clamav
83 local group=clamav
85 # Enable freshclam update
86 echo
87 action 'Enabling freshclam update...'
88 cd "$1/etc/clamav"
89 sed -i 's/^Example/#Example/' freshclam.conf
90 status
91 [ "$quiet" ] || cat <<EOT
92 Before starting clamd for the first time,
93 create signature database with freshclam."
94 EOT
96 # adduser clamav if needed
97 if ! grep -q "${user}:" "$1/etc/passwd"
98 then
99 action 'Adding user and group $user...'
100 chroot "$1/" addgroup -S $group
101 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
102 status
103 fi
105 # Enable daily.cvd updates (sometimes needed for new version)
106 #chown -R ${user}:${group} "$1/var/lib/clamav"
108 # Fix permissions
109 chroot "$1/" chown -R ${user}.${group} /run/clamav
110 chroot "$1/" chown -R ${user}.${group} /var/lib/clamav
111 chroot "$1/" chown -R ${user}.${group} /var/log/clamav
112 }
114 # Delete user clamav when package is removed.
115 post_remove()
116 {
117 chroot "$1/" deluser clamav
118 }