wok-current view squidguard/receipt @ rev 20412
*l2tp*: add doc
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Aug 02 11:32:59 2018 +0200 (2018-08-02) |
parents | 9e01bc6321ea |
children | be2ab6ab8f7e |
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 LICENSE="GPL"
9 SOURCE="squidGuard"
10 TARBALL="$SOURCE-$VERSION.tar.gz"
11 WEB_SITE="http://www.squidguard.org/"
12 WGET_URL="${WEB_SITE}Downloads/$TARBALL"
13 DEPENDS="squid libdb"
14 BUILD_DEPENDS="db-dev"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
21 # Security patches
22 while read patch_file; do
23 echo "Apply $patch_file"
24 tar xvzf $stuff/$patch_file || return 1
25 cp -a $(basename $patch_file .tar.gz)/* src
26 done <<EOT
27 squidGuard-1.4-patch-20091015.tar.gz
28 squidGuard-1.4-patch-20091019.tar.gz
29 squidGuard-1.4-patch-20150201.tar.gz
30 EOT
31 # Add support for squid 3.4
32 patch -p1 < $stuff/squidGuard-1.4_upgrade.patch
33 patch -p1 < $stuff/squidGuard-1.4-dnsbl.patch
35 ./configure --prefix=/usr --infodir=/usr/share/info \
36 --sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \
37 --with-sg-logdir=/var/lib/squidGuard/log \
38 --with-sg-dbhome=/var/lib/squidGuard/db \
39 --mandir=/usr/share/man $CONFIGURE_ARGS
41 make
42 sed -e "s|^prefix =.*|prefix = $DESTDIR/usr|" \
43 -e "s|^logdir =.*|logdir = $DESTDIR/var/lib/squidGuard/log|" \
44 -e "s|^configfile =.*|configfile = $DESTDIR/etc/squidGuard/squidGuard.conf|" \
45 -e "s|^dbhomedir =.*|dbhomedir = $DESTDIR/var/lib/squidGuard/db|" \
46 -e "s|^SQUIDUSER =.*|SQUIDUSER = nobody|" \
47 < Makefile > Makefile.slitaz-install
48 mkdir -p $DESTDIR/etc/squidGuard
49 make -f Makefile.slitaz-install install
50 }
52 # Rules to gen a SliTaz package suitable for Tazpkg.
53 genpkg_rules()
54 {
55 mkdir -p $fs/etc/squid/conf.d
57 cp -a $install/* $fs/
58 cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d
60 # Cleanup.
61 rmdir $fs/usr/squidGuard
63 }
65 # Pre and post install commands for Tazpkg.
66 post_install()
67 {
68 chown -R nobody "$1"/var/lib/squidGuard/*
69 # Recharge squid config
70 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
71 }
73 post_remove()
74 {
75 # Recharge squid config
76 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
77 }
79 check_config()
80 {
81 su -c 'echo "http://www.example.com 192.168.0.6/- - GET" | \
82 squidGuard -c /etc/squidGuard/squidGuard.conf -d' nobody
83 }