wok annotate squid/receipt @ rev 1253

Add squid & squidguard
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 13 07:40:55 2008 +0000 (2008-08-13)
parents
children 3d99ecce2d4b
rev   line source
pascal@1253 1 # SliTaz package receipt.
pascal@1253 2
pascal@1253 3 PACKAGE="squid"
pascal@1253 4 VERSION="3.0.STABLE8"
pascal@1253 5 CATEGORY="network"
pascal@1253 6 SHORT_DESC="Web/ftp proxy."
pascal@1253 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1253 8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
pascal@1253 9 WEB_SITE="http://www.squid-cache.org/"
pascal@1253 10 WGET_URL="${WEB_SITE}Versions/v3/3.0/$TARBALL"
pascal@1253 11 CONFIG_FILES="/etc/squid"
pascal@1253 12 #DEPENDS="iptables"
pascal@1253 13
pascal@1253 14 # Rules to configure and make the package.
pascal@1253 15 compile_rules()
pascal@1253 16 {
pascal@1253 17 cd $src
pascal@1253 18 ./configure --prefix=/usr --infodir=/usr/share/info \
pascal@1253 19 --sysconfdir=/etc/squid --localstatedir=/var \
pascal@1253 20 --mandir=/usr/share/man $CONFIGURE_ARGS
pascal@1253 21 make
pascal@1253 22 make DESTDIR=$PWD/_pkg install
pascal@1253 23 }
pascal@1253 24
pascal@1253 25 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1253 26 genpkg_rules()
pascal@1253 27 {
pascal@1253 28 mkdir -p $fs/usr/share/errors $fs/var/cache/squid $fs/var/log/squid
pascal@1253 29 cp -a $_pkg/etc $fs
pascal@1253 30 rm -rf $fs/etc/squid/*.default
pascal@1253 31 cp -a stuff/etc $fs
pascal@1253 32 cp -a $_pkg/var $fs
pascal@1253 33 cp -a $_pkg/usr/bin $fs/usr
pascal@1253 34 cp -a $_pkg/usr/sbin $fs/usr
pascal@1253 35 cp -a $_pkg/usr/libexec $fs/usr
pascal@1253 36 cp -a $_pkg/usr/share/mib.txt $fs/usr/share
pascal@1253 37 cp -a $_pkg/usr/share/icons $fs/usr/share
pascal@1253 38 cp -a $_pkg/usr/share/errors/English $fs/usr/share/errors
pascal@1253 39 cp -a $_pkg/usr/share/errors/French $fs/usr/share/errors
pascal@1253 40 rm -f $fs/etc/*conf*
pascal@1253 41 sed -i -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
pascal@1253 42 -e 's|^access_log /var/logs|access_log /var/log/squid|' \
pascal@1253 43 -e 's|^# cache_store_log /var/logs|cache_store_log /var/cache/squid|' \
pascal@1253 44 -e 's|^# cache_log /var/logs|cache_log /var/cache/squid|' \
pascal@1253 45 -e 's|^# cache_dir ufs /var/cache|cache_dir ufs /var/cache/squid|' \
pascal@1253 46 -e 's|^# pid_filename /var/logs|pid_filename /var/run|' \
pascal@1253 47 -e 's|^coredump_dir /var/logs|coredump_dir /var/cache/squid|' \
pascal@1253 48 $fs/etc/squid/squid.conf
pascal@1253 49 # Package all squid pkgs
pascal@1253 50 for i in $(cd $WOK; ls -d squid-*)
pascal@1253 51 do
pascal@1253 52 tazwok genpkg $i
pascal@1253 53 done
pascal@1253 54 }
pascal@1253 55
pascal@1253 56 # Pre and post install commands for Tazpkg.
pascal@1253 57 post_install()
pascal@1253 58 {
pascal@1253 59 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
pascal@1253 60 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
pascal@1253 61 $(cd $1/ ; find etc/squid -type f)
pascal@1253 62 EOT
pascal@1253 63 chown nobody.nogroup /var/cache/squid /var/log/squid
pascal@1253 64 cat <<EOF
pascal@1253 65 ----
pascal@1253 66 To start $PACKAGE server you can run :
pascal@1253 67
pascal@1253 68 /etc/init.d/$PACKAGE start
pascal@1253 69
pascal@1253 70 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
pascal@1253 71 ----
pascal@1253 72 EOF
pascal@1253 73 }
pascal@1253 74
pascal@1253 75 repack_cleanup()
pascal@1253 76 {
pascal@1253 77 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
pascal@1253 78 }