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