wok annotate squidguard/receipt @ rev 24995

updated nginx and nginx-extras (1.19.0 -> 1.21.6)
author Hans-G?nter Theisgen
date Mon May 16 10:04:06 2022 +0100 (2022-05-16)
parents be2ab6ab8f7e
children 8e505f99deb3
rev   line source
pascal@1253 1 # SliTaz package receipt.
pascal@1253 2
pascal@1253 3 PACKAGE="squidguard"
erjo@3985 4 VERSION="1.4"
pascal@1253 5 CATEGORY="network"
pascal@1253 6 SHORT_DESC="Web filter."
pascal@1253 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@15023 8 LICENSE="GPL"
pascal@1253 9 SOURCE="squidGuard"
pascal@1253 10 TARBALL="$SOURCE-$VERSION.tar.gz"
pascal@24465 11 WEB_SITE="http://www.squidguard.org/"
pascal@1253 12 WGET_URL="${WEB_SITE}Downloads/$TARBALL"
pascal@1253 13 DEPENDS="squid libdb"
pascal@1253 14 BUILD_DEPENDS="db-dev"
pascal@1253 15
pascal@24465 16 # What is the latest version available today?
pascal@24465 17 current_version()
pascal@24465 18 {
pascal@24465 19 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
pascal@24465 20 sed "/latest/d;/$SOURCE-[0-9]/!d;/tar/!d;s|.*$SOURCE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
pascal@24465 21 }
pascal@24465 22
pascal@1253 23 # Rules to configure and make the package.
pascal@1253 24 compile_rules()
pascal@1253 25 {
erjo@4661 26 # Security patches
erjo@4661 27 while read patch_file; do
erjo@4661 28 echo "Apply $patch_file"
pascal@8974 29 tar xvzf $stuff/$patch_file || return 1
erjo@4661 30 cp -a $(basename $patch_file .tar.gz)/* src
erjo@4661 31 done <<EOT
erjo@4661 32 squidGuard-1.4-patch-20091015.tar.gz
erjo@4661 33 squidGuard-1.4-patch-20091019.tar.gz
pascal@18170 34 squidGuard-1.4-patch-20150201.tar.gz
erjo@4661 35 EOT
erjo@16708 36 # Add support for squid 3.4
erjo@16708 37 patch -p1 < $stuff/squidGuard-1.4_upgrade.patch
erjo@16708 38 patch -p1 < $stuff/squidGuard-1.4-dnsbl.patch
erjo@16708 39
pascal@1253 40 ./configure --prefix=/usr --infodir=/usr/share/info \
erjo@2334 41 --sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \
pascal@1253 42 --with-sg-logdir=/var/lib/squidGuard/log \
pascal@1253 43 --with-sg-dbhome=/var/lib/squidGuard/db \
pascal@1253 44 --mandir=/usr/share/man $CONFIGURE_ARGS
erjo@4661 45
pascal@1253 46 make
pascal@15603 47 sed -e "s|^prefix =.*|prefix = $DESTDIR/usr|" \
pascal@15603 48 -e "s|^logdir =.*|logdir = $DESTDIR/var/lib/squidGuard/log|" \
pascal@15603 49 -e "s|^configfile =.*|configfile = $DESTDIR/etc/squidGuard/squidGuard.conf|" \
pascal@15603 50 -e "s|^dbhomedir =.*|dbhomedir = $DESTDIR/var/lib/squidGuard/db|" \
pascal@15603 51 -e "s|^SQUIDUSER =.*|SQUIDUSER = nobody|" \
pascal@1253 52 < Makefile > Makefile.slitaz-install
pascal@15603 53 mkdir -p $DESTDIR/etc/squidGuard
pascal@1253 54 make -f Makefile.slitaz-install install
pascal@1253 55 }
pascal@1253 56
pascal@1253 57 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1253 58 genpkg_rules()
pascal@1253 59 {
erjo@11916 60 mkdir -p $fs/etc/squid/conf.d
erjo@11916 61
erjo@11916 62 cp -a $install/* $fs/
erjo@11916 63 cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d
erjo@11916 64
erjo@11916 65 # Cleanup.
pascal@3990 66 rmdir $fs/usr/squidGuard
erjo@11916 67
pascal@1253 68 }
pascal@1253 69
pascal@1253 70 # Pre and post install commands for Tazpkg.
pascal@1253 71 post_install()
pascal@1253 72 {
pascal@18730 73 chown -R nobody "$1"/var/lib/squidGuard/*
erjo@11916 74 # Recharge squid config
pascal@18732 75 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
pascal@1253 76 }
erjo@2334 77
erjo@2334 78 post_remove()
erjo@2334 79 {
erjo@11916 80 # Recharge squid config
pascal@18732 81 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
erjo@2334 82 }
pascal@18170 83
pascal@18170 84 check_config()
pascal@18170 85 {
pascal@18174 86 su -c 'echo "http://www.example.com 192.168.0.6/- - GET" | \
pascal@18174 87 squidGuard -c /etc/squidGuard/squidGuard.conf -d' nobody
pascal@18170 88 }