wok-stable view clamav/receipt @ rev 5801
Speedup some builds
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Jul 11 15:49:06 2010 +0200 (2010-07-11) |
parents | c32663be11f3 |
children | 820fd6180443 |
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.96.1"
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 bash"
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 /tmp -H -D -S
20 addgroup clamav
22 cd $src
23 ./configure \
24 --prefix=/usr \
25 --sysconfdir=/etc/clamav \
26 --infodir=/usr/share/info \
27 --mandir=/usr/share/man \
28 --with-iconv=no \
29 $CONFIGURE_ARGS &&
30 make -j 4 &&
31 make DESTDIR=$PWD/_pkg install
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d
38 cp -a $_pkg/usr/bin $fs/usr
39 cp -a $_pkg/usr/sbin $fs/usr
40 cp -a $_pkg/etc $fs
41 # Copy only shared lib (.so)
42 cp -a $_pkg/usr/lib/*.so* $fs/usr/lib
43 cp -a $_pkg/usr/share/clamav $fs/usr/share
44 # Copy daemon from /stuff
45 cp stuff/daemon-clamd $fs/etc/init.d/clamd
46 }
48 post_install()
49 {
50 echo "Processing post-install commands..."
52 # Enable freshclam update
53 echo -n "Enabling freshclam update..."
54 cd $1/etc/clamav
55 sed -i 's/^Example/#Example/' freshclam.conf
56 status
58 # Enable clamd configuration
59 echo -n "Enabling clamd daemon..."
60 cd $1/etc/clamav
61 sed -i 's/^Example/#Example/; s/^#PidFile/PidFile/' clamd.conf
62 status
64 # Enable local socket
65 echo -n "Enabling local socket..."
66 cd $1/etc/clamav
67 sed -i 's/^#LocalSocket /LocalSocket /' clamd.conf
68 status
70 # adduser clamav if needed
71 if ! grep -q clamav $1/etc/passwd; then
72 echo -n "Adding user clamav..."
73 chroot $1/ adduser clamav -s /bin/false -H -D -S
74 status
75 fi
77 # Enable daily.cvd updates (sometimes needed for new version)
78 chown -R clamav:clamav /usr/share/clamav
79 }
81 # Del user clamav when pkg is removed.
82 post_remove()
83 {
84 deluser clamav
85 }