wok annotate squid/receipt @ rev 16776

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