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