wok-next view clamav/receipt @ rev 20334

Remove linux-uml & lxpanel-plugin-multiload
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 16 16:28:30 2017 +0100 (2017-11-16)
parents d6ca18366f41
children a7b1395df64a
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 grep -rl 'alignof(' * | xargs sed -i 's|alignof(|alignof_(|'
21 grep -rl 'alignof<' * | xargs sed -i 's|alignof<|alignof_<|'
22 grep -rl '__alignof_' * | xargs sed -i 's|__alignof_|__alignof|'
23 sed -i 's|make_pair<.*>|make_pair|' libclamav/c++/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp
24 sed -i 's|~0|~0U|g' libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp \
25 libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
27 # Have to create clamav user/group to be able to compile
28 adduser -s /bin/false -H -D -u 64 clamav
30 ./configure \
31 --prefix=/usr \
32 --sysconfdir=/etc/clamav \
33 --with-dbdir=/var/lib/clamav \
34 --with-iconv=no \
35 $CONFIGURE_ARGS &&
36 make &&
37 make DESTDIR=$DESTDIR install
38 }
40 # Rules to gen a SliTaz package suitable for Tazpkg.
41 genpkg_rules()
42 {
43 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \
44 $fs/var/log/clamav $fs/run/clamav
45 cp -a $install/usr/bin $fs/usr
46 rm -f $fs/usr/bin/clamav-config
47 cp -a $install/usr/sbin $fs/usr
48 cp -a $install/etc $fs
49 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf
50 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf
51 # Copy only shared lib (.so)
52 cp -a $install/usr/lib/*.so* $fs/usr/lib
53 # Copy daemon from /$stuff
54 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
56 # Customize config
57 sed -i -e "s/^Example/#Example/" \
58 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
59 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \
60 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \
61 $fs/etc/clamav/clamd.conf
63 }
65 post_install()
66 {
67 local user=clamav
68 local group=clamav
70 # Enable freshclam update
71 echo; action 'Enabling freshclam update...'
72 cd "$1/etc/clamav"
73 sed -i 's/^Example/#Example/' freshclam.conf
74 status
76 # adduser clamav if needed
77 if ! grep -q "${user}:" "$1/etc/passwd"; then
78 action 'Adding user/group $user...'
79 chroot "$1/" addgroup -S $group
80 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
81 status
82 fi
84 # Enable daily.cvd updates (sometimes needed for new version)
85 #chown -R ${user}:${group} "$1/var/lib/clamav"
87 # Fix perms
88 chroot "$1/" chown -R ${user}.${group} /var/log/clamav \
89 /run/clamav /var/lib/clamav
90 }
92 # Del user clamav when pkg is removed.
93 post_remove()
94 {
95 chroot "$1/" deluser clamav
96 }