wok-next view squidguard/receipt @ rev 9203

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