wok annotate squid/receipt @ rev 11906
squid: Improve package
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Wed Feb 29 22:08:35 2012 +0100 (2012-02-29) |
parents | efa7f405d08c |
children | b2aa205abf59 |
rev | line source |
---|---|
pascal@1253 | 1 # SliTaz package receipt. |
pascal@1253 | 2 |
pascal@1253 | 3 PACKAGE="squid" |
erjo@11792 | 4 VERSION="3.1.19" |
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/" |
slaxemulator@7184 | 10 WGET_URL="${WEB_SITE}Versions/v3/3.1/$TARBALL" |
pascal@1253 | 11 CONFIG_FILES="/etc/squid" |
slaxemulator@9628 | 12 DEPENDS="libsasl libldap libssl libltdl" |
pankso@10793 | 13 BUILD_DEPENDS="perl openssl-dev openldap-dev cyrus-sasl-dev" |
pascal@2440 | 14 SUGGESTED="iptables" |
pascal@1253 | 15 |
pascal@1253 | 16 # Rules to configure and make the package. |
pascal@1253 | 17 compile_rules() |
pascal@1253 | 18 { |
pascal@1253 | 19 cd $src |
pankso@10793 | 20 ./configure \ |
pankso@10793 | 21 --prefix=/usr \ |
pankso@10793 | 22 --sysconfdir=/etc/squid \ |
pankso@10793 | 23 --datadir=/usr/share/squid \ |
pankso@10793 | 24 --libexecdir=/usr/lib/squid \ |
pankso@10793 | 25 --localstatedir=/var \ |
pankso@10793 | 26 --with-logdir=/var/log/squid \ |
pankso@10793 | 27 --disable-poll \ |
pankso@10793 | 28 --disable-snmp \ |
pankso@10793 | 29 --disable-icmp \ |
pankso@10793 | 30 --enable-http-violations \ |
pankso@10793 | 31 --disable-ident-lookups \ |
pankso@10793 | 32 --enable-storeio="aufs,diskd,ufs" \ |
pankso@10793 | 33 --enable-ssl \ |
pankso@10793 | 34 --enable-underscores \ |
pankso@10793 | 35 --enable-ntlm-fail-open \ |
pankso@10793 | 36 --enable-removal-policies="heap,lru" \ |
pankso@10793 | 37 --enable-delay-pools \ |
pankso@10793 | 38 --enable-linux-netfilter \ |
pankso@10793 | 39 --enable-basic-auth-helpers="NCSA,SMB,MSNT,LDAP" \ |
pankso@10793 | 40 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \ |
pankso@10793 | 41 --enable-useragent-log \ |
pankso@10793 | 42 --enable-referer-log \ |
erjo@11906 | 43 --enable-icap-client \ |
pankso@10793 | 44 --with-pthreads ac_cv_header_linux_netfilter_ipv4_h="yes" \ |
pankso@10793 | 45 $CONFIGURE_ARGS && |
gokhlayeh@11574 | 46 make $MAKEFLAGS && make install |
pascal@1253 | 47 } |
pascal@1253 | 48 |
pascal@1253 | 49 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1253 | 50 genpkg_rules() |
pascal@1253 | 51 { |
erjo@4662 | 52 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid $fs/var/log/squid \ |
pankso@10793 | 53 $fs/usr/lib/squid |
pankso@10793 | 54 |
pankso@10793 | 55 touch $fs/var/log/squid/cache.log |
pankso@10793 | 56 |
erjo@11906 | 57 cp -a $install/etc $fs |
pascal@1253 | 58 rm -rf $fs/etc/squid/*.default |
pankso@10793 | 59 cp -a $stuff/etc $fs |
pankso@10793 | 60 |
erjo@11906 | 61 cp -a $install/var $fs |
erjo@11906 | 62 cp -a $install/usr/bin $fs/usr |
erjo@11906 | 63 cp -a $install/usr/sbin $fs/usr |
erjo@11906 | 64 cp -a $install/usr/lib/squid/*kd $fs/usr/lib/squid |
erjo@11906 | 65 cp -a $install/usr/lib/squid/*.cgi $fs/usr/lib/squid |
pankso@10793 | 66 |
erjo@11906 | 67 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid |
erjo@11906 | 68 cp -a $install/usr/share/squid/icons $fs/usr/share/squid |
erjo@11906 | 69 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors |
erjo@11906 | 70 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors |
erjo@11906 | 71 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors |
pankso@10793 | 72 |
pankso@10793 | 73 sed -i \ |
pankso@10793 | 74 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \ |
pascal@1253 | 75 -e 's|^access_log /var/logs|access_log /var/log/squid|' \ |
erjo@11906 | 76 -e 's|^#cache_store_log /var/logs|cache_store_log /var/cache/squid|' \ |
erjo@11906 | 77 -e 's|^#cache_log /var/logs|cache_log /var/cache/squid|' \ |
erjo@11906 | 78 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \ |
erjo@11906 | 79 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \ |
erjo@11906 | 80 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \ |
erjo@11906 | 81 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \ |
erjo@2387 | 82 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \ |
pascal@1253 | 83 $fs/etc/squid/squid.conf |
erjo@11906 | 84 |
erjo@11906 | 85 cat <<EOF>>$fs/etc/squid/squid.conf |
erjo@11906 | 86 |
erjo@11906 | 87 cache_effective_user squid |
erjo@11906 | 88 cache_effective_group squid |
erjo@11906 | 89 |
erjo@11906 | 90 access_log /var/log/squid |
erjo@11906 | 91 EOF |
pascal@1253 | 92 } |
pascal@1253 | 93 |
pascal@1253 | 94 # Pre and post install commands for Tazpkg. |
pascal@1253 | 95 post_install() |
pascal@1253 | 96 { |
erjo@2530 | 97 local root |
erjo@11906 | 98 local user |
erjo@11906 | 99 local group |
erjo@11906 | 100 |
erjo@11906 | 101 user=squid |
erjo@11906 | 102 group=squid |
erjo@11906 | 103 |
erjo@11906 | 104 if ! grep -q $user $1/etc/passwd; then |
erjo@11906 | 105 echo -n "Adding user/group $user..." |
erjo@11906 | 106 chroot $1/ addgroup -S $group |
erjo@11906 | 107 chroot $1/ adduser -S -D -H -G $group $user |
erjo@11906 | 108 status |
erjo@11906 | 109 fi |
erjo@11906 | 110 |
erjo@11906 | 111 |
erjo@11906 | 112 # Set perms for files and directories |
erjo@11906 | 113 chroot $1/ chown -R ${user}.${group} /var/log/squid \ |
erjo@11906 | 114 /var/cache/squid |
erjo@11906 | 115 |
pascal@1253 | 116 cat <<EOF |
pascal@1253 | 117 ---- |
pascal@1253 | 118 To start $PACKAGE server you can run : |
pascal@1253 | 119 |
pascal@1253 | 120 /etc/init.d/$PACKAGE start |
pascal@1253 | 121 |
pascal@1253 | 122 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf |
pascal@1253 | 123 ---- |
pascal@1253 | 124 EOF |
pascal@1253 | 125 } |
erjo@2387 | 126 |
erjo@11906 | 127 |
erjo@2387 | 128 post_remove() |
erjo@2387 | 129 { |
erjo@2387 | 130 echo "Removing stalled files..." |
erjo@2387 | 131 test -d /var/cache/squid && rm -rf /var/cache/squid |
erjo@2387 | 132 test -d /var/log/squid && rm -rf /var/log/squid |
erjo@11906 | 133 test -d /usr/share/squid && rm -rf /usr/share/squid |
erjo@11906 | 134 |
erjo@11906 | 135 echo "Removing user/group squid" |
erjo@11906 | 136 deluser squid |
erjo@2387 | 137 } |