wok annotate squidguardmgr/receipt @ rev 25037

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