wok-next view squid/receipt @ rev 20587

Up librsync (2.0.2)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Apr 14 15:01:16 2018 +0300 (2018-04-14)
parents e6615350078d
children 10df65db91ad
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 WEB_SITE="http://www.squid-cache.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
12 WGET_URL="${WEB_SITE}Versions/v3/${VERSION%.*}/$TARBALL"
14 BUILD_DEPENDS="perl openssl-dev openldap-dev cyrus-sasl-dev libcap-dev"
15 SPLIT="squid squid-auth-helpers squid-langpack"
17 compile_rules() {
18 touch scripts/boilerplate.h
20 ./configure \
21 --sysconfdir=/etc/squid \
22 --datadir=/usr/share/squid \
23 --libexecdir=/usr/lib/squid \
24 --with-logdir=/var/log/squid \
25 --with-openssl \
26 --disable-poll \
27 --disable-snmp \
28 --disable-icmp \
29 --enable-http-violations \
30 --disable-ident-lookups \
31 --enable-storeio="aufs,diskd,ufs" \
32 --enable-ssl \
33 --enable-ssl-crtd \
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 &&
47 make install
48 }
50 genpkg_rules() {
51 case $PACKAGE in
52 squid)
53 CONFIG_FILES="/etc/squid"
54 DEPENDS="libsasl libldap openssl libltdl"
55 SUGGESTED="iptables"
56 mkdir -p $fs/usr/share/squid/errors $fs/var/cache/squid \
57 $fs/var/log/squid $fs/usr/lib/squid $fs/etc/squid/conf.d
59 touch $fs/var/log/squid/cache.log
61 cp -a $install/etc $fs
62 rm -rf $fs/etc/squid/*.default
63 cp -a $stuff/etc $fs
65 cp -a $install/var $fs
66 cp -a $install/usr/bin $fs/usr
67 cp -a $install/usr/sbin $fs/usr
68 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid
70 # Remove auth libs
71 rm -f $fs/usr/lib/squid/*_auth*
73 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid
74 cp -a $install/usr/share/squid/icons $fs/usr/share/squid
75 cp -a $install/usr/share/squid/errors/templates $fs/usr/share/squid/errors
76 cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors
77 cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors
79 sed -i \
80 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
81 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \
82 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \
83 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \
84 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
85 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
86 $fs/etc/squid/squid.conf
88 cat <<EOF>>$fs/etc/squid/squid.conf
90 cache_effective_user squid
91 cache_effective_group squid
93 access_log /var/log/squid/access.log
94 cache_log /var/log/squid/cache.log
95 cache_store_log /var/log/squid/store.log
97 include /etc/squid/conf.d/*.conf
98 EOF
99 ;;
100 squid-auth-helpers)
101 CAT="network|Web/ftp proxy."
102 DEPENDS="squid libldap libsasl openssl libkrb5 libcomerr3"
103 mkdir -p $fs/usr/lib/squid
104 cp -a $install/usr/lib/squid/*_auth* $fs/usr/lib/squid
105 ;;
106 squid-langpack)
107 CAT="network|Web/ftp proxy language pack."
108 DEPENDS="squid"
109 mkdir -p $fs/usr/share
110 cp -a $install/usr/share/squid/errors $fs/usr/share
111 rm -rf $fs/usr/share/squid/errors/en*
112 rm -rf $fs/usr/share/squid/errors/fr*
113 ;;
114 esac
115 }
117 post_install_squid() {
118 local user=squid group=squid
120 if ! grep -q $user "$1/etc/passwd"; then
121 chroot "$1/" addgroup -S $group
122 chroot "$1/" adduser -S -D -H -G $group $user
123 fi
125 # Set perms for files and directories
126 chroot "$1/" chown -R $user:$group /var/log/squid /var/cache/squid
128 [ -n "$quiet" ] || cat <<EOF
130 .----------------------------------------------.
131 | To start squid server you can run: |
132 | /etc/init.d/squid start |
133 | |
134 | Or add squid to RUN_DAEMONS in /etc/rcS.conf |
135 '----------------------------------------------'
136 EOF
137 }
139 post_remove_squid() {
140 # Removing stalled files...
141 test -d /var/cache/squid && rm -rf /var/cache/squid
142 test -d /var/log/squid && rm -rf /var/log/squid
143 test -d /usr/share/squid && rm -rf /usr/share/squid
145 # Removing user/group squid
146 deluser squid
147 }