wok view clamav/receipt @ rev 23668
updated sratom (0.6.2 -> 0.6.4)
author | Hans-G?nter Theisgen |
---|---|
date | Sun Apr 26 06:57:14 2020 +0100 (2020-04-26) |
parents | 1813ca10e967 |
children | ae73fb35f0cf |
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.102.1"
5 CATEGORY="security"
6 TAGS="antivirus"
7 SHORT_DESC="Antivirus."
8 MAINTAINER="paul@slitaz.org"
9 LICENSE="GPL2"
10 WEB_SITE="http://www.clamav.net/"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="${WEB_SITE}downloads/production/$TARBALL"
15 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl libssl"
16 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev openssl-dev bash curl-dev libjson-c-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 export LDFLAGS="$LDFLAGS -ltinfo"
22 # Have to create clamav user/group to be able to compile
23 adduser -s /bin/false -H -D -u 64 clamav
25 ./configure \
26 --prefix=/usr \
27 --sysconfdir=/etc/clamav \
28 --with-dbdir=/var/lib/clamav \
29 --with-iconv=no \
30 --disable-zlib-vcheck \
31 $CONFIGURE_ARGS &&
32 make &&
33 make DESTDIR=$DESTDIR install
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \
40 $fs/var/log/clamav $fs/run/clamav
41 cp -a $install/usr/bin $fs/usr
42 rm -f $fs/usr/bin/clamav-config
43 cp -a $install/usr/sbin $fs/usr
44 cp -a $install/etc $fs
45 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf
46 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf
47 # Copy only shared lib (.so)
48 cp -a $install/usr/lib/*.so* $fs/usr/lib
49 # Copy daemon from /$stuff
50 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
52 # Customize config
53 sed -i -e "s/^Example/#Example/" \
54 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
55 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \
56 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \
57 $fs/etc/clamav/clamd.conf
59 }
61 post_install()
62 {
63 local user=clamav
64 local group=clamav
66 # Enable freshclam update
67 echo; action 'Enabling freshclam update...'
68 cd "$1/etc/clamav"
69 sed -i 's/^Example/#Example/' freshclam.conf
70 status
72 # adduser clamav if needed
73 if ! grep -q "${user}:" "$1/etc/passwd"; then
74 action 'Adding user/group $user...'
75 chroot "$1/" addgroup -S $group
76 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
77 status
78 fi
80 # Enable daily.cvd updates (sometimes needed for new version)
81 #chown -R ${user}:${group} "$1/var/lib/clamav"
83 # Fix perms
84 chroot "$1/" chown -R ${user}.${group} /var/log/clamav \
85 /run/clamav /var/lib/clamav
86 }
88 # Del user clamav when pkg is removed.
89 post_remove()
90 {
91 chroot "$1/" deluser clamav
92 }