wok view clamav/receipt @ rev 15831

clamav: fix genpkg
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jan 24 16:02:14 2014 +0000 (2014-01-24)
parents 5d0d0906801e
children 557893108cf7
line source
1 # SliTaz package receipt.
3 PACKAGE="clamav"
4 VERSION="0.97.5"
5 CATEGORY="security"
6 SHORT_DESC="Antivirus."
7 MAINTAINER="paul@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.clamav.net/"
10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
11 TAGS="antivirus"
13 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl"
14 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 # Have to create clamav user/group to be able to compile
20 adduser -s /bin/false -H -D -u 64 clamav
22 cd $src
23 ./configure \
24 --sysconfdir=/etc/clamav \
25 --with-iconv=no \
26 $CONFIGURE_ARGS &&
27 make &&
28 make DESTDIR=$DESTDIR 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 $fs/var/log/clamav $fs/var/run/clamav
36 cp -a $install/usr/bin $fs/usr
37 rm -f $fs/usr/bin/clamav-config
38 cp -a $install/usr/sbin $fs/usr
39 cp -a $install/etc $fs
40 # Copy only shared lib (.so)
41 cp -a $install/usr/lib/*.so* $fs/usr/lib
42 # Copy daemon from /$stuff
43 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
45 # Customize config
46 sed -i -e "s/^Example/#Example/" \
47 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
48 -e "s|^#PidFile.*|PidFile /var/run/clamav/clamd.pid|" \
49 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /var/run/clamav/clamd.ctl|" \
50 $fs/etc/clamav/clamd.conf
52 }
54 post_install()
55 {
57 local user
58 local group
60 user=clamav
61 group=clamav
63 echo "Processing post-install commands..."
65 # Enable freshclam update
66 echo -n "Enabling freshclam update..."
67 cd $1/etc/clamav
68 sed -i 's/^Example/#Example/' freshclam.conf
69 status
71 # adduser clamav if needed
72 if ! grep -q "${user}:" $1/etc/passwd; then
73 echo -n "Adding user/group $user..."
74 chroot $1/ addgroup -S $group
75 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
76 status
77 fi
79 # Enable daily.cvd updates (sometimes needed for new version)
80 chown -R ${user}:${group} $1/usr/share/clamav
82 # Fix perms
83 chroot $1/ chown -R ${user}.${group} /var/log/clamav \
84 /var/run/clamav
86 }
88 # Del user clamav when pkg is removed.
89 post_remove()
90 {
91 chroot "$1/" deluser clamav
92 }