wok-next view squid/receipt @ rev 20244
Update bdeps: apache-mod-perl, codeblocks, tacacs+, thunar-archive-plugin, tuxpaint, xpenguins
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Nov 07 10:54:15 2017 +0200 (2017-11-07) |
parents | f496af4fe2bf |
children | e6615350078d |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="squid"
4 VERSION="3.5.27"
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"
13 BUILD_DEPENDS="perl openssl-dev openldap-dev cyrus-sasl-dev libcap-dev"
14 SPLIT="squid squid-auth-helpers squid-langpack"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 touch scripts/boilerplate.h
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 --with-openssl \
28 --disable-poll \
29 --disable-snmp \
30 --disable-icmp \
31 --enable-http-violations \
32 --disable-ident-lookups \
33 --enable-storeio="aufs,diskd,ufs" \
34 --enable-ssl \
35 --enable-ssl-crtd \
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 case $PACKAGE in
55 squid)
56 CONFIG_FILES="/etc/squid"
57 DEPENDS="libsasl libldap libssl libltdl"
58 SUGGESTED="iptables"
59 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid \
60 $fs/var/log/squid $fs/usr/lib/squid $fs/etc/squid/conf.d
62 touch $fs/var/log/squid/cache.log
64 cp -a $install/etc $fs
65 rm -rf $fs/etc/squid/*.default
66 cp -a $stuff/etc $fs
68 cp -a $install/var $fs
69 cp -a $install/usr/bin $fs/usr
70 cp -a $install/usr/sbin $fs/usr
71 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid
73 # Remove auth libs
74 rm -f $fs/usr/lib/squid/*_auth*
76 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid
77 cp -a $install/usr/share/squid/icons $fs/usr/share/squid
78 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors
79 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors
80 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors
82 sed -i \
83 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
84 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \
85 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \
86 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \
87 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
88 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
89 $fs/etc/squid/squid.conf
91 cat <<EOF>>$fs/etc/squid/squid.conf
93 cache_effective_user squid
94 cache_effective_group squid
96 access_log /var/log/squid/access.log
97 cache_log /var/log/squid/cache.log
98 cache_store_log /var/log/squid/store.log
100 include /etc/squid/conf.d/*.conf
101 EOF
102 ;;
103 squid-auth-helpers)
104 CAT="network|Web/ftp proxy."
105 DEPENDS="squid libldap libsasl libssl libcrypto libkrb5 libcomerr3"
106 mkdir -p $fs/usr/lib/squid
107 cp -a $install/usr/lib/squid/*_auth* $fs/usr/lib/squid
108 ;;
109 squid-langpack)
110 CAT="network|Web/ftp proxy language pack."
111 DEPENDS="squid"
112 mkdir -p $fs/usr/share
113 cp -a $install/usr/share/squid/errors $fs/usr/share
114 rm -rf $fs/usr/share/squid/errors/en*
115 rm -rf $fs/usr/share/squid/errors/fr*
116 ;;
117 esac
118 }
120 # Pre and post install commands for Tazpkg.
121 post_install_squid()
122 {
123 local user
124 local group
126 user=squid
127 group=squid
129 if ! grep -q $user "$1/etc/passwd"; then
130 echo -n "Adding user/group $user..."
131 chroot "$1/" addgroup -S $group
132 chroot "$1/" adduser -S -D -H -G $group $user
133 status
134 fi
137 # Set perms for files and directories
138 chroot "$1/" chown -R ${user}.${group} /var/log/squid \
139 /var/cache/squid
141 cat <<EOF
142 ----
143 To start $PACKAGE server you can run :
145 /etc/init.d/$PACKAGE start
147 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
148 ----
149 EOF
150 }
153 post_remove_squid()
154 {
155 echo "Removing stalled files..."
156 test -d /var/cache/squid && rm -rf /var/cache/squid
157 test -d /var/log/squid && rm -rf /var/log/squid
158 test -d /usr/share/squid && rm -rf /usr/share/squid
160 echo "Removing user/group squid"
161 deluser squid
162 }