wok view squidguard/receipt @ rev 25120
updated pekwm (0.1.17 -> 0.2.1)
author | Hans-G?nter Theisgen |
---|---|
date | Sun Jun 26 10:18:40 2022 +0100 (2022-06-26) |
parents | 535c806240cc |
children | c15fedfb9582 |
line source
1 # SliTaz package receipt.
3 PACKAGE="squidguard"
4 VERSION="1.4.0"
5 CATEGORY="network"
6 SHORT_DESC="Web filter."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://www.squidguard.org/"
11 WGET_URL="https://www.joonet.de/sources/$PACKAGE/$TARBALL"
12 DEPENDS="squid libdb"
13 BUILD_DEPENDS="db-dev"
15 # What is the latest version available today?
16 current_version()
17 {
18 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
19 sed "/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
20 }
22 # Rules to configure and make the package.
23 compile_rules()
24 {
25 # Security patches
26 while read patch_file; do
27 echo "Apply $patch_file"
28 tar xvzf $stuff/$patch_file || return 1
29 cp -a $(basename $patch_file .tar.gz)/* src
30 done <<EOT
31 squidGuard-1.4-patch-20091015.tar.gz
32 squidGuard-1.4-patch-20091019.tar.gz
33 squidGuard-1.4-patch-20150201.tar.gz
34 EOT
35 # Add support for squid 3.4
36 patch -p1 < $stuff/squidGuard-1.4_upgrade.patch
37 patch -p1 < $stuff/squidGuard-1.4-dnsbl.patch
39 ./configure --prefix=/usr --infodir=/usr/share/info \
40 --sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \
41 --with-sg-logdir=/var/lib/squidGuard/log \
42 --with-sg-dbhome=/var/lib/squidGuard/db \
43 --mandir=/usr/share/man $CONFIGURE_ARGS
45 make
46 sed -e "s|^prefix =.*|prefix = $DESTDIR/usr|" \
47 -e "s|^logdir =.*|logdir = $DESTDIR/var/lib/squidGuard/log|" \
48 -e "s|^configfile =.*|configfile = $DESTDIR/etc/squidGuard/squidGuard.conf|" \
49 -e "s|^dbhomedir =.*|dbhomedir = $DESTDIR/var/lib/squidGuard/db|" \
50 -e "s|^SQUIDUSER =.*|SQUIDUSER = nobody|" \
51 < Makefile > Makefile.slitaz-install
52 mkdir -p $DESTDIR/etc/squidGuard
53 make -f Makefile.slitaz-install install
54 }
56 # Rules to gen a SliTaz package suitable for Tazpkg.
57 genpkg_rules()
58 {
59 mkdir -p $fs/etc/squid/conf.d
61 cp -a $install/* $fs/
62 cp -pa $stuff/squidguard.conf $fs/etc/squid/conf.d
64 # Cleanup.
65 rmdir $fs/usr/squidGuard
67 }
69 # Pre and post install commands for Tazpkg.
70 post_install()
71 {
72 chown -R nobody "$1"/var/lib/squidGuard/*
73 # Recharge squid config
74 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
75 }
77 post_remove()
78 {
79 # Recharge squid config
80 [ "$1" ] || { [ -x $(which squid) ] && $(which squid) -k reconfigure 2> /dev/null; }
81 }
83 check_config()
84 {
85 su -c 'echo "http://www.example.com 192.168.0.6/- - GET" | \
86 squidGuard -c /etc/squidGuard/squidGuard.conf -d' nobody
87 }