wok-current view clamav/receipt @ rev 16080
ARM: xorg-server-light use same vers than main xorg
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Mar 15 13:11:09 2014 +0100 (2014-03-15) |
parents | 557893108cf7 |
children | e43926392669 |
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 # Have to create clamav user/group to be able to compile
21 adduser -s /bin/false -H -D -u 64 clamav
23 cd $src
24 ./configure \
25 --sysconfdir=/etc/clamav \
26 --with-iconv=no \
27 $CONFIGURE_ARGS &&
28 make &&
29 make DESTDIR=$DESTDIR install
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p $fs/usr/lib $fs/usr/share $fs/etc/init.d \
36 $fs/var/log/clamav $fs/var/run/clamav
37 cp -a $install/usr/bin $fs/usr
38 rm -f $fs/usr/bin/clamav-config
39 cp -a $install/usr/sbin $fs/usr
40 cp -a $install/etc $fs
41 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf
42 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf
43 # Copy only shared lib (.so)
44 cp -a $install/usr/lib/*.so* $fs/usr/lib
45 # Copy daemon from /$stuff
46 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
48 # Customize config
49 sed -i -e "s/^Example/#Example/" \
50 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
51 -e "s|^#PidFile.*|PidFile /var/run/clamav/clamd.pid|" \
52 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /var/run/clamav/clamd.ctl|" \
53 $fs/etc/clamav/clamd.conf
55 }
57 post_install()
58 {
60 local user
61 local group
63 user=clamav
64 group=clamav
66 echo "Processing post-install commands..."
68 # Enable freshclam update
69 echo -n "Enabling freshclam update..."
70 cd $1/etc/clamav
71 sed -i 's/^Example/#Example/' freshclam.conf
72 status
74 # adduser clamav if needed
75 if ! grep -q "${user}:" $1/etc/passwd; then
76 echo -n "Adding user/group $user..."
77 chroot $1/ addgroup -S $group
78 chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
79 status
80 fi
82 # Enable daily.cvd updates (sometimes needed for new version)
83 chown -R ${user}:${group} $1/usr/share/clamav
85 # Fix perms
86 chroot $1/ chown -R ${user}.${group} /var/log/clamav \
87 /var/run/clamav
89 }
91 # Del user clamav when pkg is removed.
92 post_remove()
93 {
94 chroot "$1/" deluser clamav
95 }