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: Fri, 23 Sep 2022 02:09:28
Message-Id: 1663898930.a2eabcc998bbb2e2b7c776ba3c2e9395e327de26.sam@gentoo
1 commit: a2eabcc998bbb2e2b7c776ba3c2e9395e327de26
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 23 02:03:50 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 23 02:08:50 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2eabcc9
7
8 app-shells/bash: drop 5.2_rc2, 5.2_rc3
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 app-shells/bash/Manifest | 4 -
13 app-shells/bash/bash-5.2_rc2.ebuild | 348 ------------------------------------
14 app-shells/bash/bash-5.2_rc3.ebuild | 348 ------------------------------------
15 3 files changed, 700 deletions(-)
16
17 diff --git a/app-shells/bash/Manifest b/app-shells/bash/Manifest
18 index 87f6925ef845..ff793c382b45 100644
19 --- a/app-shells/bash/Manifest
20 +++ b/app-shells/bash/Manifest
21 @@ -21,10 +21,6 @@ DIST bash-5.0_p18-patches.tar.xz 804 BLAKE2B 89e615a08920a4cfc90f72d125a8256275b
22 DIST bash-5.1.tar.gz 10458638 BLAKE2B 42059556694b604911b5b7936f94d42d8923f2931f3ebacefd95454274c7baadb1ec97629a524c1542e2e282dae66f1389334f8edc572ca8ee841cc3ac449ba7 SHA512 c44a0ce381469219548a3a27589af3fea4f22eda1ca4e9434b59fc16da81b471c29ce18e31590e0860a6a251a664b68c2b45e3a17d22cfc02799ffd9a208390c
23 DIST bash-5.1.tar.gz.sig 95 BLAKE2B ac9209d6a4ab4436c511a7a195594e9036d7d1aef7887972f61a0e97378a9685b882621d7f95f5326b155dc155c41635417ce2ca41ac6d0dda78bd293ea4249f SHA512 3966404c0f683c7ef214fcf283b551e5441af3897009f778308c2e34067d98d57c95561453416a54ca5b1daf9a1288dbf950fe3f13353703cead12f5eec5fad8
24 DIST bash-5.1_p16-patches.tar.xz 388 BLAKE2B 1575d54d311872c7ca71e13711fa0f7e3534fca16fd9d1ca045b6c696c9ca56f6a0ed5023a05d847ab5ddbefc22b8ef2c2a681f09571520f0294d83b495f0015 SHA512 c85e5b83f6ee1a7345647fa937d9718cab13be1a65886755d26a78d21fea4246650c7441a34fd729212e220366985b410562002d74c02c18de7ef0469b409ac7
25 -DIST bash-5.2-rc2.tar.gz 10925605 BLAKE2B 839be13e89b679bbcfca19f2e331e471639ceab0187f1b5127fbf647199f565047ed309b9e30ec5efe6c6095acf08959e732d620f260d4c96ad2bc161754535b SHA512 431e13c93f846c16b87d75d63f2b3f7514528e36ae30a2e75866d93a988b87ca1ea05415bc672390fcdb2f94cab9555a0ae5390fa3b908764b906a3c5d58f644
26 -DIST bash-5.2-rc2.tar.gz.sig 95 BLAKE2B 446d310659eda48ee27f2982609073904e36e64dc439ef79d172b7326199c71d87e13daad8c069e3f9c20a4db4986a76793a5f7bba0ce1827531fa351eb7b47f SHA512 c9c3e218681ec367562b7c55785a18843d40f1c0cbdd27a5f4c07d94d5e797f7d735ed7652f56f6fcb065e9305508b578d64dde3d83f314c86447fc8d537126f
27 -DIST bash-5.2-rc3.tar.gz 10896868 BLAKE2B 32b3345325f50a1883390403eb77105a9f1aacc5c1991bd47b817e9d86dbefa389281a68b758e898018e734a77e61117e581347ebc1f132003ae8b93239e1ac2 SHA512 a8ac061d6815de74c820081e320634f671ad91dace9e3fbcc5dc4b9ab56208c6207cebd4dd6aaf2379c1ff98f6edcd3333f8ca58c6b07f6b2b490a4a632eea36
28 -DIST bash-5.2-rc3.tar.gz.sig 95 BLAKE2B b4f87665814943860a64bc3c2102c61147f9047f525e81554c8a46a5366421e13a02052f878f955f775355920ae32af8033a209abf70bd36b64e14177dce5db2 SHA512 e0591d761d2502591edc2e0e330341708104f8d5bdddb7f62d737c5c306c1aa7a4d129d00a197e63d52833a3fc1691a0b6b8060de6e6762afa165a147126d95b
29 DIST bash-5.2-rc4.tar.gz 10953456 BLAKE2B c39eb9640a08fe3a6e8e61fd7e9f8116b34e5da83fd97afa3abb78164cb70af9774fb2315bbd2507ead33fd38718ca7fcfd4df7ee6d2e564424dce9c5f230640 SHA512 3f00e5872b1c90901446c3d9299d72229f2fb28e7db7659acc52d353e20b34f627ced42e6b02159f499c5885a211aaf55510b9cd145c46f4e0b3cb19237b4bbc
30 DIST bash-5.2-rc4.tar.gz.sig 95 BLAKE2B 6ae8e4e48fcd821bad7a67a0f1ab8bf4c20c385d8eefceca178d114210a4a95d03ae891039d01efdf15b7849401df61f4748d2baa6ca13b09fe4d23b0132113f SHA512 c44b02fb2e22a8d77bbb09a3712878478fabe287abe5a5a5c40e00cef89a9b516e9e72074f123580b0840e3e62ef9a192096738fa1bd5906acadbfe5cc5e206c
31 DIST bash205b-001 1132 BLAKE2B 0c5eef29777d54ef05957ea3d63b1556fb380bd20c238dc28993d822b37bc4e78ff4048ad069f6b8cd25da77ccdeb7aecd86c4349cb9d81e5e94c7001eeae5e6 SHA512 5ce4357468821b05e747201f3aa57225ad8f540c9e2c87051720490e039c30b478b9b662a68f14a0800fefe40184e4495e2645665200f9d75e9a115b2ac08071
32
33 diff --git a/app-shells/bash/bash-5.2_rc2.ebuild b/app-shells/bash/bash-5.2_rc2.ebuild
34 deleted file mode 100644
35 index 847e52506d7f..000000000000
36 --- a/app-shells/bash/bash-5.2_rc2.ebuild
37 +++ /dev/null
38 @@ -1,348 +0,0 @@
39 -# Copyright 1999-2022 Gentoo Authors
40 -# Distributed under the terms of the GNU General Public License v2
41 -
42 -EAPI=7
43 -
44 -# TODO on release:
45 -# - check READLINE_VER, obviously
46 -# (presumably there weren't always readline releases for bash RCs etc)
47 -
48 -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc
49 -inherit flag-o-matic toolchain-funcs prefix verify-sig
50 -
51 -# Uncomment if we have a patchset
52 -#GENTOO_PATCH_DEV="sam"
53 -#GENTOO_PATCH_VER="${PV}"
54 -
55 -# Official patchlevel
56 -# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
57 -PLEVEL="${PV##*_p}"
58 -MY_PV="${PV/_p*}"
59 -MY_PV="${MY_PV/_/-}"
60 -MY_P="${PN}-${MY_PV}"
61 -MY_PATCHES=()
62 -
63 -is_release() {
64 - case ${PV} in
65 - 9999|*_alpha*|*_beta*|*_rc*)
66 - return 1
67 - ;;
68 - *)
69 - return 0
70 - ;;
71 - esac
72 -}
73 -
74 -[[ ${PV} != *_p* ]] && PLEVEL=0
75 -
76 -# The version of readline this bash normally ships with.
77 -# Note: right now, we don't use the system copy of readline for bash for non-releases.
78 -READLINE_VER="8.2"
79 -
80 -DESCRIPTION="The standard GNU Bourne again shell"
81 -HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
82 -
83 -if [[ ${PV} == 9999 ]] ; then
84 - EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
85 - EGIT_BRANCH=devel
86 - inherit git-r3
87 -elif is_release ; then
88 - SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
89 - SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
90 -
91 - if [[ ${PLEVEL} -gt 0 ]] ; then
92 - # bash-5.1 -> bash51
93 - my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
94 -
95 - patch_url=
96 - my_patch_index=
97 -
98 - for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
99 - for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do
100 - patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index})
101 - SRC_URI+=" ${patch_url}"
102 - SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
103 - done
104 -
105 - MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) )
106 - done
107 -
108 - unset my_pn patch_url my_patch_index
109 - fi
110 -else
111 - SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
112 - SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
113 -fi
114 -
115 -if [[ -n ${GENTOO_PATCH_VER} ]] ; then
116 - SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
117 -fi
118 -
119 -LICENSE="GPL-3+"
120 -SLOT="0"
121 -if is_release ; then
122 - 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"
123 -fi
124 -IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
125 -
126 -DEPEND="
127 - >=sys-libs/ncurses-5.2-r2:=
128 - nls? ( virtual/libintl )
129 -"
130 -if is_release ; then
131 - DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
132 -fi
133 -RDEPEND="
134 - ${DEPEND}
135 -"
136 -# We only need yacc when the .y files get patched (bash42-005, bash51-011)
137 -#BDEPEND="virtual/yacc"
138 -BDEPEND="
139 - pgo? ( dev-util/gperf )
140 - verify-sig? ( sec-keys/openpgp-keys-chetramey )
141 -"
142 -
143 -S="${WORKDIR}/${MY_P}"
144 -
145 -# EAPI 8 tries to append it but it doesn't exist here
146 -QA_CONFIGURE_OPTIONS="--disable-static"
147 -
148 -PATCHES=(
149 - #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
150 -
151 - # Patches from Chet sent to bashbug ml
152 - "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
153 -)
154 -
155 -pkg_setup() {
156 - # bug #7332
157 - if is-flag -malign-double ; then
158 - eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
159 - eerror "as it breaks LFS (struct stat64) on x86."
160 - die "remove -malign-double from your CFLAGS mr ricer"
161 - fi
162 -
163 - if use bashlogger ; then
164 - ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
165 - ewarn "This will log ALL output you enter into the shell, you have been warned."
166 - fi
167 -}
168 -
169 -src_unpack() {
170 - if [[ ${PV} == 9999 ]] ; then
171 - git-r3_src_unpack
172 - else
173 - if use verify-sig ; then
174 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
175 - fi
176 -
177 - unpack ${MY_P}.tar.gz
178 -
179 - if [[ -n ${GENTOO_PATCH_VER} ]] ; then
180 - unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
181 - fi
182 - fi
183 -}
184 -
185 -src_prepare() {
186 - # Include official patches
187 - [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
188 -
189 - # Clean out local libs so we know we use system ones w/releases.
190 - if is_release ; then
191 - rm -rf lib/{readline,termcap}/* || die
192 - touch lib/{readline,termcap}/Makefile.in || die # for config.status
193 - sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
194 - fi
195 -
196 - # Prefixify hardcoded path names. No-op for non-prefix.
197 - hprefixify pathnames.h.in
198 -
199 - # Avoid regenerating docs after patches, bug #407985
200 - sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
201 - touch -r . doc/* || die
202 -
203 - eapply -p0 "${PATCHES[@]}"
204 - eapply_user
205 -}
206 -
207 -src_configure() {
208 - local myconf=(
209 - --disable-profiling
210 -
211 - # Force linking with system curses ... the bundled termcap lib
212 - # sucks bad compared to ncurses. For the most part, ncurses
213 - # is here because readline needs it. But bash itself calls
214 - # ncurses in one or two small places :(.
215 - --with-curses
216 -
217 - $(use_enable mem-scramble)
218 - $(use_enable net net-redirections)
219 - $(use_enable readline)
220 - $(use_enable readline bang-history)
221 - $(use_enable readline history)
222 - $(use_with afs)
223 - $(use_with mem-scramble bash-malloc)
224 - )
225 -
226 - # For descriptions of these, see config-top.h
227 - # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
228 - append-cppflags \
229 - -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
230 - -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
231 - -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
232 - -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
233 - -DNON_INTERACTIVE_LOGIN_SHELLS \
234 - -DSSH_SOURCE_BASHRC \
235 - $(use bashlogger && echo -DSYSLOG_HISTORY)
236 -
237 - # Don't even think about building this statically without
238 - # reading bug #7714 first. If you still build it statically,
239 - # don't come crying to us with bugs ;).
240 - #use static && export LDFLAGS="${LDFLAGS} -static"
241 - use nls || myconf+=( --disable-nls )
242 -
243 - if is_release ; then
244 - # Historically, we always used the builtin readline, but since
245 - # our handling of SONAME upgrades has gotten much more stable
246 - # in the PM (and the readline ebuild itself preserves the old
247 - # libs during upgrades), linking against the system copy should
248 - # be safe.
249 - # Exact cached version here doesn't really matter as long as it
250 - # is at least what's in the DEPEND up above.
251 - export ac_cv_rl_version=${READLINE_VER%%_*}
252 -
253 - # Use system readline only with released versions.
254 - myconf+=( --with-installed-readline=. )
255 - fi
256 -
257 - if use plugins ; then
258 - append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
259 - else
260 - # Disable the plugins logic by hand since bash doesn't
261 - # provide a way of doing it.
262 - export ac_cv_func_dl{close,open,sym}=no \
263 - ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
264 -
265 - sed -i \
266 - -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
267 - configure || die
268 - fi
269 -
270 - # bug #444070
271 - tc-export AR
272 -
273 - econf "${myconf[@]}"
274 -}
275 -
276 -src_compile() {
277 - if use pgo ; then
278 - # Build Bash and run its tests to generate profiles.
279 - emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo"
280 -
281 - # Used in test suite.
282 - unset A
283 -
284 - emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check
285 -
286 - # Rebuild Bash using the profiling data we just generated.
287 - emake clean
288 - emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo"
289 -
290 - use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others
291 - else
292 - emake
293 -
294 - use plugins && emake -C examples/loadables all others
295 - fi
296 -}
297 -
298 -src_test() {
299 - # Used in test suite.
300 - unset A
301 -
302 - default
303 -}
304 -
305 -src_install() {
306 - local d f
307 -
308 - default
309 -
310 - dodir /bin
311 - mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
312 - dosym bash /bin/rbash
313 -
314 - insinto /etc/bash
315 - doins "${FILESDIR}"/bash_logout
316 - doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
317 -
318 - keepdir /etc/bash/bashrc.d
319 -
320 - insinto /etc/skel
321 - for f in bash{_logout,_profile,rc} ; do
322 - newins "${FILESDIR}"/dot-${f} .${f}
323 - done
324 -
325 - local sed_args=(
326 - -e "s:#${USERLAND}#@::"
327 - -e '/#@/d'
328 - )
329 -
330 - if ! use readline ; then
331 - # bug #432338
332 - sed_args+=(
333 - -e '/^shopt -s histappend/s:^:#:'
334 - -e 's:use_color=true:use_color=false:'
335 - )
336 - fi
337 -
338 - sed -i \
339 - "${sed_args[@]}" \
340 - "${ED}"/etc/skel/.bashrc \
341 - "${ED}"/etc/bash/bashrc || die
342 -
343 - if use plugins ; then
344 - exeinto /usr/$(get_libdir)/bash
345 - doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
346 -
347 - insinto /usr/include/bash-plugins
348 - doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
349 - fi
350 -
351 - if use examples ; then
352 - for d in examples/{functions,misc,scripts,startup-files} ; do
353 - exeinto /usr/share/doc/${PF}/${d}
354 - docinto ${d}
355 - for f in ${d}/* ; do
356 - if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
357 - doexe ${f}
358 - else
359 - dodoc ${f}
360 - fi
361 - done
362 - done
363 - fi
364 -
365 - # Install bash_builtins.1 and rbash.1
366 - emake -C doc DESTDIR="${D}" install_builtins
367 - sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
368 - doman "${T}"/rbash.1
369 -
370 - newdoc CWRU/changelog ChangeLog
371 - dosym bash.info /usr/share/info/bashref.info
372 -}
373 -
374 -pkg_preinst() {
375 - if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
376 - mkdir -p "${EROOT}"/etc/bash
377 - mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
378 - fi
379 -}
380 -
381 -pkg_postinst() {
382 - # If /bin/sh does not exist, provide it
383 - if [[ ! -e ${EROOT}/bin/sh ]] ; then
384 - ln -sf bash "${EROOT}"/bin/sh
385 - fi
386 -}
387
388 diff --git a/app-shells/bash/bash-5.2_rc3.ebuild b/app-shells/bash/bash-5.2_rc3.ebuild
389 deleted file mode 100644
390 index 847e52506d7f..000000000000
391 --- a/app-shells/bash/bash-5.2_rc3.ebuild
392 +++ /dev/null
393 @@ -1,348 +0,0 @@
394 -# Copyright 1999-2022 Gentoo Authors
395 -# Distributed under the terms of the GNU General Public License v2
396 -
397 -EAPI=7
398 -
399 -# TODO on release:
400 -# - check READLINE_VER, obviously
401 -# (presumably there weren't always readline releases for bash RCs etc)
402 -
403 -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/chetramey.asc
404 -inherit flag-o-matic toolchain-funcs prefix verify-sig
405 -
406 -# Uncomment if we have a patchset
407 -#GENTOO_PATCH_DEV="sam"
408 -#GENTOO_PATCH_VER="${PV}"
409 -
410 -# Official patchlevel
411 -# See ftp://ftp.cwru.edu/pub/bash/bash-5.1-patches/
412 -PLEVEL="${PV##*_p}"
413 -MY_PV="${PV/_p*}"
414 -MY_PV="${MY_PV/_/-}"
415 -MY_P="${PN}-${MY_PV}"
416 -MY_PATCHES=()
417 -
418 -is_release() {
419 - case ${PV} in
420 - 9999|*_alpha*|*_beta*|*_rc*)
421 - return 1
422 - ;;
423 - *)
424 - return 0
425 - ;;
426 - esac
427 -}
428 -
429 -[[ ${PV} != *_p* ]] && PLEVEL=0
430 -
431 -# The version of readline this bash normally ships with.
432 -# Note: right now, we don't use the system copy of readline for bash for non-releases.
433 -READLINE_VER="8.2"
434 -
435 -DESCRIPTION="The standard GNU Bourne again shell"
436 -HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html https://git.savannah.gnu.org/cgit/bash.git"
437 -
438 -if [[ ${PV} == 9999 ]] ; then
439 - EGIT_REPO_URI="https://git.savannah.gnu.org/git/bash.git"
440 - EGIT_BRANCH=devel
441 - inherit git-r3
442 -elif is_release ; then
443 - SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz"
444 - SRC_URI+=" verify-sig? ( mirror://gnu/bash/${MY_P}.tar.gz.sig )"
445 -
446 - if [[ ${PLEVEL} -gt 0 ]] ; then
447 - # bash-5.1 -> bash51
448 - my_p=${PN}$(ver_rs 1-2 '' $(ver_cut 1-2))
449 -
450 - patch_url=
451 - my_patch_index=
452 -
453 - for ((my_patch_index=1; my_patch_index <= ${PLEVEL} ; my_patch_index++)) ; do
454 - for url in mirror://gnu/${pn} ftp://ftp.cwru.edu/pub/bash ; do
455 - patch_url=$(printf "${url}/${PN}-$(ver_cut 1-2)-patches/${my_p}-%03d" ${my_patch_index})
456 - SRC_URI+=" ${patch_url}"
457 - SRC_URI+=" verify-sig? ( ${patch_url}.sig )"
458 - done
459 -
460 - MY_PATCHES+=( "${DISTDIR}"/$(printf ${my_p}-%03d ${my_patch_index}) )
461 - done
462 -
463 - unset my_pn patch_url my_patch_index
464 - fi
465 -else
466 - SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
467 - SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${MY_P}.tar.gz.sig ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz.sig )"
468 -fi
469 -
470 -if [[ -n ${GENTOO_PATCH_VER} ]] ; then
471 - SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${GENTOO_PATCH_VER}-patches.tar.xz"
472 -fi
473 -
474 -LICENSE="GPL-3+"
475 -SLOT="0"
476 -if is_release ; then
477 - 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"
478 -fi
479 -IUSE="afs bashlogger examples mem-scramble +net nls plugins pgo +readline"
480 -
481 -DEPEND="
482 - >=sys-libs/ncurses-5.2-r2:=
483 - nls? ( virtual/libintl )
484 -"
485 -if is_release ; then
486 - DEPEND+=" readline? ( >=sys-libs/readline-${READLINE_VER}:= )"
487 -fi
488 -RDEPEND="
489 - ${DEPEND}
490 -"
491 -# We only need yacc when the .y files get patched (bash42-005, bash51-011)
492 -#BDEPEND="virtual/yacc"
493 -BDEPEND="
494 - pgo? ( dev-util/gperf )
495 - verify-sig? ( sec-keys/openpgp-keys-chetramey )
496 -"
497 -
498 -S="${WORKDIR}/${MY_P}"
499 -
500 -# EAPI 8 tries to append it but it doesn't exist here
501 -QA_CONFIGURE_OPTIONS="--disable-static"
502 -
503 -PATCHES=(
504 - #"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}/
505 -
506 - # Patches from Chet sent to bashbug ml
507 - "${FILESDIR}"/${PN}-5.0-syslog-history-extern.patch
508 -)
509 -
510 -pkg_setup() {
511 - # bug #7332
512 - if is-flag -malign-double ; then
513 - eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
514 - eerror "as it breaks LFS (struct stat64) on x86."
515 - die "remove -malign-double from your CFLAGS mr ricer"
516 - fi
517 -
518 - if use bashlogger ; then
519 - ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
520 - ewarn "This will log ALL output you enter into the shell, you have been warned."
521 - fi
522 -}
523 -
524 -src_unpack() {
525 - if [[ ${PV} == 9999 ]] ; then
526 - git-r3_src_unpack
527 - else
528 - if use verify-sig ; then
529 - verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.gz{,.sig}
530 - fi
531 -
532 - unpack ${MY_P}.tar.gz
533 -
534 - if [[ -n ${GENTOO_PATCH_VER} ]] ; then
535 - unpack ${PN}-${GENTOO_PATCH_VER}-patches.tar.xz
536 - fi
537 - fi
538 -}
539 -
540 -src_prepare() {
541 - # Include official patches
542 - [[ ${PLEVEL} -gt 0 ]] && eapply -p0 "${MY_PATCHES[@]}"
543 -
544 - # Clean out local libs so we know we use system ones w/releases.
545 - if is_release ; then
546 - rm -rf lib/{readline,termcap}/* || die
547 - touch lib/{readline,termcap}/Makefile.in || die # for config.status
548 - sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
549 - fi
550 -
551 - # Prefixify hardcoded path names. No-op for non-prefix.
552 - hprefixify pathnames.h.in
553 -
554 - # Avoid regenerating docs after patches, bug #407985
555 - sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
556 - touch -r . doc/* || die
557 -
558 - eapply -p0 "${PATCHES[@]}"
559 - eapply_user
560 -}
561 -
562 -src_configure() {
563 - local myconf=(
564 - --disable-profiling
565 -
566 - # Force linking with system curses ... the bundled termcap lib
567 - # sucks bad compared to ncurses. For the most part, ncurses
568 - # is here because readline needs it. But bash itself calls
569 - # ncurses in one or two small places :(.
570 - --with-curses
571 -
572 - $(use_enable mem-scramble)
573 - $(use_enable net net-redirections)
574 - $(use_enable readline)
575 - $(use_enable readline bang-history)
576 - $(use_enable readline history)
577 - $(use_with afs)
578 - $(use_with mem-scramble bash-malloc)
579 - )
580 -
581 - # For descriptions of these, see config-top.h
582 - # bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
583 - append-cppflags \
584 - -DDEFAULT_PATH_VALUE=\'\"${EPREFIX}/usr/local/sbin:${EPREFIX}/usr/local/bin:${EPREFIX}/usr/sbin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/bin\"\' \
585 - -DSTANDARD_UTILS_PATH=\'\"${EPREFIX}/bin:${EPREFIX}/usr/bin:${EPREFIX}/sbin:${EPREFIX}/usr/sbin\"\' \
586 - -DSYS_BASHRC=\'\"${EPREFIX}/etc/bash/bashrc\"\' \
587 - -DSYS_BASH_LOGOUT=\'\"${EPREFIX}/etc/bash/bash_logout\"\' \
588 - -DNON_INTERACTIVE_LOGIN_SHELLS \
589 - -DSSH_SOURCE_BASHRC \
590 - $(use bashlogger && echo -DSYSLOG_HISTORY)
591 -
592 - # Don't even think about building this statically without
593 - # reading bug #7714 first. If you still build it statically,
594 - # don't come crying to us with bugs ;).
595 - #use static && export LDFLAGS="${LDFLAGS} -static"
596 - use nls || myconf+=( --disable-nls )
597 -
598 - if is_release ; then
599 - # Historically, we always used the builtin readline, but since
600 - # our handling of SONAME upgrades has gotten much more stable
601 - # in the PM (and the readline ebuild itself preserves the old
602 - # libs during upgrades), linking against the system copy should
603 - # be safe.
604 - # Exact cached version here doesn't really matter as long as it
605 - # is at least what's in the DEPEND up above.
606 - export ac_cv_rl_version=${READLINE_VER%%_*}
607 -
608 - # Use system readline only with released versions.
609 - myconf+=( --with-installed-readline=. )
610 - fi
611 -
612 - if use plugins ; then
613 - append-ldflags -Wl,-rpath,"${EPREFIX}"/usr/$(get_libdir)/bash
614 - else
615 - # Disable the plugins logic by hand since bash doesn't
616 - # provide a way of doing it.
617 - export ac_cv_func_dl{close,open,sym}=no \
618 - ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
619 -
620 - sed -i \
621 - -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
622 - configure || die
623 - fi
624 -
625 - # bug #444070
626 - tc-export AR
627 -
628 - econf "${myconf[@]}"
629 -}
630 -
631 -src_compile() {
632 - if use pgo ; then
633 - # Build Bash and run its tests to generate profiles.
634 - emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo"
635 -
636 - # Used in test suite.
637 - unset A
638 -
639 - emake CFLAGS="${CFLAGS} -fprofile-generate=${T}/pgo -fprofile-dir=${T}/pgo" -k check
640 -
641 - # Rebuild Bash using the profiling data we just generated.
642 - emake clean
643 - emake CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo"
644 -
645 - use plugins && emake -C examples/loadables CFLAGS="${CFLAGS} -fprofile-use=${T}/pgo -fprofile-dir=${T}/pgo" all others
646 - else
647 - emake
648 -
649 - use plugins && emake -C examples/loadables all others
650 - fi
651 -}
652 -
653 -src_test() {
654 - # Used in test suite.
655 - unset A
656 -
657 - default
658 -}
659 -
660 -src_install() {
661 - local d f
662 -
663 - default
664 -
665 - dodir /bin
666 - mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
667 - dosym bash /bin/rbash
668 -
669 - insinto /etc/bash
670 - doins "${FILESDIR}"/bash_logout
671 - doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
672 -
673 - keepdir /etc/bash/bashrc.d
674 -
675 - insinto /etc/skel
676 - for f in bash{_logout,_profile,rc} ; do
677 - newins "${FILESDIR}"/dot-${f} .${f}
678 - done
679 -
680 - local sed_args=(
681 - -e "s:#${USERLAND}#@::"
682 - -e '/#@/d'
683 - )
684 -
685 - if ! use readline ; then
686 - # bug #432338
687 - sed_args+=(
688 - -e '/^shopt -s histappend/s:^:#:'
689 - -e 's:use_color=true:use_color=false:'
690 - )
691 - fi
692 -
693 - sed -i \
694 - "${sed_args[@]}" \
695 - "${ED}"/etc/skel/.bashrc \
696 - "${ED}"/etc/bash/bashrc || die
697 -
698 - if use plugins ; then
699 - exeinto /usr/$(get_libdir)/bash
700 - doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
701 -
702 - insinto /usr/include/bash-plugins
703 - doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
704 - fi
705 -
706 - if use examples ; then
707 - for d in examples/{functions,misc,scripts,startup-files} ; do
708 - exeinto /usr/share/doc/${PF}/${d}
709 - docinto ${d}
710 - for f in ${d}/* ; do
711 - if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
712 - doexe ${f}
713 - else
714 - dodoc ${f}
715 - fi
716 - done
717 - done
718 - fi
719 -
720 - # Install bash_builtins.1 and rbash.1
721 - emake -C doc DESTDIR="${D}" install_builtins
722 - sed 's:bash\.1:man1/&:' doc/rbash.1 > "${T}"/rbash.1 || die
723 - doman "${T}"/rbash.1
724 -
725 - newdoc CWRU/changelog ChangeLog
726 - dosym bash.info /usr/share/info/bashref.info
727 -}
728 -
729 -pkg_preinst() {
730 - if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
731 - mkdir -p "${EROOT}"/etc/bash
732 - mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
733 - fi
734 -}
735 -
736 -pkg_postinst() {
737 - # If /bin/sh does not exist, provide it
738 - if [[ ! -e ${EROOT}/bin/sh ]] ; then
739 - ln -sf bash "${EROOT}"/bin/sh
740 - fi
741 -}