wok-6.x annotate squidguard/receipt @ rev 4378
emacs: up depends
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Mon Oct 12 21:19:14 2009 +0000 (2009-10-12) |
parents | 07514ab2c2fc |
children | f3a7e7dd7e7c |
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 |
pascal@1253 | 19 ./configure --prefix=/usr --infodir=/usr/share/info \ |
erjo@2334 | 20 --sysconfdir=/etc --with-sg-config=/etc/squidGuard/squidGuard.conf \ |
pascal@1253 | 21 --with-sg-logdir=/var/lib/squidGuard/log \ |
pascal@1253 | 22 --with-sg-dbhome=/var/lib/squidGuard/db \ |
pascal@1253 | 23 --mandir=/usr/share/man $CONFIGURE_ARGS |
pascal@1253 | 24 make |
pascal@1253 | 25 sed -e 's|^prefix =.*|prefix = _pkg/usr|' \ |
pascal@1253 | 26 -e 's|^logdir =.*|logdir = _pkg/var/lib/squidGuard/log|' \ |
erjo@2334 | 27 -e 's|^configfile =.*|configfile = _pkg/etc/squidGuard/squidGuard.conf|' \ |
pascal@1253 | 28 -e 's|^dbhomedir =.*|dbhomedir = _pkg/var/lib/squidGuard/db|' \ |
erjo@2334 | 29 -e 's|^SQUIDUSER =.*|SQUIDUSER = nobody|' \ |
pascal@1253 | 30 < Makefile > Makefile.slitaz-install |
erjo@2334 | 31 mkdir -p _pkg/etc/squidGuard |
pascal@1253 | 32 make -f Makefile.slitaz-install install |
pascal@1253 | 33 } |
pascal@1253 | 34 |
pascal@1253 | 35 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1253 | 36 genpkg_rules() |
pascal@1253 | 37 { |
pascal@1253 | 38 cp -a $_pkg/* $fs/ |
pascal@3990 | 39 rmdir $fs/usr/squidGuard |
pascal@1253 | 40 } |
pascal@1253 | 41 |
pascal@1253 | 42 # Pre and post install commands for Tazpkg. |
pascal@1253 | 43 post_install() |
pascal@1253 | 44 { |
pascal@3990 | 45 chown -R nobody $1/var/lib/squidGuard/* |
erjo@2334 | 46 if ! grep -q ^redirect_program $1/etc/squid/squid.conf ; then |
pascal@1253 | 47 echo "Updating /etc/squid/squid.conf" |
pascal@1253 | 48 cat >> $1/etc/squid/squid.conf <<EOF |
erjo@2334 | 49 redirect_program /usr/bin/squidGuard -c /etc/squidGuard/squidGuard.conf |
pascal@1253 | 50 EOF |
erjo@2334 | 51 # Restart squid if running |
erjo@2334 | 52 $(which squid) -k reconfigure 2> /dev/null |
pascal@1253 | 53 fi |
pascal@1253 | 54 } |
erjo@2334 | 55 |
erjo@2334 | 56 post_remove() |
erjo@2334 | 57 { |
erjo@2334 | 58 if grep -q "squidGuard" /etc/squid/squid.conf ; then |
erjo@2334 | 59 echo "Updating /etc/squid/squid.conf" |
erjo@2334 | 60 sed -i -e "s/.*squidGuard.*//" /etc/squid/squid.conf |
erjo@2334 | 61 # Restart squid if running |
erjo@2334 | 62 $(which squid) -k reconfigure 2> /dev/null |
erjo@2334 | 63 fi |
erjo@2334 | 64 } |