wok-6.x view clamav/receipt @ rev 17688

Add httping
author Paul Issott <paul@slitaz.org>
date Sun Feb 22 15:09:28 2015 +0000 (2015-02-22)
parents e43926392669
children 9e01bc6321ea
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 export LDFLAGS="$LDFLAGS -ltinfo"
21 # Have to create clamav user/group to be able to compile
22 adduser -s /bin/false -H -D -u 64 clamav
24 cd $src
25 ./configure \
26 --prefix=/usr \
27 --sysconfdir=/etc/clamav \
28 --with-dbdir=/var/lib/clamav \
29 --with-iconv=no \
30 $CONFIGURE_ARGS &&
31 make &&
32 make DESTDIR=$DESTDIR install
33 }
35 # Rules to gen a SliTaz package suitable for Tazpkg.
36 genpkg_rules()
37 {
38 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \
39 $fs/var/log/clamav $fs/run/clamav
40 cp -a $install/usr/bin $fs/usr
41 rm -f $fs/usr/bin/clamav-config
42 cp -a $install/usr/sbin $fs/usr
43 cp -a $install/etc $fs
44 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf
45 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf
46 # Copy only shared lib (.so)
47 cp -a $install/usr/lib/*.so* $fs/usr/lib
48 # Copy daemon from /$stuff
49 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
51 # Customize config
52 sed -i -e "s/^Example/#Example/" \
53 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
54 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \
55 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \
56 $fs/etc/clamav/clamd.conf
58 }
60 post_install()
61 {
63 local user
64 local group
66 user=clamav
67 group=clamav
69 echo "Processing post-install commands..."
71 # Enable freshclam update
72 echo -n "Enabling freshclam update..."
73 cd $1/etc/clamav
74 sed -i 's/^Example/#Example/' freshclam.conf
75 status
77 # adduser clamav if needed
78 if ! grep -q "${user}:" $1/etc/passwd; then
79 echo -n "Adding user/group $user..."
80 chroot $1/ addgroup -S $group
81 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
82 status
83 fi
85 # Enable daily.cvd updates (sometimes needed for new version)
86 #chown -R ${user}:${group} $1/var/lib/clamav
88 # Fix perms
89 chroot $1/ chown -R ${user}.${group} /var/log/clamav \
90 /run/clamav /var/lib/clamav
92 }
94 # Del user clamav when pkg is removed.
95 post_remove()
96 {
97 chroot "$1/" deluser clamav
98 }