wok-4.x view clamav/receipt @ rev 1341

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