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