wok-backports diff squidclamav/receipt @ rev 48

GNU Nano - Latest Version 2.7.1
author Leonardo Laporte <hackdorte@sapo.pt>
date Wed Nov 02 22:00:58 2016 -0200 (2016-11-02)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/squidclamav/receipt	Wed Nov 02 22:00:58 2016 -0200
     1.3 @@ -0,0 +1,72 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="squidclamav"
     1.7 +VERSION="6.10"
     1.8 +CATEGORY="security"
     1.9 +SHORT_DESC="Antivirus redirector for Squid proxy."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +LICENSE="GPL3"
    1.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.13 +WEB_SITE="http://squidclamav.darold.net/"
    1.14 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.15 +CONFIG_FILES="/etc/squidclamav.conf"
    1.16 +
    1.17 +DEPENDS="squid libcurl clamav c_icap squidguard"
    1.18 +BUILD_DEPENDS="curl-dev c_icap-dev"
    1.19 +
    1.20 +# Rules to configure and make the package.
    1.21 +compile_rules()
    1.22 +{
    1.23 +	cd $src
    1.24 +	mkdir -p $DESTDIR/etc
    1.25 +	./configure \
    1.26 +		--prefix=/usr \
    1.27 +		--libdir=/usr/lib \
    1.28 +		--libexecdir=/var/www/cgi-bin \
    1.29 +		--sysconfdir=/etc \
    1.30 +		$CONFIGURE_ARGS && 
    1.31 +	make && make install
    1.32 +}
    1.33 +
    1.34 +
    1.35 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.36 +genpkg_rules()
    1.37 +{
    1.38 +	mkdir -p $fs/usr \
    1.39 +		$fs/etc/squid/conf.d
    1.40 +	
    1.41 +	cp -a $install/etc $fs
    1.42 +	cp -a $install/usr/lib $fs/usr
    1.43 +	cp -a $install/var $fs/
    1.44 +	cp -a $stuff/icap-clamav.conf $fs/etc/squid/conf.d
    1.45 +	
    1.46 +	# Customise config file
    1.47 +	sed -i -e "s|^redirect.*|redirect http://localhost/cgi-bin/squidclamav/clwarn.cgi|" \
    1.48 +		-e "s|^#squidguard.*|squidguard /usr/bin/squidGuard|" \
    1.49 +		$fs/etc/squidclamav.conf
    1.50 +		
    1.51 +	rm -f $fs/usr/lib/c_icap/*.la		
    1.52 +}
    1.53 +
    1.54 +#Post install command
    1.55 +post_install()
    1.56 +{
    1.57 +	echo 'Service squidclamav squidclamav.so' >> $1/etc/c-icap/c-icap.conf
    1.58 +	if [ -z $1 ]; then
    1.59 +		if ( ps | grep -q squid ); then
    1.60 +			/etc/init.d/squid restart
    1.61 +		fi
    1.62 +	fi
    1.63 +}
    1.64 +
    1.65 +#Post remove command
    1.66 +post_remove()
    1.67 +{
    1.68 +	sed -i -e "s/.*squidclamav.*//" $1/etc/c-icap/c-icap.conf
    1.69 +	if ( ps | grep -q squid ); then
    1.70 +		/etc/init.d/squid restart
    1.71 +	fi
    1.72 +	if ( ps | grep -q c-icap ); then
    1.73 +		/etc/init.d/c-icapd restart
    1.74 +	fi
    1.75 +}