wok annotate squidguard/receipt @ rev 5077

bluez:remove unwanted dir
author Rohit Joshi <jozee@slitaz.org>
date Fri Mar 12 12:27:32 2010 +0000 (2010-03-12)
parents f843c4e987d3
children 0b4cf0d9e1b5
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@1253 8 SOURCE="squidGuard"
pascal@1253 9 TARBALL="$SOURCE-$VERSION.tar.gz"
pascal@1253 10 WEB_SITE="http://www.squidguard.org/"
pascal@1253 11 WGET_URL="${WEB_SITE}Downloads/$TARBALL"
pascal@1253 12 DEPENDS="squid libdb"
pascal@1253 13 BUILD_DEPENDS="db-dev"
pascal@1253 14
pascal@1253 15 # Rules to configure and make the package.
pascal@1253 16 compile_rules()
pascal@1253 17 {
pascal@1253 18 cd $src
erjo@4661 19
erjo@4661 20 # Security patches
erjo@4661 21 while read patch_file; do
erjo@4661 22 echo "Apply $patch_file"
erjo@4661 23 tar xvzf ../stuff/$patch_file || exit 1
erjo@4661 24 cp -a $(basename $patch_file .tar.gz)/* src
erjo@4661 25 done <<EOT
erjo@4661 26 squidGuard-1.4-patch-20091015.tar.gz
erjo@4661 27 squidGuard-1.4-patch-20091019.tar.gz
erjo@4661 28 EOT
pascal@1253 29 ./configure --prefix=/usr --infodir=/usr/share/info \
erjo@2334 30 --sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \
pascal@1253 31 --with-sg-logdir=/var/lib/squidGuard/log \
pascal@1253 32 --with-sg-dbhome=/var/lib/squidGuard/db \
pascal@1253 33 --mandir=/usr/share/man $CONFIGURE_ARGS
erjo@4661 34
pascal@1253 35 make
pascal@1253 36 sed -e 's|^prefix =.*|prefix = _pkg/usr|' \
pascal@1253 37 -e 's|^logdir =.*|logdir = _pkg/var/lib/squidGuard/log|' \
erjo@2334 38 -e 's|^configfile =.*|configfile = _pkg/etc/squidGuard/squidGuard.conf|' \
pascal@1253 39 -e 's|^dbhomedir =.*|dbhomedir = _pkg/var/lib/squidGuard/db|' \
erjo@2334 40 -e 's|^SQUIDUSER =.*|SQUIDUSER = nobody|' \
pascal@1253 41 < Makefile > Makefile.slitaz-install
erjo@2334 42 mkdir -p _pkg/etc/squidGuard
pascal@1253 43 make -f Makefile.slitaz-install install
pascal@1253 44 }
pascal@1253 45
pascal@1253 46 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1253 47 genpkg_rules()
pascal@1253 48 {
pascal@1253 49 cp -a $_pkg/* $fs/
pascal@3990 50 rmdir $fs/usr/squidGuard
pascal@1253 51 }
pascal@1253 52
pascal@1253 53 # Pre and post install commands for Tazpkg.
pascal@1253 54 post_install()
pascal@1253 55 {
pascal@3990 56 chown -R nobody $1/var/lib/squidGuard/*
erjo@2334 57 if ! grep -q ^redirect_program $1/etc/squid/squid.conf ; then
pascal@1253 58 echo "Updating /etc/squid/squid.conf"
pascal@1253 59 cat >> $1/etc/squid/squid.conf <<EOF
erjo@2334 60 redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf
pascal@1253 61 EOF
erjo@2334 62 # Restart squid if running
erjo@2334 63 $(which squid) -k reconfigure 2> /dev/null
pascal@1253 64 fi
pascal@1253 65 }
erjo@2334 66
erjo@2334 67 post_remove()
erjo@2334 68 {
erjo@2334 69 if grep -q "squidGuard" /etc/squid/squid.conf ; then
erjo@2334 70 echo "Updating /etc/squid/squid.conf"
erjo@2334 71 sed -i -e "s/.*squidGuard.*//" /etc/squid/squid.conf
erjo@2334 72 # Restart squid if running
erjo@2334 73 $(which squid) -k reconfigure 2> /dev/null
erjo@2334 74 fi
erjo@2334 75 }