Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/
Date: Sat, 10 Sep 2022 00:29:52
Message-Id: 1662769360.da2cef35a1534d057c97bf4eb0e4dcd52f1f8c19.sam@gentoo
1 commit: da2cef35a1534d057c97bf4eb0e4dcd52f1f8c19
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 10 00:17:10 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 10 00:22:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da2cef35
7
8 app-shells/bash: add 5.2_rc4
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 app-shells/bash/Manifest | 2 +
13 app-shells/bash/bash-5.2_rc4.ebuild | 348 ++++++++++++++++++++++++++++++++++++
14 2 files changed, 350 insertions(+)
15
16 diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
17 index 7cafbac2dfb8..87f6925ef845 100644
18 --- a/app-shells/bash/Manifest
19 +++ b/app-shells/bash/Manifest
20 @@ -25,6 +25,8 @@ DIST bash-5.2-rc2.tar.gz 10925605 BLAKE2B 839be13e89b679bbcfca19f2e331e471639cea
21 DIST bash-5.2-rc2.tar.gz.sig 95 BLAKE2B 446d310659eda48ee27f2982609073904e36e64dc439ef79d172b7326199c71d87e13daad8c069e3f9c20a4db4986a76793a5f7bba0ce1827531fa351eb7b47f SHA512 c9c3e218681ec367562b7c55785a18843d40f1c0cbdd27a5f4c07d94d5e797f7d735ed7652f56f6fcb065e9305508b578d64dde3d83f314c86447fc8d537126f
22 DIST bash-5.2-rc3.tar.gz 10896868 BLAKE2B 32b3345325f50a1883390403eb77105a9f1aacc5c1991bd47b817e9d86dbefa389281a68b758e898018e734a77e61117e581347ebc1f132003ae8b93239e1ac2 SHA512 a8ac061d6815de74c820081e320634f671ad91dace9e3fbcc5dc4b9ab56208c6207cebd4dd6aaf2379c1ff98f6edcd3333f8ca58c6b07f6b2b490a4a632eea36
23 DIST bash-5.2-rc3.tar.gz.sig 95 BLAKE2B b4f87665814943860a64bc3c2102c61147f9047f525e81554c8a46a5366421e13a02052f878f955f775355920ae32af8033a209abf70bd36b64e14177dce5db2 SHA512 e0591d761d2502591edc2e0e330341708104f8d5bdddb7f62d737c5c306c1aa7a4d129d00a197e63d52833a3fc1691a0b6b8060de6e6762afa165a147126d95b
24 +DIST bash-5.2-rc4.tar.gz 10953456 BLAKE2B c39eb9640a08fe3a6e8e61fd7e9f8116b34e5da83fd97afa3abb78164cb70af9774fb2315bbd2507ead33fd38718ca7fcfd4df7ee6d2e564424dce9c5f230640 SHA512 3f00e5872b1c90901446c3d9299d72229f2fb28e7db7659acc52d353e20b34f627ced42e6b02159f499c5885a211aaf55510b9cd145c46f4e0b3cb19237b4bbc
25 +DIST bash-5.2-rc4.tar.gz.sig 95 BLAKE2B 6ae8e4e48fcd821bad7a67a0f1ab8bf4c20c385d8eefceca178d114210a4a95d03ae891039d01efdf15b7849401df61f4748d2baa6ca13b09fe4d23b0132113f SHA512 c44b02fb2e22a8d77bbb09a3712878478fabe287abe5a5a5c40e00cef89a9b516e9e72074f123580b0840e3e62ef9a192096738fa1bd5906acadbfe5cc5e206c
26 DIST bash205b-001 1132 BLAKE2B 0c5eef29777d54ef05957ea3d63b1556fb380bd20c238dc28993d822b37bc4e78ff4048ad069f6b8cd25da77ccdeb7aecd86c4349cb9d81e5e94c7001eeae5e6 SHA512 5ce4357468821b05e747201f3aa57225ad8f540c9e2c87051720490e039c30b478b9b662a68f14a0800fefe40184e4495e2645665200f9d75e9a115b2ac08071
27 DIST bash205b-002 755 BLAKE2B 6a6ed5679d451f02f8104b345c1722d11718ce3b4043b581c17786d40d8da69a34786fb56d0c363dba277b8e9dd33f12f70c9cc73a9fc39ba4a8319406f0458d SHA512 46947b0229478d5c2cfeff68b8ebc00e4ef0c8b94e336ca12f72b4490ba3622c0240c01c17c1641c3b07adc2c64ec94d6d780365e8990768ec8888f3a9526883
28 DIST bash205b-003 2356 BLAKE2B b7887d00d92fd298cd07a15e1c73b516dabd22ecd74c97091636dd97a0cd55024ed698e5cc924c4311d994dd326b1ad074bea35e7650cf9cf4e25c60d2713fa7 SHA512 74528ca5d165b812d299f1c69b47757bd677c0b22ce4217e155cd641708b02364a93c6709fb57b546b376b36da74429a61493921c7c199563da40ddcf1c1f399
29
30 diff --git a/app-shells/bash/bash-5.2_rc4.ebuild b/app-shells/bash/bash-5.2_rc4.ebuild
31 new file mode 100644
32 index 000000000000..847e52506d7f
33 --- /dev/null
34 +++ b/app-shells/bash/bash-5.2_rc4.ebuild
35 @@ -0,0 +1,348 @@
36 +# Copyright 1999-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +# TODO on release:
42 +# - check READLINE_VER, obviously
43 +# (presumably there weren't always readline releases for bash RCs etc)
44 +
45 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc
46 +inherit flag-o-matic toolchain-funcs prefix verify-sig
47 +
48 +# Uncomment if we have a patchset
49 +#GENTOO_PATCH_DEV="sam"
50 +#GENTOO_PATCH_VER="${PV}"
51 +
52 +# Official patchlevel
53 +# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
54 +PLEVEL="${PV##*_p}"
55 +MY_PV="${PV/_p*}"
56 +MY_PV="${MY_PV/_/-}"
57 +MY_P="${PN}-${MY_PV}"
58 +MY_PATCHES=()
59 +
60 +is_release() {
61 + case ${PV} in
62 + 9999|*_alpha*|*_beta*|*_rc*)
63 + return 1
64 + ;;
65 + *)
66 + return 0
67 + ;;
68 + esac
69 +}
70 +
71 +[[ ${PV} != *_p* ]] && PLEVEL=0
72 +
73 +# The version of readline this bash normally ships with.
74 +# Note: right now, we don't use the system copy of readline for bash for non-releases.
75 +READLINE_VER="8.2"
76 +
77 +DESCRIPTION="The standard GNU Bourne again shell"
78 +HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
79 +
80 +if [[ ${PV} == 9999 ]] ; then
81 + EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
82 + EGIT_BRANCH=devel
83 + inherit git-r3
84 +elif is_release ; then
85 + SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
86 + SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
87 +
88 + if [[ ${PLEVEL} -gt 0 ]] ; then
89 + # bash-5.1 -> bash51
90 + my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
91 +
92 + patch_url=
93 + my_patch_index=
94 +
95 + for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
96 + for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do
97 + patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index})
98 + SRC_URI+=" ${patch_url}"
99 + SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
100 + done
101 +
102 + MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) )
103 + done
104 +
105 + unset my_pn patch_url my_patch_index
106 + fi
107 +else
108 + SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
109 + SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
110 +fi
111 +
112 +if [[ -n ${GENTOO_PATCH_VER} ]] ; then
113 + SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
114 +fi
115 +
116 +LICENSE="GPL-3+"
117 +SLOT="0"
118 +if is_release ; then
119 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
120 +fi
121 +IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
122 +
123 +DEPEND="
124 + >=sys-libs/ncurses-5.2-r2:=
125 + nls? ( virtual/libintl )
126 +"
127 +if is_release ; then
128 + DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
129 +fi
130 +RDEPEND="
131 + ${DEPEND}
132 +"
133 +# We only need yacc when the .y files get patched (bash42-005, bash51-011)
134 +#BDEPEND="virtual/yacc"
135 +BDEPEND="
136 + pgo? ( dev-util/gperf )
137 + verify-sig? ( sec-keys/openpgp-keys-chetramey )
138 +"
139 +
140 +S="${WORKDIR}/${MY_P}"
141 +
142 +# EAPI 8 tries to append it but it doesn't exist here
143 +QA_CONFIGURE_OPTIONS="--disable-static"
144 +
145 +PATCHES=(
146 + #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
147 +
148 + # Patches from Chet sent to bashbug ml
149 + "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
150 +)
151 +
152 +pkg_setup() {
153 + # bug #7332
154 + if is-flag -malign-double ; then
155 + eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
156 + eerror "as it breaks LFS (struct stat64) on x86."
157 + die "remove -malign-double from your CFLAGS mr ricer"
158 + fi
159 +
160 + if use bashlogger ; then
161 + ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
162 + ewarn "This will log ALL output you enter into the shell, you have been warned."
163 + fi
164 +}
165 +
166 +src_unpack() {
167 + if [[ ${PV} == 9999 ]] ; then
168 + git-r3_src_unpack
169 + else
170 + if use verify-sig ; then
171 + verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
172 + fi
173 +
174 + unpack ${MY_P}.tar.gz
175 +
176 + if [[ -n ${GENTOO_PATCH_VER} ]] ; then
177 + unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
178 + fi
179 + fi
180 +}
181 +
182 +src_prepare() {
183 + # Include official patches
184 + [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
185 +
186 + # Clean out local libs so we know we use system ones w/releases.
187 + if is_release ; then
188 + rm -rf lib/{readline,termcap}/* || die
189 + touch lib/{readline,termcap}/Makefile.in || die # for config.status
190 + sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
191 + fi
192 +
193 + # Prefixify hardcoded path names. No-op for non-prefix.
194 + hprefixify pathnames.h.in
195 +
196 + # Avoid regenerating docs after patches, bug #407985
197 + sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
198 + touch -r . doc/* || die
199 +
200 + eapply -p0 "${PATCHES[@]}"
201 + eapply_user
202 +}
203 +
204 +src_configure() {
205 + local myconf=(
206 + --disable-profiling
207 +
208 + # Force linking with system curses ... the bundled termcap lib
209 + # sucks bad compared to ncurses. For the most part, ncurses
210 + # is here because readline needs it. But bash itself calls
211 + # ncurses in one or two small places :(.
212 + --with-curses
213 +
214 + $(use_enable mem-scramble)
215 + $(use_enable net net-redirections)
216 + $(use_enable readline)
217 + $(use_enable readline bang-history)
218 + $(use_enable readline history)
219 + $(use_with afs)
220 + $(use_with mem-scramble bash-malloc)
221 + )
222 +
223 + # For descriptions of these, see config-top.h
224 + # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
225 + append-cppflags \
226 + -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
227 + -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
228 + -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
229 + -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
230 + -DNON_INTERACTIVE_LOGIN_SHELLS \
231 + -DSSH_SOURCE_BASHRC \
232 + $(use bashlogger && echo -DSYSLOG_HISTORY)
233 +
234 + # Don't even think about building this statically without
235 + # reading bug #7714 first. If you still build it statically,
236 + # don't come crying to us with bugs ;).
237 + #use static && export LDFLAGS="${LDFLAGS} -static"
238 + use nls || myconf+=( --disable-nls )
239 +
240 + if is_release ; then
241 + # Historically, we always used the builtin readline, but since
242 + # our handling of SONAME upgrades has gotten much more stable
243 + # in the PM (and the readline ebuild itself preserves the old
244 + # libs during upgrades), linking against the system copy should
245 + # be safe.
246 + # Exact cached version here doesn't really matter as long as it
247 + # is at least what's in the DEPEND up above.
248 + export ac_cv_rl_version=${READLINE_VER%%_*}
249 +
250 + # Use system readline only with released versions.
251 + myconf+=( --with-installed-readline=. )
252 + fi
253 +
254 + if use plugins ; then
255 + append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
256 + else
257 + # Disable the plugins logic by hand since bash doesn't
258 + # provide a way of doing it.
259 + export ac_cv_func_dl{close,open,sym}=no \
260 + ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
261 +
262 + sed -i \
263 + -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
264 + configure || die
265 + fi
266 +
267 + # bug #444070
268 + tc-export AR
269 +
270 + econf "${myconf[@]}"
271 +}
272 +
273 +src_compile() {
274 + if use pgo ; then
275 + # Build Bash and run its tests to generate profiles.
276 + emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo"
277 +
278 + # Used in test suite.
279 + unset A
280 +
281 + emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check
282 +
283 + # Rebuild Bash using the profiling data we just generated.
284 + emake clean
285 + emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo"
286 +
287 + use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others
288 + else
289 + emake
290 +
291 + use plugins && emake -C examples/loadables all others
292 + fi
293 +}
294 +
295 +src_test() {
296 + # Used in test suite.
297 + unset A
298 +
299 + default
300 +}
301 +
302 +src_install() {
303 + local d f
304 +
305 + default
306 +
307 + dodir /bin
308 + mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
309 + dosym bash /bin/rbash
310 +
311 + insinto /etc/bash
312 + doins "${FILESDIR}"/bash_logout
313 + doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
314 +
315 + keepdir /etc/bash/bashrc.d
316 +
317 + insinto /etc/skel
318 + for f in bash{_logout,_profile,rc} ; do
319 + newins "${FILESDIR}"/dot-${f} .${f}
320 + done
321 +
322 + local sed_args=(
323 + -e "s:#${USERLAND}#@::"
324 + -e '/#@/d'
325 + )
326 +
327 + if ! use readline ; then
328 + # bug #432338
329 + sed_args+=(
330 + -e '/^shopt -s histappend/s:^:#:'
331 + -e 's:use_color=true:use_color=false:'
332 + )
333 + fi
334 +
335 + sed -i \
336 + "${sed_args[@]}" \
337 + "${ED}"/etc/skel/.bashrc \
338 + "${ED}"/etc/bash/bashrc || die
339 +
340 + if use plugins ; then
341 + exeinto /usr/$(get_libdir)/bash
342 + doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
343 +
344 + insinto /usr/include/bash-plugins
345 + doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
346 + fi
347 +
348 + if use examples ; then
349 + for d in examples/{functions,misc,scripts,startup-files} ; do
350 + exeinto /usr/share/doc/${PF}/${d}
351 + docinto ${d}
352 + for f in ${d}/* ; do
353 + if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
354 + doexe ${f}
355 + else
356 + dodoc ${f}
357 + fi
358 + done
359 + done
360 + fi
361 +
362 + # Install bash_builtins.1 and rbash.1
363 + emake -C doc DESTDIR="${D}" install_builtins
364 + sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
365 + doman "${T}"/rbash.1
366 +
367 + newdoc CWRU/changelog ChangeLog
368 + dosym bash.info /usr/share/info/bashref.info
369 +}
370 +
371 +pkg_preinst() {
372 + if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
373 + mkdir -p "${EROOT}"/etc/bash
374 + mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
375 + fi
376 +}
377 +
378 +pkg_postinst() {
379 + # If /bin/sh does not exist, provide it
380 + if [[ ! -e ${EROOT}/bin/sh ]] ; then
381 + ln -sf bash "${EROOT}"/bin/sh
382 + fi
383 +}