wok-backports annotate squidguard/receipt @ rev 55

Remove ashism ==
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Feb 27 17:46:33 2019 +0100 (2019-02-27)
parents d4b1fccb5c8f
children
rev   line source
erjo@25 1 # SliTaz package receipt.
erjo@25 2
erjo@25 3 PACKAGE="squidguard"
erjo@25 4 VERSION="1.4"
erjo@25 5 CATEGORY="network"
erjo@25 6 SHORT_DESC="Web filter."
erjo@25 7 MAINTAINER="pascal.bellard@slitaz.org"
erjo@25 8 LICENSE="GPL"
erjo@25 9 SOURCE="squidGuard"
erjo@25 10 TARBALL="$SOURCE-$VERSION.tar.gz"
erjo@25 11 WEB_SITE="http://www.squidguard.org/"
erjo@25 12 WGET_URL="${WEB_SITE}Downloads/$TARBALL"
erjo@25 13 DEPENDS="squid libdb"
erjo@25 14 BUILD_DEPENDS="db-dev"
erjo@25 15
erjo@25 16 # Rules to configure and make the package.
erjo@25 17 compile_rules()
erjo@25 18 {
erjo@25 19 cd $src
erjo@25 20
erjo@25 21 # Security patches
erjo@25 22 while read patch_file; do
erjo@25 23 echo "Apply $patch_file"
erjo@25 24 tar xvzf $stuff/$patch_file || return 1
erjo@25 25 cp -a $(basename $patch_file .tar.gz)/* src
erjo@25 26 done <<EOT
erjo@25 27 squidGuard-1.4-patch-20091015.tar.gz
erjo@25 28 squidGuard-1.4-patch-20091019.tar.gz
erjo@25 29 EOT
erjo@28 30 # Add support for squid 3.4
erjo@28 31 patch -p1 < $stuff/squidGuard-1.4_upgrade.patch
erjo@28 32 patch -p1 < $stuff/squidGuard-1.4-dnsbl.patch
erjo@28 33
erjo@25 34 ./configure --prefix=/usr --infodir=/usr/share/info \
erjo@25 35 --sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \
erjo@25 36 --with-sg-logdir=/var/lib/squidGuard/log \
erjo@25 37 --with-sg-dbhome=/var/lib/squidGuard/db \
erjo@25 38 --mandir=/usr/share/man $CONFIGURE_ARGS
erjo@25 39
erjo@25 40 make
erjo@25 41 sed -e "s|^prefix =.*|prefix = $DESTDIR/usr|" \
erjo@25 42 -e "s|^logdir =.*|logdir = $DESTDIR/var/lib/squidGuard/log|" \
erjo@25 43 -e "s|^configfile =.*|configfile = $DESTDIR/etc/squidGuard/squidGuard.conf|" \
erjo@25 44 -e "s|^dbhomedir =.*|dbhomedir = $DESTDIR/var/lib/squidGuard/db|" \
erjo@25 45 -e "s|^SQUIDUSER =.*|SQUIDUSER = nobody|" \
erjo@25 46 < Makefile > Makefile.slitaz-install
erjo@25 47 mkdir -p $DESTDIR/etc/squidGuard
erjo@25 48 make -f Makefile.slitaz-install install
erjo@25 49 }
erjo@25 50
erjo@25 51 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@25 52 genpkg_rules()
erjo@25 53 {
erjo@25 54 mkdir -p $fs/etc/squid/conf.d
erjo@25 55
erjo@25 56 cp -a $install/* $fs/
erjo@25 57 cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d
erjo@25 58
erjo@25 59 # Cleanup.
erjo@25 60 rmdir $fs/usr/squidGuard
erjo@25 61
erjo@25 62 }
erjo@25 63
erjo@25 64 # Pre and post install commands for Tazpkg.
erjo@25 65 post_install()
erjo@25 66 {
erjo@25 67 chown -R nobody $1/var/lib/squidGuard/*
erjo@25 68 # Recharge squid config
erjo@25 69 [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null
erjo@25 70 }
erjo@25 71
erjo@25 72 post_remove()
erjo@25 73 {
erjo@25 74 # Recharge squid config
erjo@25 75 [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null
erjo@25 76 }