wok-next view clamav/receipt @ rev 20896

dialog: up (1.3-20180621); dropbear: up (2018.76); e2fsprogs: up (1.44.3); elfutils: up (0.173); eudev: up (3.2.5); expat: up (2.2.5); fontconfig: up (2.13.0); freetype: up (2.9.1).
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Jul 20 16:59:33 2018 +0300 (2018-07-20)
parents 835b3b8ce6ac
children d5aab818505e
line source
1 # SliTaz package receipt v2.
3 PACKAGE="clamav"
4 VERSION="0.99.4"
5 CATEGORY="security"
6 SHORT_DESC="Antivirus"
7 MAINTAINER="paul@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="https://www.clamav.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="https://www.clamav.net/downloads/production/$TARBALL"
14 BUILD_DEPENDS="zlib-dev gmp gmp-dev bzip2-dev ncurses-dev bash \
15 libxml2-dev openssl-dev"
16 SPLIT="clamav-dev"
18 compile_rules() {
19 grep -rl 'alignof(' * | xargs sed -i 's|alignof(|alignof_(|'
20 grep -rl 'alignof<' * | xargs sed -i 's|alignof<|alignof_<|'
21 grep -rl '__alignof_' * | xargs sed -i 's|__alignof_|__alignof|'
22 sed -i 's|make_pair<.*>|make_pair|' libclamav/c++/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp
23 sed -i 's|~0|~0U|g' libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp \
24 libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
26 # Have to create clamav user/group to be able to compile
27 adduser -s /bin/false -H -D -u 64 clamav
29 ./configure \
30 --sysconfdir=/etc/clamav \
31 --with-dbdir=/var/lib/clamav \
32 --with-iconv=no \
33 $CONFIGURE_ARGS &&
34 fix libtool &&
35 make &&
36 make DESTDIR=$DESTDIR install
37 }
39 genpkg_rules() {
40 case $PACKAGE in
41 clamav)
42 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav \
43 $fs/var/log/clamav $fs/run/clamav
44 cp -a $install/usr/bin $fs/usr
45 rm -f $fs/usr/bin/clamav-config
46 cp -a $install/usr/sbin $fs/usr
47 cp -a $install/etc $fs
48 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf
49 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf
50 # Copy only shared lib (.so)
51 cp -a $install/usr/lib/*.so* $fs/usr/lib
52 # Copy daemon from /$stuff
53 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
55 # Customize config
56 sed -i -e "s/^Example/#Example/" \
57 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
58 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \
59 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \
60 $fs/etc/clamav/clamd.conf
61 DEPENDS="zlib gmp bzip2 slitaz-base-files ncurses libltdl"
62 TAGS="antivirus"
63 ;;
64 *-dev)
65 copy @dev
66 ;;
67 esac
68 }
70 post_install_clamav() {
71 local user=clamav
72 local group=clamav
74 # Enable freshclam update
75 echo; action 'Enabling freshclam update...'
76 cd "$1/etc/clamav"
77 sed -i 's/^Example/#Example/' freshclam.conf
78 status
80 # adduser clamav if needed
81 if ! grep -q "${user}:" "$1/etc/passwd"; then
82 action 'Adding user/group $user...'
83 chroot "$1/" addgroup -S $group
84 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
85 status
86 fi
88 # Enable daily.cvd updates (sometimes needed for new version)
89 #chown -R ${user}:${group} "$1/var/lib/clamav"
91 # Fix perms
92 chroot "$1/" chown -R $user.$group /var/log/clamav \
93 /run/clamav /var/lib/clamav
94 }
96 post_remove_clamav() {
97 chroot "$1/" deluser clamav
98 }