wok view squid/receipt @ rev 25672

Up minidlna (1.3.3), phpmyadmin (5.2.1), pidgin (2.14.13), redis (7.2.4), rsync (3.2.7), rust (1.76.0), screen (4.9.1), squashfs (4.6.1), squid (6.7), stunnel (5.72), tcpdump (4.99.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 26 14:07:44 2024 +0000 (2 months ago)
parents b81ceff0b056
children
line source
1 # SliTaz package receipt.
3 PACKAGE="squid"
4 VERSION="6.7"
5 CATEGORY="network"
6 SHORT_DESC="The Squid proxy caching server."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://www.squid-cache.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="${WEB_SITE}Versions/v${VERSION%.*}/$TARBALL"
14 SUGGESTED="iptables"
15 DEPENDS="expat gcc83-lib-base gnutls libatomic libldap libltdl libsasl libssl libxml2"
16 BUILD_DEPENDS="cyrus-sasl-dev expat-dev gcc83 gnutls-dev libcap-dev libdb
17 libxml2-dev openssl-dev openldap-dev perl"
19 CONFIG_FILES="/etc/squid"
21 # What is the latest version available today?
22 current_version()
23 {
24 wget -O - https://github.com/squid-cache/squid/tags 2>/dev/null | \
25 sed '/tag\//!d;s|.*tag/[A-Z_]*||;s|".*||;s|_|.|g;q'
26 }
28 # Rules to configure and make the package.
29 compile_rules()
30 {
31 ./configure \
32 CC=gcc-83 \
33 CXX=g++-83 \
34 --prefix=/usr \
35 --sysconfdir=/etc/squid \
36 --datadir=/usr/share/squid \
37 --libexecdir=/usr/lib/squid \
38 --localstatedir=/var \
39 --with-logdir=/var/log/squid \
40 --disable-icmp \
41 --disable-ident-lookups \
42 --disable-poll \
43 --disable-snmp \
44 --enable-basic-auth-helpers="NCSA,SMB,MSNT,LDAP" \
45 --enable-delay-pools \
46 --enable-http-violations \
47 --enable-icap-client \
48 --enable-linux-netfilter \
49 --enable-ntlm-auth-helpers="smb_lm,no_check,fakeauth" \
50 --enable-ntlm-fail-open \
51 --enable-referer-log \
52 --enable-removal-policies="heap,lru" \
53 --enable-ssl \
54 --enable-ssl-crtd \
55 --enable-storeio="aufs,diskd,ufs" \
56 --enable-underscores \
57 --enable-useragent-log \
58 --with-pthreads ac_cv_header_linux_netfilter_ipv4_h="yes" \
59 --with-openssl \
60 $CONFIGURE_ARGS &&
61 make $MAKEFLAGS &&
62 make install
63 }
65 # Rules to gen a SliTaz package suitable for Tazpkg.
66 genpkg_rules()
67 {
68 mkdir -p $fs/usr/share/squid/errors
69 mkdir -p $fs/var/cache/squid
70 mkdir -p $fs/var/log/squid
71 mkdir -p $fs/usr/lib/squid
72 mkdir -p $fs/etc/squid/conf.d
74 touch $fs/var/log/squid/cache.log
76 cp -a $install/etc $fs
77 rm -rf $fs/etc/squid/*.default
78 cp -a $stuff/etc $fs
80 cp -a $install/var $fs
81 cp -a $install/usr/bin $fs/usr
82 cp -a $install/usr/sbin $fs/usr
83 cp -a $install/usr/lib/squid/* $fs/usr/lib/squid
85 # Remove auth libs
86 rm -f $fs/usr/lib/squid/*_auth*
88 cp -a $install/usr/share/squid/mib.txt $fs/usr/share/squid
89 cp -a $install/usr/share/squid/icons $fs/usr/share/squid
90 cp -a $install/usr/share/squid/errors/templates \
91 $fs/usr/share/squid/errors
92 #cp -a $install/usr/share/squid/errors/en* $fs/usr/share/squid/errors
93 #cp -a $install/usr/share/squid/errors/fr* $fs/usr/share/squid/errors
95 sed -i \
96 -e 's/TAG: visible_hostname/TAG: visible_hostname\nvisible_hostname slitaz/' \
97 -e 's|^#cache_dir ufs /var/cache 100|cache_dir ufs /var/cache/squid 256|' \
98 -e 's|^#pid_filename /var/logs|pid_filename /var/run/squid.pid|' \
99 -e "s|^coredump_dir.*|coredump_dir /var/cache/squid|" \
100 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
101 -e 's|^# error_directory|error_directory /usr/share/squid/errors/French|' \
102 $fs/etc/squid/squid.conf
104 cat <<EOF>>$fs/etc/squid/squid.conf
106 cache_effective_user squid
107 cache_effective_group squid
109 access_log /var/log/squid/access.log
110 cache_log /var/log/squid/cache.log
111 cache_store_log /var/log/squid/store.log
113 include /etc/squid/conf.d/*.conf
114 EOF
115 }
117 # Pre and post install commands for Tazpkg.
118 post_install()
119 {
120 local user
121 local group
123 user=squid
124 group=squid
126 if ! grep -q $user "$1/etc/passwd"
127 then
128 echo -n "Adding user/group $user..."
129 chroot "$1/" addgroup -S $group
130 chroot "$1/" adduser -S -D -H -G $group $user
131 status
132 fi
135 # Set permissions for files and directories
136 chroot "$1/" chown -R ${user}.${group} /var/log/squid
137 chroot "$1/" chown -R ${user}.${group} /var/cache/squid
139 cat <<EOF
140 ----
141 To start $PACKAGE server you can run :
143 /etc/init.d/$PACKAGE start
145 Or add $PACKAGE to RUN_DAEMONS in /etc/rcS.conf
146 ----
147 EOF
148 }
151 post_remove()
152 {
153 echo "Removing stalled files..."
154 test -d /var/cache/squid &&
155 rm -rf /var/cache/squid
156 test -d /var/log/squid &&
157 rm -rf /var/log/squid
158 test -d /usr/share/squid &&
159 rm -rf /usr/share/squid
161 echo "Removing user and group squid"
162 deluser squid
163 }