wok-next annotate squidguard/receipt @ rev 17487

Update some suggested
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 30 12:54:33 2014 +0100 (2014-12-30)
parents 051931e905b0
children 2f33548ee20c
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@1253 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@1253 16 # Rules to configure and make the package.
pascal@1253 17 compile_rules()
pascal@1253 18 {
pascal@1253 19 cd $src
erjo@4661 20
erjo@4661 21 # Security patches
erjo@4661 22 while read patch_file; do
erjo@4661 23 echo "Apply $patch_file"
pascal@8974 24 tar xvzf $stuff/$patch_file || return 1
erjo@4661 25 cp -a $(basename $patch_file .tar.gz)/* src
erjo@4661 26 done <<EOT
erjo@4661 27 squidGuard-1.4-patch-20091015.tar.gz
erjo@4661 28 squidGuard-1.4-patch-20091019.tar.gz
erjo@4661 29 EOT
erjo@16708 30 # Add support for squid 3.4
erjo@16708 31 patch -p1 < $stuff/squidGuard-1.4_upgrade.patch
erjo@16708 32 patch -p1 < $stuff/squidGuard-1.4-dnsbl.patch
erjo@16708 33
pascal@1253 34 ./configure --prefix=/usr --infodir=/usr/share/info \
erjo@2334 35 --sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \
pascal@1253 36 --with-sg-logdir=/var/lib/squidGuard/log \
pascal@1253 37 --with-sg-dbhome=/var/lib/squidGuard/db \
pascal@1253 38 --mandir=/usr/share/man $CONFIGURE_ARGS
erjo@4661 39
pascal@1253 40 make
pascal@15603 41 sed -e "s|^prefix =.*|prefix = $DESTDIR/usr|" \
pascal@15603 42 -e "s|^logdir =.*|logdir = $DESTDIR/var/lib/squidGuard/log|" \
pascal@15603 43 -e "s|^configfile =.*|configfile = $DESTDIR/etc/squidGuard/squidGuard.conf|" \
pascal@15603 44 -e "s|^dbhomedir =.*|dbhomedir = $DESTDIR/var/lib/squidGuard/db|" \
pascal@15603 45 -e "s|^SQUIDUSER =.*|SQUIDUSER = nobody|" \
pascal@1253 46 < Makefile > Makefile.slitaz-install
pascal@15603 47 mkdir -p $DESTDIR/etc/squidGuard
pascal@1253 48 make -f Makefile.slitaz-install install
pascal@1253 49 }
pascal@1253 50
pascal@1253 51 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1253 52 genpkg_rules()
pascal@1253 53 {
erjo@11916 54 mkdir -p $fs/etc/squid/conf.d
erjo@11916 55
erjo@11916 56 cp -a $install/* $fs/
erjo@11916 57 cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d
erjo@11916 58
erjo@11916 59 # Cleanup.
pascal@3990 60 rmdir $fs/usr/squidGuard
erjo@11916 61
pascal@1253 62 }
pascal@1253 63
pascal@1253 64 # Pre and post install commands for Tazpkg.
pascal@1253 65 post_install()
pascal@1253 66 {
pascal@3990 67 chown -R nobody $1/var/lib/squidGuard/*
erjo@11916 68 # Recharge squid config
erjo@11916 69 [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null
pascal@1253 70 }
erjo@2334 71
erjo@2334 72 post_remove()
erjo@2334 73 {
erjo@11916 74 # Recharge squid config
erjo@11916 75 [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null
erjo@2334 76 }