wok-6.x view squid/receipt @ rev 18360
Up ht (2.1.0)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Sep 16 13:16:09 2015 +0200 (2015-09-16) |
parents | 7896f0694ef6 |
children | 9e01bc6321ea |
line source
1 # SliTaz package receipt.
3 PACKAGE="squid"
4 VERSION="3.4.2"
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-ssl-crtd \
37 --enable-underscores \
38 --enable-ntlm-fail-open \
39 --enable-removal-policies="heap,lru" \
40 --enable-delay-pools \
41 --enable-linux-netfilter \
42 --enable-basic-auth-helpers="NCSA,SMB,MSNT,LDAP" \
43 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \
44 --enable-useragent-log \
45 --enable-referer-log \
46 --enable-icap-client \
47 --with-pthreads ac_cv_header_linux_netfilter_ipv4_h="yes" \
48 $CONFIGURE_ARGS &&
49 make $MAKEFLAGS && make install
50 }
52 # Rules to gen a SliTaz package suitable for Tazpkg.
53 genpkg_rules()
54 {
55 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid $fs/var/log/squid \
56 $fs/usr/lib/squid $fs/etc/squid/conf.d
58 touch $fs/var/log/squid/cache.log
60 cp -a $install/etc $fs
61 rm -rf $fs/etc/squid/*.default
62 cp -a $stuff/etc $fs
64 cp -a $install/var $fs
65 cp -a $install/usr/bin $fs/usr
66 cp -a $install/usr/sbin $fs/usr
67 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid
69 # Remove auth libs
70 rm -f $fs/usr/lib/squid/*_auth*
72 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid
73 cp -a $install/usr/share/squid/icons $fs/usr/share/squid
74 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors
75 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors
76 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors
78 sed -i \
79 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
80 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \
81 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \
82 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \
83 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
84 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
85 $fs/etc/squid/squid.conf
87 cat <<EOF>>$fs/etc/squid/squid.conf
89 cache_effective_user squid
90 cache_effective_group squid
92 access_log /var/log/squid/access.log
93 cache_log /var/log/squid/cache.log
94 cache_store_log /var/log/squid/store.log
96 include /etc/squid/conf.d/*.conf
97 EOF
98 }
100 # Pre and post install commands for Tazpkg.
101 post_install()
102 {
103 local root
104 local user
105 local group
107 user=squid
108 group=squid
110 if ! grep -q $user $1/etc/passwd; then
111 echo -n "Adding user/group $user..."
112 chroot $1/ addgroup -S $group
113 chroot $1/ adduser -S -D -H -G $group $user
114 status
115 fi
118 # Set perms for files and directories
119 chroot $1/ chown -R ${user}.${group} /var/log/squid \
120 /var/cache/squid
122 cat <<EOF
123 ----
124 To start $PACKAGE server you can run :
126 /etc/init.d/$PACKAGE start
128 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
129 ----
130 EOF
131 }
134 post_remove()
135 {
136 echo "Removing stalled files..."
137 test -d /var/cache/squid && rm -rf /var/cache/squid
138 test -d /var/log/squid && rm -rf /var/log/squid
139 test -d /usr/share/squid && rm -rf /usr/share/squid
141 echo "Removing user/group squid"
142 deluser squid
143 }