wok diff squidguardmgr/receipt @ rev 10111

Up: postfixadmin to 2.3.3.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri May 20 15:31:35 2011 +0000 (2011-05-20)
parents
children 85e851d6375d
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/squidguardmgr/receipt	Fri May 20 15:31:35 2011 +0000
     1.3 @@ -0,0 +1,80 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="squidguardmgr"
     1.7 +VERSION="1.4"
     1.8 +CATEGORY="system-tools"
     1.9 +SHORT_DESC="Web GUI for squidGuard and SquidClamav administration."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.12 +WEB_SITE="http://squidguardmgr.sourceforge.net/"
    1.13 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
    1.14 +DEPENDS="squidguard squidclamav lighttpd"
    1.15 +BUILD_DEPENDS="perl squidguard squidclamav"
    1.16 +CONFIG_FILES="/etc/squidguardmgr.conf"
    1.17 +
    1.18 +# Rules to configure and make the package.
    1.19 +compile_rules()
    1.20 +{
    1.21 +	cd $src
    1.22 +	SQUIDUSR=99 SQUIDGRP=99 perl Makefile.PL << EOT &&
    1.23 +/etc/squidGuard/squidGuard.conf
    1.24 +nobody
    1.25 +EOT
    1.26 +	sed -i 's| /| _pkg/|g' install_all.sh &&
    1.27 +	mkdir -p _pkg/var/www/squidguardmgr/ &&
    1.28 +	make install
    1.29 +}
    1.30 +
    1.31 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.32 +genpkg_rules()
    1.33 +{
    1.34 +	mkdir -p $fs/usr/share $fs/etc $fs/var/lib/squidGuard/log $fs/var/lib/squidGuard/db
    1.35 +	cp -a $_pkg/var/www/squidguardmgr $fs/usr/share
    1.36 +	( cd $fs ; patch -p0 ) < stuff/squidguardmgr.U
    1.37 +	mv $fs/usr/share/squidguardmgr/squidguardmgr.conf $fs/etc
    1.38 +	ln -s /etc/squidguardmgr.conf $fs/usr/share/squidguardmgr/squidguardmgr.conf
    1.39 +	sed -i 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
    1.40 +		$fs/etc/squidguardmgr.conf
    1.41 +}
    1.42 +
    1.43 +post_install()
    1.44 +{
    1.45 +	# squidguardmgr config
    1.46 +	chown root.www $1/etc/squidGuard/squidGuard.conf
    1.47 +	chmod 664 $1/etc/squidGuard/squidGuard.conf
    1.48 +	chown nobody.nogroup $1/usr/share/squidguardmgr/lang/* \
    1.49 +		$1/usr/share/squidguardmgr/lang $1/usr/share/squidguardmgr
    1.50 +	# Configure lighttpd server
    1.51 +	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    1.52 +		if ! grep -q /usr/share/squidguardmgr/ $1/etc/lighttpd/lighttpd.conf; then
    1.53 +	    		sed -e 's|.*"/examples/" => "/usr/share/examples/",|    "/examples/" => "/usr/share/examples/",\n    "/squidguardmgr/" => "/usr/share/squidguardmgr/",|g' -i $1/etc/lighttpd/lighttpd.conf
    1.54 +			if [ -z "$1" ]; then
    1.55 +				# Start Web server.
    1.56 +				/etc/init.d/lighttpd stop
    1.57 +				/etc/init.d/lighttpd start
    1.58 +			fi
    1.59 +		fi
    1.60 +	fi
    1.61 +	# Configure apache server
    1.62 +	if [ -f $1/etc/apache/httpd.conf ]; then
    1.63 +		if [ ! -f $1/etc/apache/conf.d/squidguardmgr ]; then
    1.64 +			cat > $1/etc/apache/conf.d/squidguardmgr <<EOT
    1.65 +<IfModule mod_alias.c>
    1.66 +    Alias /squidguardmgr /usr/share/squidguardmgr
    1.67 +</IfModule>
    1.68 +<DirectoryMatch /usr/share/squidguardmgr/>
    1.69 +    Options +ExecCGI
    1.70 +    AddHandler cgi-script .cgi
    1.71 +    DirectoryIndex squidguardmgr.cgi
    1.72 +    Order allow,deny
    1.73 +    Allow from all
    1.74 +</DirectoryMatch>
    1.75 +EOT
    1.76 +			if [ -z "$1" ]; then
    1.77 +				# Start Web server.
    1.78 +				/etc/init.d/apache stop
    1.79 +				/etc/init.d/apache start
    1.80 +			fi
    1.81 +		fi
    1.82 +	fi
    1.83 +}