Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/squid/
Date: Thu, 29 Sep 2022 02:15:08
Message-Id: 1664417677.69e685162ba2ccf86cf04e7ba544718bc9ae41d4.sam@gentoo
1 commit: 69e685162ba2ccf86cf04e7ba544718bc9ae41d4
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 24 06:19:24 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 29 02:14:37 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69e68516
7
8 net-proxy/squid: add 5.7
9
10 Bug: https://bugs.gentoo.org/858845
11 Bug: https://bugs.gentoo.org/872551
12 Closes: https://bugs.gentoo.org/706126
13 Closes: https://bugs.gentoo.org/869968
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 net-proxy/squid/Manifest | 1 +
17 net-proxy/squid/squid-5.7.ebuild | 362 +++++++++++++++++++++++++++++++++++++++
18 2 files changed, 363 insertions(+)
19
20 diff --git a/net-proxy/squid/Manifest b/net-proxy/squid/Manifest
21 index d23055634c98..eaa305e9bbbc 100644
22 --- a/net-proxy/squid/Manifest
23 +++ b/net-proxy/squid/Manifest
24 @@ -1,3 +1,4 @@
25 DIST squid-4.15.tar.xz 2454176 BLAKE2B 3cb08c806f03fcddd7233b05986434d2be3e62a50d006eb3f84bbc5b894ee3641929551d00a1800d6676add62f967067ec62b5b7c41d767766eeab5dfc17980e SHA512 8f0ce6e30dd9173927e8133618211ffb865fb5dde4c63c2fb465e2efccda4a6efb33f2c0846870c9b915340aff5f59461a60171882bcc0c890336b846fe60bd1
26 DIST squid-4.17.tar.xz 2464204 BLAKE2B e227dfbac846dff66f04c6c72d81d667076107653721d14804f079518cef68efc53f5404fbe3306efb0c775a10638661c300a8e7cd3d7ab43c0e57a344387674 SHA512 cea36de10f128f5beb51bdc89604c16af3a820a5ac27284b2aa181ac87144930489688e1d85ce357fe1ed8a4e96e300277b95034a2475cbf86c9d6923ddf7c0a
27 DIST squid-5.4.1.tar.xz 2561444 BLAKE2B 3281f592c342b59a1017f4c0829543c857d61c4d1e191461f6e69bda2dc61ff59d5b92a04744dcebb75bd1b5d85c214c1f0bea78a791033a50f29891b6995fb8 SHA512 d53e64e8c44cfc978307f3965c52889d238121735fd201a8286139f974d5db9af41fe886d64e57dfacc87b777f5940cd6123a6e178d12530117cace945a9f6c1
28 +DIST squid-5.7.tar.xz 2566560 BLAKE2B 4a403ca4f94034356922ea1a4feffd5f5289e2aadbe1585bd04e83ee89712227ce04c53f7e05c10f7c8ac6be67a265a32b47032e7b56e929a172772fa41d5299 SHA512 624a39041a6ceda6c470dc0937616f1aa67200f3db02b4d74095d8d706ed31d6df5e0417dcacde45f6be40b617bee018849793d52c96a626aab32a2b182972aa
29
30 diff --git a/net-proxy/squid/squid-5.7.ebuild b/net-proxy/squid/squid-5.7.ebuild
31 new file mode 100644
32 index 000000000000..f3ad18c4f62d
33 --- /dev/null
34 +++ b/net-proxy/squid/squid-5.7.ebuild
35 @@ -0,0 +1,362 @@
36 +# Copyright 1999-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI="8"
40 +
41 +inherit autotools flag-o-matic linux-info pam systemd toolchain-funcs
42 +
43 +DESCRIPTION="A full-featured web proxy cache"
44 +HOMEPAGE="http://www.squid-cache.org/"
45 +
46 +MY_PV_MAJOR=$(ver_cut 1)
47 +# Upstream patch ID for the most recent bug-fixed update to the formal release.
48 +#r=-20181117-r0022167
49 +r=
50 +if [[ -z ${r} ]]; then
51 + SRC_URI="http://www.squid-cache.org/Versions/v${MY_PV_MAJOR}/${P}.tar.xz"
52 +else
53 + SRC_URI="http://www.squid-cache.org/Versions/v${MY_PV_MAJOR}/${P}${r}.tar.bz2"
54 + S="${S}${r}"
55 +fi
56 +
57 +LICENSE="GPL-2"
58 +SLOT="0"
59 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
60 +IUSE="caps gnutls pam ldap samba sasl kerberos nis radius ssl snmp selinux logrotate test ecap"
61 +IUSE+=" esi ssl-crtd mysql postgres sqlite systemd perl qos tproxy +htcp +wccp +wccpv2"
62 +RESTRICT="!test? ( test )"
63 +REQUIRED_USE="tproxy? ( caps ) qos? ( caps )"
64 +
65 +DEPEND="
66 + acct-group/squid
67 + acct-user/squid
68 + dev-libs/libltdl
69 + sys-libs/tdb
70 + virtual/libcrypt:=
71 + caps? ( >=sys-libs/libcap-2.16 )
72 + ecap? ( net-libs/libecap:1 )
73 + esi? (
74 + dev-libs/expat
75 + dev-libs/libxml2
76 + )
77 + ldap? ( net-nds/openldap:= )
78 + gnutls? ( >=net-libs/gnutls-3.1.5:= )
79 + logrotate? ( app-admin/logrotate )
80 + nis? (
81 + net-libs/libtirpc:=
82 + net-libs/libnsl:=
83 + )
84 + kerberos? ( virtual/krb5 )
85 + pam? ( sys-libs/pam )
86 + qos? ( net-libs/libnetfilter_conntrack )
87 + ssl? (
88 + dev-libs/nettle:=
89 + !gnutls? (
90 + dev-libs/openssl:=
91 + )
92 + )
93 + sasl? ( dev-libs/cyrus-sasl )
94 + systemd? ( sys-apps/systemd:= )
95 +"
96 +RDEPEND="
97 + !!<net-proxy/squid-5
98 + ${DEPEND}
99 + mysql? ( dev-perl/DBD-mysql )
100 + postgres? ( dev-perl/DBD-Pg )
101 + perl? ( dev-lang/perl )
102 + samba? ( net-fs/samba )
103 + selinux? ( sec-policy/selinux-squid )
104 + sqlite? ( dev-perl/DBD-SQLite )
105 +"
106 +BDEPEND="
107 + dev-lang/perl
108 + ecap? ( virtual/pkgconfig )
109 + test? ( dev-util/cppunit )
110 +"
111 +
112 +PATCHES=(
113 + "${FILESDIR}"/${PN}-5.3-gentoo.patch
114 + "${FILESDIR}"/${PN}-4.17-use-system-libltdl.patch
115 +)
116 +
117 +pkg_pretend() {
118 + if use tproxy; then
119 + local CONFIG_CHECK="~NF_CONNTRACK ~NETFILTER_XT_MATCH_SOCKET ~NETFILTER_XT_TARGET_TPROXY"
120 + linux-info_pkg_setup
121 + fi
122 +}
123 +
124 +src_prepare() {
125 + default
126 +
127 + # Fixup various paths
128 + sed -i -e 's:/usr/local/squid/etc:/etc/squid:' \
129 + INSTALL QUICKSTART \
130 + scripts/fileno-to-pathname.pl \
131 + scripts/check_cache.pl \
132 + tools/cachemgr.cgi.8 \
133 + tools/purge/conffile.hh \
134 + tools/purge/purge.1 || die
135 + sed -i -e 's:/usr/local/squid/sbin:/usr/sbin:' \
136 + INSTALL QUICKSTART || die
137 + sed -i -e 's:/usr/local/squid/var/cache:/var/cache/squid:' \
138 + QUICKSTART || die
139 + sed -i -e 's:/usr/local/squid/var/logs:/var/log/squid:' \
140 + QUICKSTART \
141 + src/log/access_log.cc || die
142 + sed -i -e 's:/usr/local/squid/logs:/var/log/squid:' \
143 + src/log/access_log.cc || die
144 + sed -i -e 's:/usr/local/squid/libexec:/usr/libexec/squid:' \
145 + src/acl/external/unix_group/ext_unix_group_acl.8 \
146 + src/acl/external/session/ext_session_acl.8 || die
147 + sed -i -e 's:/usr/local/squid/cache:/var/cache/squid:' \
148 + scripts/check_cache.pl || die
149 + # /var/run/squid to /run/squid
150 + sed -i -e 's:$(localstatedir)::' \
151 + src/ipc/Makefile.am || die
152 + sed -i 's:/var/run/:/run/:g' tools/systemd/squid.service || die
153 +
154 + sed -i -e 's:_LTDL_SETUP:LTDL_INIT([installable]):' \
155 + libltdl/configure.ac || die
156 +
157 + eautoreconf
158 +}
159 +
160 +src_configure() {
161 + local myeconfargs=(
162 + --datadir=/usr/share/squid
163 + --libexecdir=/usr/libexec/squid
164 + --localstatedir=/var
165 + --sysconfdir=/etc/squid
166 + --with-default-user=squid
167 + --with-logdir=/var/log/squid
168 + --with-pidfile=/run/squid.pid
169 +
170 + --enable-build-info="Gentoo ${PF} (r: ${r:-NONE})"
171 + --enable-log-daemon-helpers
172 + --enable-url-rewrite-helpers
173 + --enable-cache-digests
174 + --enable-delay-pools
175 + --enable-disk-io
176 + --enable-eui
177 + --enable-icmp
178 + --enable-ipv6
179 + --enable-follow-x-forwarded-for
180 + --enable-removal-policies="lru,heap"
181 + --disable-strict-error-checking
182 + --disable-arch-native
183 +
184 + --with-large-files
185 + --with-build-environment=default
186 +
187 + --with-tdb
188 +
189 + --without-included-ltdl
190 + --with-ltdl-include="${ESYSROOT}"/usr/include
191 + --with-ltdl-lib="${ESYSROOT}"/usr/$(get_libdir)
192 +
193 + $(use_with caps libcap)
194 + $(use_enable snmp)
195 + $(use_with ssl openssl)
196 + $(use_with ssl nettle)
197 + $(use_with gnutls)
198 + $(use_enable ssl-crtd)
199 + $(use_with systemd)
200 + $(use_with test cppunit)
201 + $(use_enable ecap)
202 + $(use_enable esi)
203 + $(use_enable esi expat)
204 + $(use_enable esi libxml2)
205 + $(use_enable htcp)
206 + $(use_enable wccp)
207 + $(use_enable wccpv2)
208 + )
209 +
210 + # Basic modules
211 + local basic_modules=(
212 + NCSA
213 + POP3
214 + getpwnam
215 +
216 + $(usev samba 'SMB')
217 + $(usev ldap 'SMB_LM LDAP')
218 + $(usev pam 'PAM')
219 + $(usev sasl 'SASL')
220 + $(usev nis 'NIS')
221 + $(usev radius 'RADIUS')
222 + )
223 +
224 + use nis && append-cppflags "-I${ESYSROOT}/usr/include/tirpc"
225 +
226 + if use mysql || use postgres || use sqlite; then
227 + basic_modules+=( DB )
228 + fi
229 +
230 + # Digests
231 + local digest_modules=(
232 + file
233 +
234 + $(usev ldap 'LDAP eDirectory')
235 + )
236 +
237 + # Kerberos
238 + local negotiate_modules=( none )
239 +
240 + myeconfargs+=( --without-mit-krb5 --without-heimdal-krb5 )
241 +
242 + if use kerberos; then
243 + negotiate_modules=( kerberos wrapper )
244 +
245 + if has_version app-crypt/heimdal; then
246 + myeconfargs+=(
247 + --without-mit-krb5
248 + --with-heimdal-krb5
249 + )
250 + else
251 + myeconfargs+=(
252 + --with-mit-krb5
253 + --without-heimdal-krb5
254 + )
255 + fi
256 + fi
257 +
258 + # NTLM modules
259 + local ntlm_modules=(
260 + none
261 + $(usev samba 'SMB_LM')
262 + )
263 +
264 + # External helpers
265 + local ext_helpers=(
266 + file_userip
267 + session
268 + unix_group
269 + delayer
270 + time_quota
271 +
272 + $(usev samba 'wbinfo_group')
273 + $(usev ldap 'LDAP_group eDirectory_userip')
274 + )
275 +
276 + use ldap && use kerberos && ext_helpers+=( kerberos_ldap_group )
277 + if use mysql || use postgres || use sqlite; then
278 + ext_helpers+=( SQL_session )
279 + fi
280 +
281 + # Storage modules
282 + local storeio_modules=(
283 + aufs
284 + diskd
285 + rock
286 + ufs
287 + )
288 +
289 + #
290 + local transparent
291 + if use kernel_linux; then
292 + myeconfargs+=(
293 + --enable-linux-netfilter
294 + $(usev qos '--enable-zph-qos --with-netfilter-conntrack')
295 + )
296 + fi
297 +
298 + tc-export_build_env BUILD_CXX
299 + export BUILDCXX="${BUILD_CXX}"
300 + export BUILDCXXFLAGS="${BUILD_CXXFLAGS}"
301 + tc-export CC AR
302 +
303 + # Should be able to drop this workaround with newer versions.
304 + # https://bugs.squid-cache.org/show_bug.cgi?id=4224
305 + tc-is-cross-compiler && export squid_cv_gnu_atomics=no
306 +
307 + # Bug #719662
308 + append-atomic-flags
309 +
310 + print_options_without_comma() {
311 + # IFS as ',' will cut off any trailing commas
312 + (
313 + IFS=','
314 + options=( $(printf "%s," "${@}") )
315 + echo "${options[*]}"
316 + )
317 + }
318 +
319 + myeconfargs+=(
320 + --enable-storeio=$(print_options_without_comma "${storeio_modules[@]}" )
321 + --enable-auth-basic=$(print_options_without_comma "${basic_modules[@]}" )
322 + --enable-auth-digest=$(print_options_without_comma "${digest_modules[@]}" )
323 + --enable-auth-ntlm=$(print_options_without_comma "${ntlm_modules[@]}" )
324 + --enable-auth-negotiate=$(print_options_without_comma "${negotiate_modules[@]}" )
325 + --enable-external-acl-helpers=$(print_options_without_comma "${ext_helpers[@]}" )
326 + )
327 +
328 + econf "${myeconfargs[@]}"
329 +}
330 +
331 +src_install() {
332 + default
333 +
334 + systemd_dounit tools/systemd/squid.service
335 +
336 + # Need suid root for looking into /etc/shadow
337 + fowners root:squid /usr/libexec/squid/basic_ncsa_auth
338 + fperms 4750 /usr/libexec/squid/basic_ncsa_auth
339 +
340 + if use pam; then
341 + fowners root:squid /usr/libexec/squid/basic_pam_auth
342 + fperms 4750 /usr/libexec/squid/basic_pam_auth
343 + fi
344 +
345 + # Pinger needs suid as well
346 + fowners root:squid /usr/libexec/squid/pinger
347 + fperms 4750 /usr/libexec/squid/pinger
348 +
349 + # These scripts depend on perl
350 + if ! use perl; then
351 + local perl_scripts=(
352 + basic_pop3_auth ext_delayer_acl helper-mux
353 + log_db_daemon security_fake_certverify
354 + storeid_file_rewrite url_lfs_rewrite
355 + )
356 +
357 + local script
358 + for script in "${perl_scripts[@]}"; do
359 + rm "${ED}"/usr/libexec/squid/${script} || die
360 + done
361 + fi
362 +
363 + # Cleanup
364 + rm -r "${D}"/run "${D}"/var/cache || die
365 +
366 + dodoc CONTRIBUTORS CREDITS ChangeLog INSTALL QUICKSTART README SPONSORS doc/*.txt
367 + newdoc src/auth/negotiate/kerberos/README README.kerberos
368 + newdoc src/auth/basic/RADIUS/README README.RADIUS
369 + newdoc src/acl/external/kerberos_ldap_group/README README.kerberos_ldap_group
370 + dodoc RELEASENOTES.html
371 +
372 + if use pam; then
373 + newpamd "${FILESDIR}"/squid.pam squid
374 + fi
375 +
376 + newconfd "${FILESDIR}"/squid.confd-r2 squid
377 + newinitd "${FILESDIR}"/squid.initd-r5 squid
378 +
379 + if use logrotate ; then
380 + insinto /etc/logrotate.d
381 + newins "${FILESDIR}"/squid.logrotate squid
382 + else
383 + exeinto /etc/cron.weekly
384 + newexe "${FILESDIR}"/squid.cron squid.cron
385 + fi
386 +
387 + diropts -m0750 -o squid -g squid
388 + keepdir /var/log/squid /etc/ssl/squid /var/lib/squid
389 +}
390 +
391 +pkg_postinst() {
392 + elog "A good starting point to debug Squid issues is to use 'squidclient mgr:' commands such as 'squidclient mgr:info'."
393 +
394 + if [[ ${#r} -gt 0 ]]; then
395 + elog "You are using a release with the official ${r} patch! Make sure you mention that, or send the output of 'squidclient mgr:info' when asking for support."
396 + fi
397 +}