wok annotate squidguardmgr/receipt @ rev 14975

Up: thunderbird (17.0.8esr)
author Dominique Corbex <domcox@slitaz.org>
date Thu Aug 08 22:20:49 2013 +0200 (2013-08-08)
parents 01713aa1a5bf
children 3d805214d753
rev   line source
pascal@9982 1 # SliTaz package receipt.
pascal@9982 2
pascal@9982 3 PACKAGE="squidguardmgr"
erjo@14814 4 VERSION="1.12"
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"
erjo@14814 12 BUILD_DEPENDS="perl squidguard "
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
erjo@14814 19 SQUIDUSR=squid SQUIDGRP=squid perl Makefile.PL << EOT &&
pascal@9982 20 /etc/squidGuard/squidGuard.conf
pascal@9982 21 nobody
pascal@9982 22 EOT
pascal@10483 23 mkdir -p $DESTDIR/var/www/squidguardmgr/ &&
pascal@9982 24 make install
pascal@9982 25 }
pascal@9982 26
pascal@9982 27 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@9982 28 genpkg_rules()
pascal@9982 29 {
erjo@14814 30 mkdir -p $fs/usr/share $fs/etc $fs/var/lib/squidGuard/log $fs/var/lib/squidGuard/db
erjo@14814 31
pascal@9982 32 cp -a $_pkg/var/www/squidguardmgr $fs/usr/share
erjo@14814 33 ( cd $fs ; patch -p0 ) < $stuff/squidguardmgr.U
erjo@14814 34 mv $fs/usr/share/squidguardmgr/squidguardmgr.conf $fs/etc
pascal@9982 35 ln -s /etc/squidguardmgr.conf $fs/usr/share/squidguardmgr/squidguardmgr.conf
erjo@14814 36
erjo@14814 37 sed -i -e 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
erjo@14814 38 -e 's|SQUIDCLAMAV off|SQUIDCLAMAV on|' \
erjo@14814 39 -e 's|SC_CONF_FILE|SC_CONF_FILE /etc/squidclamav.conf|' \
erjo@14814 40 -e 's|C_ICAP_SOCKET|C_ICAP_SOCKET /var/run/c-icap/c-icap.ctl|' $fs/etc/squidguardmgr.conf
pascal@9982 41 }
pascal@9982 42
pascal@9982 43 post_install()
pascal@9982 44 {
pascal@9982 45 # squidguardmgr config
pascal@9982 46 chown root.www $1/etc/squidGuard/squidGuard.conf
pascal@9982 47 chmod 664 $1/etc/squidGuard/squidGuard.conf
pascal@9982 48 chown nobody.nogroup $1/usr/share/squidguardmgr/lang/* \
pascal@9982 49 $1/usr/share/squidguardmgr/lang $1/usr/share/squidguardmgr
pascal@9982 50 # Configure lighttpd server
pascal@9982 51 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@9982 52 if ! grep -q /usr/share/squidguardmgr/ $1/etc/lighttpd/lighttpd.conf; then
pascal@9982 53 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 54 if [ -z "$1" ]; then
pascal@9982 55 # Start Web server.
pascal@9982 56 /etc/init.d/lighttpd stop
pascal@9982 57 /etc/init.d/lighttpd start
pascal@9982 58 fi
pascal@9982 59 fi
pascal@9982 60 fi
pascal@9982 61 # Configure apache server
pascal@9982 62 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@9982 63 if [ ! -f $1/etc/apache/conf.d/squidguardmgr ]; then
pascal@9982 64 cat > $1/etc/apache/conf.d/squidguardmgr <<EOT
pascal@9982 65 <IfModule mod_alias.c>
pascal@9982 66 Alias /squidguardmgr /usr/share/squidguardmgr
pascal@9982 67 </IfModule>
pascal@9982 68 <DirectoryMatch /usr/share/squidguardmgr/>
pascal@9982 69 Options +ExecCGI
pascal@9982 70 AddHandler cgi-script .cgi
pascal@9982 71 DirectoryIndex squidguardmgr.cgi
pascal@9982 72 Order allow,deny
pascal@9982 73 Allow from all
pascal@9982 74 </DirectoryMatch>
pascal@9982 75 EOT
pascal@9982 76 if [ -z "$1" ]; then
pascal@9982 77 # Start Web server.
pascal@9982 78 /etc/init.d/apache stop
pascal@9982 79 /etc/init.d/apache start
pascal@9982 80 fi
pascal@9982 81 fi
pascal@9982 82 fi
pascal@9982 83 }