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