wok view 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
line source
1 # SliTaz package receipt.
3 PACKAGE="squidguardmgr"
4 VERSION="1.12"
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 "
13 CONFIG_FILES="/etc/squidguardmgr.conf"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 SQUIDUSR=squid SQUIDGRP=squid perl Makefile.PL << EOT &&
20 /etc/squidGuard/squidGuard.conf
21 nobody
22 EOT
23 mkdir -p $DESTDIR/var/www/squidguardmgr/ &&
24 make install
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 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
37 sed -i -e 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
38 -e 's|SQUIDCLAMAV off|SQUIDCLAMAV on|' \
39 -e 's|SC_CONF_FILE|SC_CONF_FILE /etc/squidclamav.conf|' \
40 -e 's|C_ICAP_SOCKET|C_ICAP_SOCKET /var/run/c-icap/c-icap.ctl|' $fs/etc/squidguardmgr.conf
41 }
43 post_install()
44 {
45 # squidguardmgr config
46 chown root.www $1/etc/squidGuard/squidGuard.conf
47 chmod 664 $1/etc/squidGuard/squidGuard.conf
48 chown nobody.nogroup $1/usr/share/squidguardmgr/lang/* \
49 $1/usr/share/squidguardmgr/lang $1/usr/share/squidguardmgr
50 # Configure lighttpd server
51 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
52 if ! grep -q /usr/share/squidguardmgr/ $1/etc/lighttpd/lighttpd.conf; then
53 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/squidguardmgr/" => "/usr/share/squidguardmgr/",|g' -i $1/etc/lighttpd/lighttpd.conf
54 if [ -z "$1" ]; then
55 # Start Web server.
56 /etc/init.d/lighttpd stop
57 /etc/init.d/lighttpd start
58 fi
59 fi
60 fi
61 # Configure apache server
62 if [ -f $1/etc/apache/httpd.conf ]; then
63 if [ ! -f $1/etc/apache/conf.d/squidguardmgr ]; then
64 cat > $1/etc/apache/conf.d/squidguardmgr <<EOT
65 <IfModule mod_alias.c>
66 Alias /squidguardmgr /usr/share/squidguardmgr
67 </IfModule>
68 <DirectoryMatch /usr/share/squidguardmgr/>
69 Options +ExecCGI
70 AddHandler cgi-script .cgi
71 DirectoryIndex squidguardmgr.cgi
72 Order allow,deny
73 Allow from all
74 </DirectoryMatch>
75 EOT
76 if [ -z "$1" ]; then
77 # Start Web server.
78 /etc/init.d/apache stop
79 /etc/init.d/apache start
80 fi
81 fi
82 fi
83 }