wok-backports annotate squidclamav/receipt @ rev 25

Add: squid*
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Mon Mar 03 23:33:10 2014 +0100 (2014-03-03)
parents
children
rev   line source
erjo@25 1 # SliTaz package receipt.
erjo@25 2
erjo@25 3 PACKAGE="squidclamav"
erjo@25 4 VERSION="6.10"
erjo@25 5 CATEGORY="security"
erjo@25 6 SHORT_DESC="Antivirus redirector for Squid proxy."
erjo@25 7 MAINTAINER="pascal.bellard@slitaz.org"
erjo@25 8 LICENSE="GPL3"
erjo@25 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
erjo@25 10 WEB_SITE="http://squidclamav.darold.net/"
erjo@25 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
erjo@25 12 CONFIG_FILES="/etc/squidclamav.conf"
erjo@25 13
erjo@25 14 DEPENDS="squid libcurl clamav c_icap squidguard"
erjo@25 15 BUILD_DEPENDS="curl-dev c_icap-dev"
erjo@25 16
erjo@25 17 # Rules to configure and make the package.
erjo@25 18 compile_rules()
erjo@25 19 {
erjo@25 20 cd $src
erjo@25 21 mkdir -p $DESTDIR/etc
erjo@25 22 ./configure \
erjo@25 23 --prefix=/usr \
erjo@25 24 --libdir=/usr/lib \
erjo@25 25 --libexecdir=/var/www/cgi-bin \
erjo@25 26 --sysconfdir=/etc \
erjo@25 27 $CONFIGURE_ARGS &&
erjo@25 28 make && make install
erjo@25 29 }
erjo@25 30
erjo@25 31
erjo@25 32 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@25 33 genpkg_rules()
erjo@25 34 {
erjo@25 35 mkdir -p $fs/usr \
erjo@25 36 $fs/etc/squid/conf.d
erjo@25 37
erjo@25 38 cp -a $install/etc $fs
erjo@25 39 cp -a $install/usr/lib $fs/usr
erjo@25 40 cp -a $install/var $fs/
erjo@25 41 cp -a $stuff/icap-clamav.conf $fs/etc/squid/conf.d
erjo@25 42
erjo@25 43 # Customise config file
erjo@25 44 sed -i -e "s|^redirect.*|redirect http://localhost/cgi-bin/squidclamav/clwarn.cgi|" \
erjo@25 45 -e "s|^#squidguard.*|squidguard /usr/bin/squidGuard|" \
erjo@25 46 $fs/etc/squidclamav.conf
erjo@25 47
erjo@25 48 rm -f $fs/usr/lib/c_icap/*.la
erjo@25 49 }
erjo@25 50
erjo@25 51 #Post install command
erjo@25 52 post_install()
erjo@25 53 {
erjo@25 54 echo 'Service squidclamav squidclamav.so' >> $1/etc/c-icap/c-icap.conf
erjo@25 55 if [ -z $1 ]; then
erjo@25 56 if ( ps | grep -q squid ); then
erjo@25 57 /etc/init.d/squid restart
erjo@25 58 fi
erjo@25 59 fi
erjo@25 60 }
erjo@25 61
erjo@25 62 #Post remove command
erjo@25 63 post_remove()
erjo@25 64 {
erjo@25 65 sed -i -e "s/.*squidclamav.*//" $1/etc/c-icap/c-icap.conf
erjo@25 66 if ( ps | grep -q squid ); then
erjo@25 67 /etc/init.d/squid restart
erjo@25 68 fi
erjo@25 69 if ( ps | grep -q c-icap ); then
erjo@25 70 /etc/init.d/c-icapd restart
erjo@25 71 fi
erjo@25 72 }