wok-4.x diff squidguard/receipt @ rev 2969

ecore: add missing links
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 09 23:49:48 2009 +0200 (2009-05-09)
parents bd6010223726
children 07514ab2c2fc
line diff
     1.1 --- a/squidguard/receipt	Tue Dec 23 10:31:12 2008 +0000
     1.2 +++ b/squidguard/receipt	Sat May 09 23:49:48 2009 +0200
     1.3 @@ -17,18 +17,18 @@
     1.4  {
     1.5  	cd $src
     1.6  	./configure --prefix=/usr --infodir=/usr/share/info \
     1.7 -	--sysconfdir=/etc --with-sg-config=/etc/squid/squidGuard.conf \
     1.8 +	--sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \
     1.9  	--with-sg-logdir=/var/lib/squidGuard/log \
    1.10  	--with-sg-dbhome=/var/lib/squidGuard/db \
    1.11  	--mandir=/usr/share/man $CONFIGURE_ARGS
    1.12  	make
    1.13  	sed -e 's|^prefix =.*|prefix = _pkg/usr|' \
    1.14  	    -e 's|^logdir =.*|logdir = _pkg/var/lib/squidGuard/log|' \
    1.15 -	    -e 's|^configfile =.*|configfile = _pkg/etc/squid/squidGuard.conf|' \
    1.16 +	    -e 's|^configfile =.*|configfile = _pkg/etc/squidGuard/squidGuard.conf|' \
    1.17  	    -e 's|^dbhomedir =.*|dbhomedir = _pkg/var/lib/squidGuard/db|' \
    1.18 -	    -e 's|^SQUIDUSER =.*|SQUIDUSER = root|' \
    1.19 +	    -e 's|^SQUIDUSER =.*|SQUIDUSER = nobody|' \
    1.20  	    < Makefile > Makefile.slitaz-install
    1.21 -	mkdir -p _pkg/etc/squid
    1.22 +	mkdir -p _pkg/etc/squidGuard
    1.23  	make -f Makefile.slitaz-install install
    1.24  }
    1.25  
    1.26 @@ -41,11 +41,23 @@
    1.27  # Pre and post install commands for Tazpkg.
    1.28  post_install()
    1.29  {
    1.30 -	chown -R nobody /var/lib/squidGuard/* /usr/squidGuard
    1.31 -	if ! grep ^redirect_program $1/etc/squid/squid.conf ; then
    1.32 +	chown -R nobody $1/var/lib/squidGuard/* $1/usr/squidGuard
    1.33 +	if ! grep -q ^redirect_program $1/etc/squid/squid.conf ; then
    1.34  		echo "Updating /etc/squid/squid.conf"
    1.35  		cat >> $1/etc/squid/squid.conf <<EOF
    1.36 -redirect_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf
    1.37 +redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf
    1.38  EOF
    1.39 +		# Restart squid if running
    1.40 +		$(which squid) -k reconfigure 2> /dev/null
    1.41  	fi
    1.42  }
    1.43 +
    1.44 +post_remove()
    1.45 +{
    1.46 +	if grep -q "squidGuard" 	/etc/squid/squid.conf ; then
    1.47 +		echo "Updating /etc/squid/squid.conf"
    1.48 +		sed -i -e "s/.*squidGuard.*//" /etc/squid/squid.conf
    1.49 +		# Restart squid if running
    1.50 +		$(which squid) -k reconfigure 2> /dev/null
    1.51 +	fi
    1.52 +}