wok-current view squidguardmgr/receipt @ rev 19510
syslinux/taziso: hide some error messages
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Nov 21 13:31:22 2016 +0100 (2016-11-21) |
parents | 3d805214d753 |
children | 46dcc80bef41 |
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 LICENSE="GPL3"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://squidguardmgr.sourceforge.net/"
11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
12 DEPENDS="squidguard squidclamav lighttpd"
13 BUILD_DEPENDS="perl squidguard "
14 CONFIG_FILES="/etc/squidguardmgr.conf"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 SQUIDUSR=squid SQUIDGRP=squid perl Makefile.PL << EOT &&
21 /etc/squidGuard/squidGuard.conf
22 nobody
23 EOT
24 mkdir -p $DESTDIR/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
33 cp -a $install/var/www/squidguardmgr $fs/usr/share
34 ( cd $fs ; patch -p0 ) < $stuff/squidguardmgr.U
35 mv $fs/usr/share/squidguardmgr/squidguardmgr.conf $fs/etc
36 ln -s /etc/squidguardmgr.conf $fs/usr/share/squidguardmgr/squidguardmgr.conf
38 sed -i -e 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
39 -e 's|SQUIDCLAMAV off|SQUIDCLAMAV on|' \
40 -e 's|SC_CONF_FILE|SC_CONF_FILE /etc/squidclamav.conf|' \
41 -e 's|C_ICAP_SOCKET|C_ICAP_SOCKET /var/run/c-icap/c-icap.ctl|' $fs/etc/squidguardmgr.conf
42 }
44 post_install()
45 {
46 # squidguardmgr config
47 chown root.www "$1/etc/squidGuard/squidGuard.conf"
48 chmod 664 "$1/etc/squidGuard/squidGuard.conf"
49 chown nobody.nogroup "$1"/usr/share/squidguardmgr/lang/* \
50 "$1/usr/share/squidguardmgr/lang" "$1/usr/share/squidguardmgr"
51 # Configure lighttpd server
52 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
53 if ! grep -q /usr/share/squidguardmgr/ "$1/etc/lighttpd/lighttpd.conf"; then
54 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/squidguardmgr/" => "/usr/share/squidguardmgr/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
55 if [ -z "$1" ]; then
56 # Start Web server.
57 /etc/init.d/lighttpd stop
58 /etc/init.d/lighttpd start
59 fi
60 fi
61 fi
62 # Configure apache server
63 if [ -f "$1/etc/apache/httpd.conf" ]; then
64 if [ ! -f "$1/etc/apache/conf.d/squidguardmgr" ]; then
65 cat > "$1/etc/apache/conf.d/squidguardmgr" <<EOT
66 <IfModule mod_alias.c>
67 Alias /squidguardmgr /usr/share/squidguardmgr
68 </IfModule>
69 <DirectoryMatch /usr/share/squidguardmgr/>
70 Options +ExecCGI
71 AddHandler cgi-script .cgi
72 DirectoryIndex squidguardmgr.cgi
73 Order allow,deny
74 Allow from all
75 </DirectoryMatch>
76 EOT
77 if [ -z "$1" ]; then
78 # Start Web server.
79 /etc/init.d/apache stop
80 /etc/init.d/apache start
81 fi
82 fi
83 fi
84 }