wok-current view squidguardmgr/receipt @ rev 25042
Up lzsa (1.3.12), zstd (1.5.2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jun 01 08:14:05 2022 +0000 (2022-06-01) |
parents | 9e01bc6321ea |
children | 36dead94dd76 |
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 current_version()
17 {
18 wget -O - $WEB_SITE 2>/dev/null | \
19 sed '/tar.gz/!d;s|.*mgr-||;s|.tar.*||'
20 }
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 cd $src
26 SQUIDUSR=squid SQUIDGRP=squid perl Makefile.PL << EOT &&
27 /etc/squidGuard/squidGuard.conf
28 nobody
29 EOT
30 mkdir -p $DESTDIR/var/www/squidguardmgr/ &&
31 make install
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 mkdir -p $fs/usr/share $fs/etc $fs/var/lib/squidGuard/log $fs/var/lib/squidGuard/db
39 cp -a $install/var/www/squidguardmgr $fs/usr/share
40 ( cd $fs ; patch -p0 ) < $stuff/squidguardmgr.U
41 mv $fs/usr/share/squidguardmgr/squidguardmgr.conf $fs/etc
42 ln -s /etc/squidguardmgr.conf $fs/usr/share/squidguardmgr/squidguardmgr.conf
44 sed -i -e 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
45 -e 's|SQUIDCLAMAV off|SQUIDCLAMAV on|' \
46 -e 's|SC_CONF_FILE|SC_CONF_FILE /etc/squidclamav.conf|' \
47 -e 's|C_ICAP_SOCKET|C_ICAP_SOCKET /var/run/c-icap/c-icap.ctl|' $fs/etc/squidguardmgr.conf
48 }
50 post_install()
51 {
52 # squidguardmgr config
53 chown root.www "$1/etc/squidGuard/squidGuard.conf"
54 chmod 664 "$1/etc/squidGuard/squidGuard.conf"
55 chown nobody.nogroup "$1"/usr/share/squidguardmgr/lang/* \
56 "$1/usr/share/squidguardmgr/lang" "$1/usr/share/squidguardmgr"
57 # Configure lighttpd server
58 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
59 if ! grep -q /usr/share/squidguardmgr/ "$1/etc/lighttpd/lighttpd.conf"; then
60 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/squidguardmgr/" => "/usr/share/squidguardmgr/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
61 if [ -z "$1" ]; then
62 # Start Web server.
63 /etc/init.d/lighttpd stop
64 /etc/init.d/lighttpd start
65 fi
66 fi
67 fi
68 # Configure apache server
69 if [ -f "$1/etc/apache/httpd.conf" ]; then
70 if [ ! -f "$1/etc/apache/conf.d/squidguardmgr" ]; then
71 cat > "$1/etc/apache/conf.d/squidguardmgr" <<EOT
72 <IfModule mod_alias.c>
73 Alias /squidguardmgr /usr/share/squidguardmgr
74 </IfModule>
75 <DirectoryMatch /usr/share/squidguardmgr/>
76 Options +ExecCGI
77 AddHandler cgi-script .cgi
78 DirectoryIndex squidguardmgr.cgi
79 Order allow,deny
80 Allow from all
81 </DirectoryMatch>
82 EOT
83 if [ -z "$1" ]; then
84 # Start Web server.
85 /etc/init.d/apache stop
86 /etc/init.d/apache start
87 fi
88 fi
89 fi
90 }