wok-next view squidguard/receipt @ rev 20534
Clean default configure options when site script used.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Mar 30 19:31:50 2018 +0300 (2018-03-30) |
parents | ed8073aa8cf0 |
children | d5aab818505e |
line source
1 # SliTaz package receipt v2.
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 WEB_SITE="http://www.squidguard.org/"
11 TARBALL="squidGuard-$VERSION.tar.gz"
12 WGET_URL="${WEB_SITE}Downloads/$TARBALL"
14 BUILD_DEPENDS="db-dev"
16 compile_rules() {
17 # Security patches
18 while read patch_file; do
19 echo "Apply $patch_file"
20 tar xvzf $stuff/$patch_file || return 1
21 cp -a $(basename $patch_file .tar.gz)/* src
22 done <<EOT
23 squidGuard-1.4-patch-20091015.tar.gz
24 squidGuard-1.4-patch-20091019.tar.gz
25 squidGuard-1.4-patch-20150201.tar.gz
26 EOT
27 # Add support for squid 3.4
28 patch -p1 < $stuff/squidGuard-1.4_upgrade.patch
29 patch -p1 < $stuff/squidGuard-1.4-dnsbl.patch
31 ./configure \
32 --with-sg-config=/etc/squidGuard/squidGuard.conf \
33 --with-sg-logdir=/var/lib/squidGuard/log \
34 --with-sg-dbhome=/var/lib/squidGuard/db \
35 $CONFIGURE_ARGS &&
36 make &&
37 sed -e "s|^prefix =.*|prefix = $DESTDIR/usr|" \
38 -e "s|^logdir =.*|logdir = $DESTDIR/var/lib/squidGuard/log|" \
39 -e "s|^configfile =.*|configfile = $DESTDIR/etc/squidGuard/squidGuard.conf|" \
40 -e "s|^dbhomedir =.*|dbhomedir = $DESTDIR/var/lib/squidGuard/db|" \
41 -e "s|^SQUIDUSER =.*|SQUIDUSER = nobody|" \
42 < Makefile > Makefile.slitaz-install
43 mkdir -p $DESTDIR/etc/squidGuard
44 make -f Makefile.slitaz-install install
45 }
47 genpkg_rules() {
48 mkdir -p $fs/etc/squid/conf.d
50 cp -a $install/* $fs/
51 cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d
53 # Cleanup.
54 rmdir $fs/usr/squidGuard
56 DEPENDS="squid libdb"
57 }
59 post_install() {
60 chown -R nobody "$1"/var/lib/squidGuard/*
61 # Recharge squid config
62 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
63 }
65 post_remove() {
66 # Recharge squid config
67 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
68 }
70 check_config() {
71 su -c 'echo "http://www.example.com 192.168.0.6/- - GET" | \
72 squidGuard -c /etc/squidGuard/squidGuard.conf -d' nobody
73 }