wok-current view clamav/receipt @ rev 4974

add/improve TAGS u* receipts
author Rohit Joshi <jozee@slitaz.org>
date Wed Feb 24 12:19:54 2010 +0000 (2010-02-24)
parents 90e89069273c
children 67f6c0034b6a
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.95.3"
5 CATEGORY="security"
6 SHORT_DESC="Antivirus."
7 MAINTAINER="paul@slitaz.org"
8 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses"
9 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://www.clamav.net/"
12 WGET_URL="http://downloads.sourceforge.net/clamav/$TARBALL"
13 TAGS="antivirus"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 # Have to create clamav user/group to be able to compile
19 adduser clamav -s /bin/false -H -D -S
21 cd $src
22 ./configure \
23 --prefix=/usr \
24 --sysconfdir=/etc/clamav \
25 --infodir=/usr/share/info \
26 --mandir=/usr/share/man \
27 --with-iconv=no \
28 $CONFIGURE_ARGS &&
29 make &&
30 make DESTDIR=$PWD/_pkg install
31 }
33 # Rules to gen a SliTaz package suitable for Tazpkg.
34 genpkg_rules()
35 {
36 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d
37 cp -a $_pkg/usr/bin $fs/usr
38 cp -a $_pkg/usr/sbin $fs/usr
39 cp -a $_pkg/etc $fs
40 # Copy only shared lib (.so)
41 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
42 cp -a $_pkg/usr/share/clamav $fs/usr/share
43 # Copy daemon from /stuff
44 cp stuff/daemon-clamd $fs/etc/init.d/clamd
45 }
47 post_install()
48 {
49 echo "Processing post-install commands..."
51 # Enable freshclam update
52 echo -n "Enabling freshclam update..."
53 cd $1/etc/clamav
54 sed 's/^Example/#Example/' < freshclam.conf > temp.file
55 mv temp.file freshclam.conf
56 status
58 # Enable clamd configuration
59 echo -n "Enabling clamd daemon..."
60 cd $1/etc/clamav
61 sed 's/^Example/#Example/; s/^#PidFile/PidFile/' < clamd.conf > temp.file
62 mv temp.file clamd.conf
63 status
65 # adduser clamav if needed
66 if ! grep -q clamav $1/etc/passwd; then
67 echo -n "Adding user clamav..."
68 chroot $1/ adduser clamav -s /bin/false -H -D -S
69 status
70 fi
72 # Enable daily.cvd updates (sometimes needed for new version)
73 chown -R clamav:clamav /usr/share/clamav
74 }
76 # Del user clamav when pkg is removed.
77 post_remove()
78 {
79 deluser clamav
80 }