wok view clamav/receipt @ rev 1340

mc: add menu entry
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Sep 01 16:17:17 2008 +0000 (2008-09-01)
parents 4a84b1fa39c3
children e4688a3bbc50
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.93.3"
5 CATEGORY="security"
6 SHORT_DESC="Antivirus"
7 MAINTAINER="paul@slitaz.org"
8 DEPENDS="gmp"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.clamav.net/"
11 WGET_URL="http://downloads.sourceforge.net/clamav/$TARBALL"
13 # Rules to configure and make the package.
14 compile_rules()
15 {
16 # Have to create clamav user/group to be able to compile
17 adduser clamav -s /bin/false -H -D -S
19 cd $src
20 ./configure \
21 --prefix=/usr \
22 --sysconfdir=/etc/clamav \
23 --infodir=/usr/share/info \
24 --mandir=/usr/share/man \
25 $CONFIGURE_ARGS
26 make
27 make DESTDIR=$PWD/_pkg 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 cp -a $_pkg/usr/bin $fs/usr
35 cp -a $_pkg/usr/sbin $fs/usr
36 cp -a $_pkg/etc $fs
37 # Copy only shared lib (.so)
38 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
39 cp -a $_pkg/usr/share/clamav $fs/usr/share
40 # Copy daemon from /stuff
41 cp stuff/daemon-clamd $fs/etc/init.d/clamd
42 }
44 post_install()
45 {
46 echo "Processing post-install commands..."
48 # Enable freshclam update
49 echo -n "Enabling freshclam update..."
50 cd $1/etc/clamav
51 sed 's/^Example/#Example/' < freshclam.conf > temp.file
52 mv temp.file freshclam.conf
53 status
55 # Enable clamd configuration
56 echo -n "Enabling clamd daemon..."
57 cd $1/etc/clamav
58 sed 's/^Example/#Example/; s/^#PidFile/PidFile/' < clamd.conf > temp.file
59 mv temp.file clamd.conf
60 status
63 # adduser clamav if needed
64 if ! grep -q clamav $1/etc/passwd; then
65 echo "Adding user clamav..."
66 chroot $1/ adduser clamav -s /bin/false -H -D -S
67 status
68 fi
69 }
71 # Del user clamav when pkg is removed.
72 post_remove()
73 {
74 deluser clamav
75 }