wok view squidguardmgr/receipt @ rev 25439

Up xz (5.2.6)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Sep 01 16:28:38 2022 +0000 (21 months ago)
parents 46dcc80bef41
children ad0bc3efbf37
line source
1 # SliTaz package receipt.
3 PACKAGE="squidguardmgr"
4 VERSION="1.14"
5 CATEGORY="system-tools"
6 SHORT_DESC="Web GUI for squidGuard and SquidClamav administration."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL3"
9 WEB_SITE="https://sourceforge.net/projects/squidguardmgr/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
14 DEPENDS="squidguard squidclamav lighttpd"
15 BUILD_DEPENDS="perl squidguard "
17 CONFIG_FILES="/etc/squidguardmgr.conf"
19 current_version()
20 {
21 wget -O - $WEB_SITE 2>/dev/null | \
22 sed '/tar.gz/!d;s|.*mgr-||;s|.tar.*||'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 SQUIDUSR=squid SQUIDGRP=squid perl Makefile.PL << EOT &&
29 /etc/squidGuard/squidGuard.conf
30 nobody
31 EOT
32 mkdir -p $DESTDIR/var/www/squidguardmgr/ &&
33 make install
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/usr/share
40 mkdir -p $fs/etc
41 mkdir -p $fs/var/lib/squidGuard/log
42 mkdir -p $fs/var/lib/squidGuard/db
44 cp -a $install/var/www/squidguardmgr $fs/usr/share
45 # 1.14 unsuitable
46 # ( cd $fs ; patch -p0 ) < $stuff/squidguardmgr.U
47 mv $fs/usr/share/squidguardmgr/squidguardmgr.conf $fs/etc
48 ln -s /etc/squidguardmgr.conf $fs/usr/share/squidguardmgr/squidguardmgr.conf
50 sed -i -e 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
51 -e 's|SQUIDCLAMAV off|SQUIDCLAMAV on|' \
52 -e 's|SC_CONF_FILE|SC_CONF_FILE /etc/squidclamav.conf|' \
53 -e 's|C_ICAP_SOCKET|C_ICAP_SOCKET /var/run/c-icap/c-icap.ctl|' \
54 $fs/etc/squidguardmgr.conf
55 }
57 post_install()
58 {
59 # squidguardmgr configuration
60 chown root.www "$1/etc/squidGuard/squidGuard.conf"
61 chmod 664 "$1/etc/squidGuard/squidGuard.conf"
62 chown nobody.nogroup "$1"/usr/share/squidguardmgr/lang/*
63 chown nobody.nogroup "$1/usr/share/squidguardmgr/lang"
64 chown nobody.nogroup "$1/usr/share/squidguardmgr"
66 # Configure lighttpd server
67 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
68 then
69 if ! grep -q /usr/share/squidguardmgr/ "$1/etc/lighttpd/lighttpd.conf"
70 then
71 sed -i -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/squidguardmgr/" => "/usr/share/squidguardmgr/",|g' \
72 "$1/etc/lighttpd/lighttpd.conf"
73 if [ -z "$1" ]
74 then
75 # Start Web server.
76 /etc/init.d/lighttpd stop
77 /etc/init.d/lighttpd start
78 fi
79 fi
80 fi
82 # Configure apache server
83 if [ -f "$1/etc/apache/httpd.conf" ]
84 then
85 if [ ! -f "$1/etc/apache/conf.d/squidguardmgr" ]
86 then
87 cat > "$1/etc/apache/conf.d/squidguardmgr" <<EOT
88 <IfModule mod_alias.c>
89 Alias /squidguardmgr /usr/share/squidguardmgr
90 </IfModule>
91 <DirectoryMatch /usr/share/squidguardmgr/>
92 Options +ExecCGI
93 AddHandler cgi-script .cgi
94 DirectoryIndex squidguardmgr.cgi
95 Order allow,deny
96 Allow from all
97 </DirectoryMatch>
98 EOT
99 if [ -z "$1" ]
100 then
101 # Start Web server.
102 /etc/init.d/apache stop
103 /etc/init.d/apache start
104 fi
105 fi
106 fi
107 }