# SliTaz package receipt. PACKAGE="squidguard" VERSION="1.4.0" CATEGORY="network" SHORT_DESC="Web filter." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL" TARBALL="$PACKAGE-$VERSION.tar.gz" WEB_SITE="https://web.archive.org/web/20220728071047/http://www.squidguard.org/" WGET_URL="https://www.joonet.de/sources/$PACKAGE/$TARBALL" DEPENDS="squid libdb" BUILD_DEPENDS="db-dev" # What is the latest version available today? current_version() { wget -O - ${WGET_URL%/*}/ 2>/dev/null | \ sed "/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q } # Rules to configure and make the package. compile_rules() { # Security patches while read patch_file; do echo "Apply $patch_file" tar xvzf $stuff/$patch_file || return 1 cp -a $(basename $patch_file .tar.gz)/* src done < Makefile.slitaz-install mkdir -p $DESTDIR/etc/squidGuard make -f Makefile.slitaz-install install } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/etc/squid/conf.d cp -a $install/* $fs/ cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d # Cleanup. rmdir $fs/usr/squidGuard } # Pre and post install commands for Tazpkg. post_install() { chown -R nobody "$1"/var/lib/squidGuard/* # Recharge squid config [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; } } post_remove() { # Recharge squid config [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; } } check_config() { su -c 'echo "http://www.example.com 192.168.0.6/- - GET" | \ squidGuard -c /etc/squidGuard/squidGuard.conf -d' nobody }