wok-current view squidguardmgr/receipt @ rev 25672
patch tazpkg, upgrade core pkgs first
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sun Mar 03 17:58:42 2024 +0000 (5 months ago) |
parents | ad0bc3efbf37 |
children |
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 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - $WEB_SITE 2>/dev/null | \
23 sed '/tar.gz/!d;s|.*mgr-||;s|.tar.*||'
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 SQUIDUSR=squid SQUIDGRP=squid perl Makefile.PL << EOT &&
30 /etc/squidGuard/squidGuard.conf
31 nobody
32 EOT
33 mkdir -p $DESTDIR/var/www/squidguardmgr/ &&
34 make install
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/usr/share
41 mkdir -p $fs/etc
42 mkdir -p $fs/var/lib/squidGuard/log
43 mkdir -p $fs/var/lib/squidGuard/db
45 cp -a $install/var/www/squidguardmgr $fs/usr/share
46 # 1.14 unsuitable
47 # ( cd $fs ; patch -p0 ) < $stuff/squidguardmgr.U
48 mv $fs/usr/share/squidguardmgr/squidguardmgr.conf $fs/etc
49 ln -s /etc/squidguardmgr.conf $fs/usr/share/squidguardmgr/squidguardmgr.conf
51 sed -i -e 's|/var/www/squidguardmgr|/usr/share/squidguardmgr|' \
52 -e 's|SQUIDCLAMAV off|SQUIDCLAMAV on|' \
53 -e 's|SC_CONF_FILE|SC_CONF_FILE /etc/squidclamav.conf|' \
54 -e 's|C_ICAP_SOCKET|C_ICAP_SOCKET /var/run/c-icap/c-icap.ctl|' \
55 $fs/etc/squidguardmgr.conf
56 }
58 post_install()
59 {
60 # squidguardmgr configuration
61 chown root.www "$1/etc/squidGuard/squidGuard.conf"
62 chmod 664 "$1/etc/squidGuard/squidGuard.conf"
63 chown nobody.nogroup "$1"/usr/share/squidguardmgr/lang/*
64 chown nobody.nogroup "$1/usr/share/squidguardmgr/lang"
65 chown nobody.nogroup "$1/usr/share/squidguardmgr"
67 # Configure lighttpd server
68 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
69 then
70 if ! grep -q /usr/share/squidguardmgr/ "$1/etc/lighttpd/lighttpd.conf"
71 then
72 sed -i -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/squidguardmgr/" => "/usr/share/squidguardmgr/",|g' \
73 "$1/etc/lighttpd/lighttpd.conf"
74 if [ -z "$1" ]
75 then
76 # Start Web server.
77 /etc/init.d/lighttpd stop
78 /etc/init.d/lighttpd start
79 fi
80 fi
81 fi
83 # Configure apache server
84 if [ -f "$1/etc/apache/httpd.conf" ]
85 then
86 if [ ! -f "$1/etc/apache/conf.d/squidguardmgr" ]
87 then
88 cat > "$1/etc/apache/conf.d/squidguardmgr" <<EOT
89 <IfModule mod_alias.c>
90 Alias /squidguardmgr /usr/share/squidguardmgr
91 </IfModule>
92 <DirectoryMatch /usr/share/squidguardmgr/>
93 Options +ExecCGI
94 AddHandler cgi-script .cgi
95 DirectoryIndex squidguardmgr.cgi
96 Order allow,deny
97 Allow from all
98 </DirectoryMatch>
99 EOT
100 if [ -z "$1" ]
101 then
102 # Start Web server.
103 /etc/init.d/apache stop
104 /etc/init.d/apache start
105 fi
106 fi
107 fi
108 }