wok view clamav/receipt @ rev 15821

Up: bazaar-tools to 2.6.0.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Jan 24 07:06:27 2014 +0000 (2014-01-24)
parents af696f5ac1e7
children 5d0d0906801e
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.97.3"
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="$SF_MIRROR/$PACKAGE/$TARBALL"
12 TAGS="antivirus"
14 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl"
15 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 # Have to create clamav user/group to be able to compile
21 adduser -s /bin/false -H -D clamav
23 cd $src
24 ./configure \
25 --sysconfdir=/etc/clamav \
26 --with-iconv=no \
27 $CONFIGURE_ARGS && make && make install
28 }
30 # Rules to gen a SliTaz package suitable for Tazpkg.
31 genpkg_rules()
32 {
33 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d \
34 $fs/var/log/clamav $fs/var/run/clamav
35 cp -a $install/usr/bin $fs/usr
36 cp -a $install/usr/sbin $fs/usr
37 cp -a $install/etc $fs
38 # Copy only shared lib (.so)
39 cp -a $install/usr/lib/*.so* $fs/usr/lib
40 cp -a $install/usr/share/clamav $fs/usr/share
41 # Copy daemon from /$stuff
42 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
44 # Customize config
45 sed -i -e "s/^Example/#Example/" \
46 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
47 -e "s|^#PidFile.*|PidFile /var/run/clamav/clamd.pid|" \
48 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /var/run/clamav/clamd.ctl|" \
49 $fs/etc/clamav/clamd.conf
51 }
53 post_install()
54 {
56 local user
57 local group
59 user=clamav
60 group=clamav
62 echo "Processing post-install commands..."
64 # Enable freshclam update
65 echo -n "Enabling freshclam update..."
66 cd $1/etc/clamav
67 sed -i 's/^Example/#Example/' freshclam.conf
68 status
70 # adduser clamav if needed
71 if ! grep -q "${user}:" $1/etc/passwd; then
72 echo -n "Adding user/group $user..."
73 chroot $1/ addgroup -S $group
74 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
75 status
76 fi
78 # Enable daily.cvd updates (sometimes needed for new version)
79 chown -R ${user}:${group} $1/usr/share/clamav
81 # Fix perms
82 chroot $1/ chown -R ${user}.${group} /var/log/clamav \
83 /var/run/clamav
85 }
87 # Del user clamav when pkg is removed.
88 post_remove()
89 {
90 chroot "$1/" deluser clamav
91 }