wok-next annotate squidguardmgr/receipt @ rev 10278

apr: Add $CONFIGURE_ARGS.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat May 21 16:29:28 2011 +0000 (2011-05-21)
parents
children 85e851d6375d
rev   line source
pascal@9982 1 # SliTaz package receipt.
pascal@9982 2
pascal@9982 3 PACKAGE="squidguardmgr"
pascal@9982 4 VERSION="1.4"
pascal@9982 5 CATEGORY="system-tools"
pascal@9982 6 SHORT_DESC="Web GUI for squidGuard and SquidClamav administration."
pascal@9982 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@9982 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@9982 9 WEB_SITE="http://squidguardmgr.sourceforge.net/"
pascal@9982 10 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
pascal@9982 11 DEPENDS="squidguard squidclamav lighttpd"
pascal@9982 12 BUILD_DEPENDS="perl squidguard squidclamav"
pascal@9982 13 CONFIG_FILES="/etc/squidguardmgr.conf"
pascal@9982 14
pascal@9982 15 # Rules to configure and make the package.
pascal@9982 16 compile_rules()
pascal@9982 17 {
pascal@9982 18 cd $src
pascal@9982 19 SQUIDUSR=99 SQUIDGRP=99 perl Makefile.PL << EOT &&
pascal@9982 20 /etc/squidGuard/squidGuard.conf
pascal@9982 21 nobody
pascal@9982 22 EOT
pascal@9982 23 sed -i 's| /| _pkg/|g' install_all.sh &&
pascal@9982 24 mkdir -p _pkg/var/www/squidguardmgr/ &&
pascal@9982 25 make install
pascal@9982 26 }
pascal@9982 27
pascal@9982 28 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@9982 29 genpkg_rules()
pascal@9982 30 {
pascal@9982 31 mkdir -p $fs/usr/share $fs/etc $fs/var/lib/squidGuard/log $fs/var/lib/squidGuard/db
pascal@9982 32 cp -a $_pkg/var/www/squidguardmgr $fs/usr/share
pascal@9982 33 ( cd $fs ; patch -p0 ) < stuff/squidguardmgr.U
pascal@9982 34 mv $fs/usr/share/squidguardmgr/squidguardmgr.conf $fs/etc
pascal@9982 35 ln -s /etc/squidguardmgr.conf $fs/usr/share/squidguardmgr/squidguardmgr.conf
pascal@9982 36 sed -i 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
pascal@9982 37 $fs/etc/squidguardmgr.conf
pascal@9982 38 }
pascal@9982 39
pascal@9982 40 post_install()
pascal@9982 41 {
pascal@9982 42 # squidguardmgr config
pascal@9982 43 chown root.www $1/etc/squidGuard/squidGuard.conf
pascal@9982 44 chmod 664 $1/etc/squidGuard/squidGuard.conf
pascal@9982 45 chown nobody.nogroup $1/usr/share/squidguardmgr/lang/* \
pascal@9982 46 $1/usr/share/squidguardmgr/lang $1/usr/share/squidguardmgr
pascal@9982 47 # Configure lighttpd server
pascal@9982 48 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@9982 49 if ! grep -q /usr/share/squidguardmgr/ $1/etc/lighttpd/lighttpd.conf; then
pascal@9982 50 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/squidguardmgr/" => "/usr/share/squidguardmgr/",|g' -i $1/etc/lighttpd/lighttpd.conf
pascal@9982 51 if [ -z "$1" ]; then
pascal@9982 52 # Start Web server.
pascal@9982 53 /etc/init.d/lighttpd stop
pascal@9982 54 /etc/init.d/lighttpd start
pascal@9982 55 fi
pascal@9982 56 fi
pascal@9982 57 fi
pascal@9982 58 # Configure apache server
pascal@9982 59 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@9982 60 if [ ! -f $1/etc/apache/conf.d/squidguardmgr ]; then
pascal@9982 61 cat > $1/etc/apache/conf.d/squidguardmgr <<EOT
pascal@9982 62 <IfModule mod_alias.c>
pascal@9982 63 Alias /squidguardmgr /usr/share/squidguardmgr
pascal@9982 64 </IfModule>
pascal@9982 65 <DirectoryMatch /usr/share/squidguardmgr/>
pascal@9982 66 Options +ExecCGI
pascal@9982 67 AddHandler cgi-script .cgi
pascal@9982 68 DirectoryIndex squidguardmgr.cgi
pascal@9982 69 Order allow,deny
pascal@9982 70 Allow from all
pascal@9982 71 </DirectoryMatch>
pascal@9982 72 EOT
pascal@9982 73 if [ -z "$1" ]; then
pascal@9982 74 # Start Web server.
pascal@9982 75 /etc/init.d/apache stop
pascal@9982 76 /etc/init.d/apache start
pascal@9982 77 fi
pascal@9982 78 fi
pascal@9982 79 fi
pascal@9982 80 }