wok-6.x view squid/receipt @ rev 14402

efreet: update deps+bdeps
author Dominique Corbex <domcox@slitaz.org>
date Tue Apr 23 18:25:30 2013 +0200 (2013-04-23)
parents b2aa205abf59
children ad43c2613ba3
line source
1 # SliTaz package receipt.
3 PACKAGE="squid"
4 VERSION="3.1.19"
5 CATEGORY="network"
6 SHORT_DESC="Web/ftp proxy."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 WEB_SITE="http://www.squid-cache.org/"
10 WGET_URL="${WEB_SITE}Versions/v3/3.1/$TARBALL"
11 CONFIG_FILES="/etc/squid"
12 DEPENDS="libsasl libldap libssl libltdl"
13 BUILD_DEPENDS="perl openssl-dev openldap-dev cyrus-sasl-dev libcap-dev"
14 SUGGESTED="iptables"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 ./configure \
21 --prefix=/usr \
22 --sysconfdir=/etc/squid \
23 --datadir=/usr/share/squid \
24 --libexecdir=/usr/lib/squid \
25 --localstatedir=/var \
26 --with-logdir=/var/log/squid \
27 --disable-poll \
28 --disable-snmp \
29 --disable-icmp \
30 --enable-http-violations \
31 --disable-ident-lookups \
32 --enable-storeio="aufs,diskd,ufs" \
33 --enable-ssl \
34 --enable-underscores \
35 --enable-ntlm-fail-open \
36 --enable-removal-policies="heap,lru" \
37 --enable-delay-pools \
38 --enable-linux-netfilter \
39 --enable-basic-auth-helpers="NCSA,SMB,MSNT,LDAP" \
40 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \
41 --enable-useragent-log \
42 --enable-referer-log \
43 --enable-icap-client \
44 --with-pthreads ac_cv_header_linux_netfilter_ipv4_h="yes" \
45 $CONFIGURE_ARGS &&
46 make $MAKEFLAGS && make install
47 }
49 # Rules to gen a SliTaz package suitable for Tazpkg.
50 genpkg_rules()
51 {
52 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid $fs/var/log/squid \
53 $fs/usr/lib/squid $fs/etc/squid/conf.d
55 touch $fs/var/log/squid/cache.log
57 cp -a $install/etc $fs
58 rm -rf $fs/etc/squid/*.default
59 cp -a $stuff/etc $fs
61 cp -a $install/var $fs
62 cp -a $install/usr/bin $fs/usr
63 cp -a $install/usr/sbin $fs/usr
64 cp -a $install/usr/lib/squid/*kd $fs/usr/lib/squid
65 cp -a $install/usr/lib/squid/*.cgi $fs/usr/lib/squid
67 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid
68 cp -a $install/usr/share/squid/icons $fs/usr/share/squid
69 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors
70 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors
71 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors
73 sed -i \
74 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
75 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \
76 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \
77 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \
78 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
79 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
80 $fs/etc/squid/squid.conf
82 cat <<EOF>>$fs/etc/squid/squid.conf
84 cache_effective_user squid
85 cache_effective_group squid
87 access_log /var/log/squid/access.log
88 cache_log /var/log/squid/cache.log
89 cache_store_log /var/log/squid/store.log
91 include /etc/squid/conf.d/*.conf
92 EOF
93 }
95 # Pre and post install commands for Tazpkg.
96 post_install()
97 {
98 local root
99 local user
100 local group
102 user=squid
103 group=squid
105 if ! grep -q $user $1/etc/passwd; then
106 echo -n "Adding user/group $user..."
107 chroot $1/ addgroup -S $group
108 chroot $1/ adduser -S -D -H -G $group $user
109 status
110 fi
113 # Set perms for files and directories
114 chroot $1/ chown -R ${user}.${group} /var/log/squid \
115 /var/cache/squid
117 cat <<EOF
118 ----
119 To start $PACKAGE server you can run :
121 /etc/init.d/$PACKAGE start
123 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
124 ----
125 EOF
126 }
129 post_remove()
130 {
131 echo "Removing stalled files..."
132 test -d /var/cache/squid && rm -rf /var/cache/squid
133 test -d /var/log/squid && rm -rf /var/log/squid
134 test -d /usr/share/squid && rm -rf /usr/share/squid
136 echo "Removing user/group squid"
137 deluser squid
138 }