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