wok-next view clamav/receipt @ rev 16799

Fix some missing icons (alsamixer, nanochess)
author Paul Issott <paul@slitaz.org>
date Fri Jul 04 13:41:24 2014 +0100 (2014-07-04)
parents b97997359190
children 17e313b5b9c1
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.98.1"
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 -u 64 clamav
23 cd $src
24 ./configure \
25 --prefix=/usr \
26 --sysconfdir=/etc/clamav \
27 --with-dbdir=/var/lib/clamav \
28 --with-iconv=no \
29 $CONFIGURE_ARGS &&
30 make &&
31 make DESTDIR=$DESTDIR install
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \
38 $fs/var/log/clamav $fs/run/clamav
39 cp -a $install/usr/bin $fs/usr
40 rm -f $fs/usr/bin/clamav-config
41 cp -a $install/usr/sbin $fs/usr
42 cp -a $install/etc $fs
43 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf
44 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf
45 # Copy only shared lib (.so)
46 cp -a $install/usr/lib/*.so* $fs/usr/lib
47 # Copy daemon from /$stuff
48 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
50 # Customize config
51 sed -i -e "s/^Example/#Example/" \
52 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
53 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \
54 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \
55 $fs/etc/clamav/clamd.conf
57 }
59 post_install()
60 {
62 local user
63 local group
65 user=clamav
66 group=clamav
68 echo "Processing post-install commands..."
70 # Enable freshclam update
71 echo -n "Enabling freshclam update..."
72 cd $1/etc/clamav
73 sed -i 's/^Example/#Example/' freshclam.conf
74 status
76 # adduser clamav if needed
77 if ! grep -q "${user}:" $1/etc/passwd; then
78 echo -n "Adding user/group $user..."
79 chroot $1/ addgroup -S $group
80 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
81 status
82 fi
84 # Enable daily.cvd updates (sometimes needed for new version)
85 #chown -R ${user}:${group} $1/var/lib/clamav
87 # Fix perms
88 chroot $1/ chown -R ${user}.${group} /var/log/clamav \
89 /run/clamav /var/lib/clamav
91 }
93 # Del user clamav when pkg is removed.
94 post_remove()
95 {
96 chroot "$1/" deluser clamav
97 }