wok-next view clamav/receipt @ rev 21303
updated gujin (2.8.6 -> 2.8.7)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Dec 10 07:57:29 2019 +0100 (2019-12-10) |
parents | d5aab818505e |
children | 98b407a89e6d |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="clamav"
4 VERSION="0.101.1"
5 CATEGORY="security"
6 SHORT_DESC="Antivirus"
7 MAINTAINER="paul@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://www.clamav.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="http://www.clamav.net/downloads/production/$TARBALL"
14 BUILD_DEPENDS="bash bzip2-dev gmp gmp-dev libxml2-dev ncurses-dev
15 openssl-dev zlib-dev"
16 SPLIT="$PACKAGE-dev"
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|'
24 sed -i 's|make_pair<.*>|make_pair|' \
25 libclamav/c++/llvm/lib/ExecutionEngine/JIT/JITDebugRegisterer.cpp
26 sed -i 's|~0|~0U|g' \
27 libclamav/c++/llvm/lib/Target/X86/X86CodeEmitter.cpp \
28 libclamav/c++/llvm/lib/Target/X86/X86MCCodeEmitter.cpp
30 # Have to create clamav user/group to be able to compile
31 adduser -s /bin/false -H -D -u 64 clamav
33 ./configure \
34 --sysconfdir=/etc/clamav \
35 --with-dbdir=/var/lib/clamav \
36 --with-iconv=no \
37 $CONFIGURE_ARGS &&
38 fix libtool &&
39 make &&
40 make DESTDIR=$install install
41 }
43 genpkg_rules()
44 {
45 case $PACKAGE in
46 clamav)
47 mkdir -p $fs/usr/lib $fs/etc/init.d $fs/var/lib/clamav
48 mkdir -p $fs/var/log/clamav $fs/run/clamav
50 cp -a $install/usr/bin $fs/usr
51 rm -f $fs/usr/bin/clamav-config
52 cp -a $install/usr/sbin $fs/usr
53 cp -a $install/etc $fs
54 mv $fs/etc/clamav/clamd.conf* $fs/etc/clamav/clamd.conf
55 mv $fs/etc/clamav/freshclam.conf* $fs/etc/clamav/freshclam.conf
57 # Copy only shared libraries (.so)
58 cp -a $install/usr/lib/*.so* $fs/usr/lib
60 # Copy daemon from /$stuff
61 cp $stuff/daemon-clamd $fs/etc/init.d/clamd
63 # Customize configuration
64 sed -i -e "s/^Example/#Example/" \
65 -e "s|^#LogFile /tmp/clamd.log|LogFile /var/log/clamav/clamav.log|" \
66 -e "s|^#PidFile.*|PidFile /run/clamav/clamd.pid|" \
67 -e "s|^#LocalSocket /tmp/clamd.socket|LocalSocket /run/clamav/clamd-socket|" \
68 $fs/etc/clamav/clamd.conf
69 DEPENDS="bzip2 gmp libltdl ncurses slitaz-base-files zlib"
70 TAGS="antivirus"
71 ;;
72 *-dev)
73 copy @dev
74 ;;
75 esac
76 }
78 post_install_clamav()
79 {
80 local user=clamav
81 local group=clamav
83 # Enable freshclam update
84 echo
85 action 'Enabling freshclam update...'
86 cd "$1/etc/clamav"
87 sed -i 's/^Example/#Example/' freshclam.conf
88 status
90 # adduser clamav if needed
91 if ! grep -q "$user:" "$1/etc/passwd"
92 then
93 action 'Adding user/group $user...'
94 chroot "$1/" addgroup -S $group
95 chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
96 status
97 fi
99 # Enable daily.cvd updates (sometimes needed for new version)
100 #chown -R $user:$group "$1/var/lib/clamav"
102 # Fix permissions
103 chroot "$1/" chown -R $user.$group /var/log/clamav \
104 /run/clamav /var/lib/clamav
105 }
107 post_remove_clamav()
108 {
109 chroot "$1/" deluser clamav
110 }