Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-shells/bash/
Date: Tue, 04 May 2021 19:50:40
Message-Id: 1620157682.3ebae2be731a2ad2282698aa5e5aad7f95d49029.polynomial-c@gentoo
1 commit: 3ebae2be731a2ad2282698aa5e5aad7f95d49029
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 4 19:48:02 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue May 4 19:48:02 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ebae2be
7
8 app-shells/bash: Bump to version 5.1_p8
9
10 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
11
12 app-shells/bash/Manifest | 4 +
13 app-shells/bash/bash-5.1_p8.ebuild | 261 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 265 insertions(+)
15
16 diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
17 index 4951082a3d0..23be981404a 100644
18 --- a/app-shells/bash/Manifest
19 +++ b/app-shells/bash/Manifest
20 @@ -331,3 +331,7 @@ DIST bash51-001 2894 BLAKE2B 7918eb48d4afe91a167eed666f0d15ca220e002d824cfc5ebb7
21 DIST bash51-002 1575 BLAKE2B 70336d2ef04c63fa29a625a2719c0b36f7e34818cadbb4b09e1434d72d6695dd882c758a00f2ea48f38d3918abc15f494780825b7d2f7cfc6c747a3be89ac497 SHA512 923e7822a9629645347d3aea0058fb5e2d52223507159a62369309f264612df44a84931c19e0ccb3852e98ce672dfbd454477090b4041b5a0de477c94eb61088
22 DIST bash51-003 1800 BLAKE2B 6dd284666273016d3b9007537502d75ad7c4e1347c3a13dcdab2325e4f191a149180ee86f9904fc96291ed8217e1d26dcd2b8b20c283ea616f322dbd293d1998 SHA512 01e952dcfdae58624723d64912ea3444eed2fdcd266ba1a929b95ec3abd70f914bf400607c3f7bb7a94ac2925f794f91f37c1929d5bb987de2ba7f60a19cb8bd
23 DIST bash51-004 3745 BLAKE2B dbbe2713c1cc4aa6de99366c1d91e136d1a7a86ac11108e8dd1aea3823ba0f9e005f48f1507acd1f86ce2f3c2f4ac60ae04ff066e5587229e7f19aefbe4d6e39 SHA512 10ff24cd91a2cd88818bfa7218050843af6b409e43fcca89f5ec70d8266020c6c2a55132426271f165cd0f154f49eb0f8ec2761b80fc066c921b83120bb543ce
24 +DIST bash51-005 2577 BLAKE2B 573dafdff4a0d11cf6c458d6a3c9087b728542000fce5e16266636444278b7a9b4c75b05e6de31648e2b1ad5ffc2b55336d9fec088ea2c4c6c854eb7e16527aa SHA512 fa83d894fe874a05b9a7d47b8bca8e5b7f4067221d82e8b1af616d17725592c3737c621f2a8ad3c917b29846012c37c85acd34dcbb43eb6b05065ccce89b260c
25 +DIST bash51-006 1412 BLAKE2B 3b32c69cef9438f66afaad0279627567d6aac32fabbec5af899552427489f2a87b148a3886bc30139647ec4204241c2e77cad83cdae1251176b7ec54699e1445 SHA512 b9b6e3d71f7b7718e2e8598ec8e337dcc675571fb233c29e5230ebf14eab2249204531f2fe8c4d1459c5fed10acb679048588d1e457e98dbc00ffc4d2cd227e3
26 +DIST bash51-007 2621 BLAKE2B f2802bc7267efe69abecb5c4d0cf5879bb57219e9e972d4c74f86ca88f99ba4dd3d9314beaca9c426351ffe429ddb4a03615776f569bad9962df7c5094d52a28 SHA512 e4ebdc47e780ddc2588ecdfcfe00cb618039c7044e250ab2b836b0735c461ebacd15beaf2145e277c70b7f51cded55bd8dde7757df810f33f8dae306ee5ba571
27 +DIST bash51-008 1821 BLAKE2B 9820066c99c8ed5f6322fceb2346f8900ac77b6c50c75de39c9ff7472c33f78b054f8bd0493ce7a4b8e17c70456d867aa6791e892246bce64624549a95c3211d SHA512 97f9558a08a66cc9da62c285bf9118b39328e25ed3b9277728e0539b1ac0adef176a090e39cd96dc03d6fd900d8155bd58040cb3390a09f637bab1de8af3faf6
28
29 diff --git a/app-shells/bash/bash-5.1_p8.ebuild b/app-shells/bash/bash-5.1_p8.ebuild
30 new file mode 100644
31 index 00000000000..d3193239c76
32 --- /dev/null
33 +++ b/app-shells/bash/bash-5.1_p8.ebuild
34 @@ -0,0 +1,261 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +inherit flag-o-matic toolchain-funcs multilib prefix
41 +
42 +# Official patchlevel
43 +# See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/
44 +PLEVEL="${PV##*_p}"
45 +MY_PV="${PV/_p*}"
46 +MY_PV="${MY_PV/_/-}"
47 +MY_P="${PN}-${MY_PV}"
48 +is_release() {
49 + case ${PV} in
50 + *_alpha*|*_beta*|*_rc*) return 1 ;;
51 + *) return 0 ;;
52 + esac
53 +}
54 +[[ ${PV} != *_p* ]] && PLEVEL=0
55 +patches() {
56 + local opt=${1} plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
57 + [[ ${plevel} -eq 0 ]] && return 1
58 + eval set -- {1..${plevel}}
59 + set -- $(printf "${pn}${pv/\.}-%03d " "$@")
60 + if [[ ${opt} == -s ]] ; then
61 + echo "${@/#/${DISTDIR}/}"
62 + else
63 + local u
64 + for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
65 + printf "${u}/${pn}-${pv}-patches/%s " "$@"
66 + done
67 + fi
68 +}
69 +
70 +# The version of readline this bash normally ships with.
71 +READLINE_VER="8.1"
72 +
73 +DESCRIPTION="The standard GNU Bourne again shell"
74 +HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
75 +if is_release ; then
76 + SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
77 +else
78 + SRC_URI="ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
79 +fi
80 +
81 +LICENSE="GPL-3"
82 +SLOT="0"
83 +[[ "${PV}" == *_rc* ]] || \
84 +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"
85 +IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
86 +
87 +DEPEND="
88 + >=sys-libs/ncurses-5.2-r2:0=
89 + nls? ( virtual/libintl )
90 + readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
91 +"
92 +RDEPEND="
93 + ${DEPEND}
94 +"
95 +# we only need yacc when the .y files get patched (bash42-005)
96 +#BDEPEND="virtual/yacc"
97 +
98 +S="${WORKDIR}/${MY_P}"
99 +
100 +PATCHES=(
101 + # Patches from Chet sent to bashbug ml
102 + "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
103 +)
104 +
105 +pkg_setup() {
106 + if is-flag -malign-double ; then #7332
107 + eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
108 + eerror "as it breaks LFS (struct stat64) on x86."
109 + die "remove -malign-double from your CFLAGS mr ricer"
110 + fi
111 + if use bashlogger ; then
112 + ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
113 + ewarn "This will log ALL output you enter into the shell, you have been warned."
114 + fi
115 +}
116 +
117 +src_unpack() {
118 + unpack ${MY_P}.tar.gz
119 +}
120 +
121 +src_prepare() {
122 + # Include official patches
123 + [[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
124 +
125 + # Clean out local libs so we know we use system ones w/releases.
126 + if is_release ; then
127 + rm -rf lib/{readline,termcap}/* || die
128 + touch lib/{readline,termcap}/Makefile.in || die # for config.status
129 + sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
130 + fi
131 +
132 + # Prefixify hardcoded path names. No-op for non-prefix.
133 + hprefixify pathnames.h.in
134 +
135 + # Avoid regenerating docs after patches #407985
136 + sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
137 + touch -r . doc/* || die
138 +
139 + eapply -p0 "${PATCHES[@]}"
140 + eapply_user
141 +}
142 +
143 +src_configure() {
144 + local myconf=(
145 + --disable-profiling
146 + --with-curses
147 + $(use_enable mem-scramble)
148 + $(use_enable net net-redirections)
149 + $(use_enable readline)
150 + $(use_enable readline bang-history)
151 + $(use_enable readline history)
152 + $(use_with afs)
153 + $(use_with mem-scramble bash-malloc)
154 + )
155 +
156 + # For descriptions of these, see config-top.h
157 + # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
158 + append-cppflags \
159 + -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
160 + -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
161 + -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
162 + -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
163 + -DNON_INTERACTIVE_LOGIN_SHELLS \
164 + -DSSH_SOURCE_BASHRC \
165 + $(use bashlogger && echo -DSYSLOG_HISTORY)
166 +
167 + # Don't even think about building this statically without
168 + # reading Bug 7714 first. If you still build it statically,
169 + # don't come crying to us with bugs ;).
170 + #use static && export LDFLAGS="${LDFLAGS} -static"
171 + use nls || myconf+=( --disable-nls )
172 +
173 + # Historically, we always used the builtin readline, but since
174 + # our handling of SONAME upgrades has gotten much more stable
175 + # in the PM (and the readline ebuild itself preserves the old
176 + # libs during upgrades), linking against the system copy should
177 + # be safe.
178 + # Exact cached version here doesn't really matter as long as it
179 + # is at least what's in the DEPEND up above.
180 + export ac_cv_rl_version=${READLINE_VER%%_*}
181 +
182 + # Force linking with system curses ... the bundled termcap lib
183 + # sucks bad compared to ncurses. For the most part, ncurses
184 + # is here because readline needs it. But bash itself calls
185 + # ncurses in one or two small places :(.
186 +
187 + if is_release ; then
188 + # Use system readline only with released versions.
189 + myconf+=( --with-installed-readline=. )
190 + fi
191 +
192 + if use plugins; then
193 + append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
194 + else
195 + # Disable the plugins logic by hand since bash doesn't
196 + # provide a way of doing it.
197 + export ac_cv_func_dl{close,open,sym}=no \
198 + ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
199 + sed -i \
200 + -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
201 + configure || die
202 + fi
203 + tc-export AR #444070
204 + econf "${myconf[@]}"
205 +}
206 +
207 +src_compile() {
208 + emake
209 +
210 + if use plugins ; then
211 + emake -C examples/loadables all others
212 + fi
213 +}
214 +
215 +src_install() {
216 + local d f
217 +
218 + default
219 +
220 + dodir /bin
221 + mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
222 + dosym bash /bin/rbash
223 +
224 + insinto /etc/bash
225 + doins "${FILESDIR}"/bash_logout
226 + doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
227 + keepdir /etc/bash/bashrc.d
228 + insinto /etc/skel
229 + for f in bash{_logout,_profile,rc} ; do
230 + newins "${FILESDIR}"/dot-${f} .${f}
231 + done
232 +
233 + local sed_args=(
234 + -e "s:#${USERLAND}#@::"
235 + -e '/#@/d'
236 + )
237 + if ! use readline ; then
238 + sed_args+=( #432338
239 + -e '/^shopt -s histappend/s:^:#:'
240 + -e 's:use_color=true:use_color=false:'
241 + )
242 + fi
243 + sed -i \
244 + "${sed_args[@]}" \
245 + "${ED}"/etc/skel/.bashrc \
246 + "${ED}"/etc/bash/bashrc || die
247 +
248 + if use plugins ; then
249 + exeinto /usr/$(get_libdir)/bash
250 + doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
251 + insinto /usr/include/bash-plugins
252 + doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
253 + fi
254 +
255 + if use examples ; then
256 + for d in examples/{functions,misc,scripts,startup-files} ; do
257 + exeinto /usr/share/doc/${PF}/${d}
258 + docinto ${d}
259 + for f in ${d}/* ; do
260 + if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
261 + doexe ${f}
262 + else
263 + dodoc ${f}
264 + fi
265 + done
266 + done
267 + fi
268 +
269 + doman doc/*.1
270 + newdoc CWRU/changelog ChangeLog
271 + dosym bash.info /usr/share/info/bashref.info
272 +}
273 +
274 +pkg_preinst() {
275 + if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
276 + mkdir -p "${EROOT}"/etc/bash
277 + mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
278 + fi
279 +
280 + if [[ -L ${EROOT}/bin/sh ]] ; then
281 + # rewrite the symlink to ensure that its mtime changes. having /bin/sh
282 + # missing even temporarily causes a fatal error with paludis.
283 + local target=$(readlink "${EROOT}"/bin/sh)
284 + local tmp="${T}"/sh
285 + ln -sf "${target}" "${tmp}"
286 + mv -f "${tmp}" "${EROOT}"/bin/sh
287 + fi
288 +}
289 +
290 +pkg_postinst() {
291 + # If /bin/sh does not exist, provide it
292 + if [[ ! -e ${EROOT}/bin/sh ]] ; then
293 + ln -sf bash "${EROOT}"/bin/sh
294 + fi
295 +}