wok-current view squidclamav/receipt @ rev 24295
Up ventoy (1.0.64)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jan 14 17:35:36 2022 +0000 (2022-01-14) |
parents | 40ad3dac47cb |
children | 28a7087bc745 |
line source
1 # SliTaz package receipt.
3 PACKAGE="squidclamav"
4 VERSION="6.16"
5 CATEGORY="security"
6 SHORT_DESC="Antivirus redirector for Squid proxy."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="http://squidclamav.darold.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 DEPENDS="c_icap clamav libcurl squid squidguard"
15 BUILD_DEPENDS="c_icap-dev curl-dev"
17 CONFIG_FILES="/etc/squidclamav.conf"
19 current_version()
20 {
21 wget -O - https://github.com/darold/squidclamav/releases 2>/dev/null | \
22 sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 mkdir -p $DESTDIR/etc
30 ./configure \
31 --prefix=/usr \
32 --libdir=/usr/lib \
33 --libexecdir=/var/www/cgi-bin \
34 --sysconfdir=/etc \
35 $CONFIGURE_ARGS &&
36 make &&
37 make install
38 }
40 # Rules to gen a SliTaz package suitable for Tazpkg.
41 genpkg_rules()
42 {
43 mkdir -p $fs/usr/share
44 mkdir -p $fs/etc/squid/conf.d
46 cp -a $install/etc $fs
47 cp -a $install/usr/lib $fs/usr
48 cp -a $install/usr/share/c_icap $fs/usr/share
49 cp -a $install/var $fs
50 cp -a $stuff/icap-clamav.conf $fs/etc/squid/conf.d
52 # Customise configuration file
53 sed -i -e "s|^redirect.*|redirect http://localhost/cgi-bin/squidclamav/clwarn.cgi|" \
54 -e "s|^#squidguard.*|squidguard /usr/bin/squidGuard|" \
55 $fs/etc/c-icap/squidclamav.conf
57 rm -f $fs/usr/lib/c_icap/*.la
58 }
60 #Post install command
61 post_install()
62 {
63 echo 'Service squidclamav squidclamav.so' >> "$1/etc/c-icap/c-icap.conf"
64 [ "$1" ] ||
65 if ( ps | grep -q squid )
66 then
67 /etc/init.d/squid restart
68 fi
69 }
71 #Post remove command
72 post_remove()
73 {
74 sed -i -e "s/.*squidclamav.*//" "$1/etc/c-icap/c-icap.conf"
75 [ "$1" ] ||
76 if ( ps | grep -q squid )
77 then
78 /etc/init.d/squid restart
79 fi
80 [ "$1" ] ||
81 if ( ps | grep -q c-icap )
82 then
83 /etc/init.d/c-icapd restart
84 fi
85 }