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