wok view clamav/receipt @ rev 15826

Up: clamav to 0.97.5.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Jan 24 10:27:10 2014 +0000 (2014-01-24)
parents 7896f0694ef6
children 65eeddf9a0a0
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.97.5"
5 CATEGORY="security"
6 SHORT_DESC="Antivirus."
7 MAINTAINER="paul@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.clamav.net/"
10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
11 TAGS="antivirus"
13 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl"
14 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 # Have to create clamav user/group to be able to compile
20 adduser -s /bin/false -H -D -u 64 clamav
22 cd $src
23 ./configure \
24 --sysconfdir=/etc/clamav \
25 --with-iconv=no \
26 $CONFIGURE_ARGS &&
27 make &&
28 make DESTDIR=$DESTDIR install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d \
35 $fs/var/log/clamav $fs/var/run/clamav
36 cp -a $install/usr/bin $fs/usr
37 rm -f $fs/usr/bin/clamav-config
38 cp -a $install/usr/sbin $fs/usr
39 cp -a $install/etc $fs
40 # Copy only shared lib (.so)
41 cp -a $install/usr/lib/*.so* $fs/usr/lib
42 cp -a $install/usr/share/clamav $fs/usr/share
43 # Copy daemon from /$stuff
44 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
46 # Customize config
47 sed -i -e "s/^Example/#Example/" \
48 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
49 -e "s|^#PidFile.*|PidFile /var/run/clamav/clamd.pid|" \
50 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /var/run/clamav/clamd.ctl|" \
51 $fs/etc/clamav/clamd.conf
53 }
55 post_install()
56 {
58 local user
59 local group
61 user=clamav
62 group=clamav
64 echo "Processing post-install commands..."
66 # Enable freshclam update
67 echo -n "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 echo -n "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/usr/share/clamav
83 # Fix perms
84 chroot $1/ chown -R ${user}.${group} /var/log/clamav \
85 /var/run/clamav
87 }
89 # Del user clamav when pkg is removed.
90 post_remove()
91 {
92 chroot "$1/" deluser clamav
93 }