Gentoo Archives: gentoo-commits

From: "Lars Wendler (polynomial-c)" <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-shells/bash: bash-4.3_p24-r2.ebuild bash-4.0_p38-r1.ebuild bash-4.1_p11-r1.ebuild ChangeLog bash-3.1_p17-r1.ebuild bash-3.2_p51-r1.ebuild bash-4.2_p47-r1.ebuild bash-4.3_p24.ebuild bash-4.3_p24-r1.ebuild
Date: Wed, 24 Sep 2014 14:01:59
Message-Id: 20140924140155.CF2EA6208@oystercatcher.gentoo.org
1 polynomial-c 14/09/24 14:01:55
2
3 Modified: ChangeLog
4 Added: bash-4.3_p24-r2.ebuild bash-4.0_p38-r1.ebuild
5 bash-4.1_p11-r1.ebuild bash-3.1_p17-r1.ebuild
6 bash-3.2_p51-r1.ebuild bash-4.2_p47-r1.ebuild
7 Removed: bash-4.3_p24.ebuild bash-4.3_p24-r1.ebuild
8 Log:
9 Security bump (bug #523592). Fixed environment handling command injection (CVE-2014-6271)
10
11 (Portage version: 2.2.13/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)
12
13 Revision Changes Path
14 1.381 app-shells/bash/ChangeLog
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/ChangeLog?rev=1.381&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/ChangeLog?rev=1.381&content-type=text/plain
18 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/ChangeLog?r1=1.380&r2=1.381
19
20 Index: ChangeLog
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v
23 retrieving revision 1.380
24 retrieving revision 1.381
25 diff -u -r1.380 -r1.381
26 --- ChangeLog 9 Sep 2014 15:59:39 -0000 1.380
27 +++ ChangeLog 24 Sep 2014 14:01:55 -0000 1.381
28 @@ -1,6 +1,21 @@
29 # ChangeLog for app-shells/bash
30 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
31 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.380 2014/09/09 15:59:39 polynomial-c Exp $
32 +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.381 2014/09/24 14:01:55 polynomial-c Exp $
33 +
34 +*bash-4.3_p24-r2 (24 Sep 2014)
35 +*bash-4.2_p47-r1 (24 Sep 2014)
36 +*bash-4.1_p11-r1 (24 Sep 2014)
37 +*bash-4.0_p38-r1 (24 Sep 2014)
38 +*bash-3.2_p51-r1 (24 Sep 2014)
39 +*bash-3.1_p17-r1 (24 Sep 2014)
40 +
41 + 24 Sep 2014; Lars Wendler <polynomial-c@g.o> +bash-3.1_p17-r1.ebuild,
42 + +bash-3.2_p51-r1.ebuild, +bash-4.0_p38-r1.ebuild, +bash-4.1_p11-r1.ebuild,
43 + +bash-4.2_p47-r1.ebuild, -bash-4.3_p24.ebuild, -bash-4.3_p24-r1.ebuild,
44 + +bash-4.3_p24-r2.ebuild, +files/bash-3.1-funcdef-import.patch,
45 + +files/bash-4.3-funcdef-import.patch:
46 + Security bump (bug #523592). Fixed environment handling command injection
47 + (CVE-2014-6271).
48
49 *bash-4.3_p24-r1 (09 Sep 2014)
50
51
52
53
54 1.1 app-shells/bash/bash-4.3_p24-r2.ebuild
55
56 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.3_p24-r2.ebuild?rev=1.1&view=markup
57 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.3_p24-r2.ebuild?rev=1.1&content-type=text/plain
58
59 Index: bash-4.3_p24-r2.ebuild
60 ===================================================================
61 # Copyright 1999-2014 Gentoo Foundation
62 # Distributed under the terms of the GNU General Public License v2
63 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.3_p24-r2.ebuild,v 1.1 2014/09/24 14:01:55 polynomial-c Exp $
64
65 EAPI="4"
66
67 inherit eutils flag-o-matic toolchain-funcs multilib
68
69 # Official patchlevel
70 # See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
71 PLEVEL=${PV##*_p}
72 MY_PV=${PV/_p*}
73 MY_PV=${MY_PV/_/-}
74 MY_P=${PN}-${MY_PV}
75 [[ ${PV} != *_p* ]] && PLEVEL=0
76 patches() {
77 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
78 [[ ${plevel} -eq 0 ]] && return 1
79 eval set -- {1..${plevel}}
80 set -- $(printf "${pn}${pv/\.}-%03d " "$@")
81 if [[ ${opt} == -s ]] ; then
82 echo "${@/#/${DISTDIR}/}"
83 else
84 local u
85 for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
86 printf "${u}/${pn}-${pv}-patches/%s " "$@"
87 done
88 fi
89 }
90
91 # The version of readline this bash normally ships with.
92 READLINE_VER="6.3"
93
94 DESCRIPTION="The standard GNU Bourne again shell"
95 HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
96 SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
97 [[ ${PV} == *_rc* ]] && SRC_URI+=" ftp://ftp.cwru.edu/pub/bash/${MY_P}.tar.gz"
98
99 LICENSE="GPL-3"
100 SLOT="0"
101 #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
102 IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
103
104 DEPEND=">=sys-libs/ncurses-5.2-r2
105 readline? ( >=sys-libs/readline-${READLINE_VER} )
106 nls? ( virtual/libintl )"
107 RDEPEND="${DEPEND}
108 !<sys-apps/portage-2.1.6.7_p1
109 !<sys-apps/paludis-0.26.0_alpha5"
110 # we only need yacc when the .y files get patched (bash42-005)
111 DEPEND+=" virtual/yacc"
112
113 S=${WORKDIR}/${MY_P}
114
115 pkg_setup() {
116 if is-flag -malign-double ; then #7332
117 eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
118 eerror "as it breaks LFS (struct stat64) on x86."
119 die "remove -malign-double from your CFLAGS mr ricer"
120 fi
121 if use bashlogger ; then
122 ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
123 ewarn "This will log ALL output you enter into the shell, you have been warned."
124 fi
125 }
126
127 src_unpack() {
128 unpack ${MY_P}.tar.gz
129 }
130
131 src_prepare() {
132 # Include official patches
133 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
134
135 # Clean out local libs so we know we use system ones w/releases.
136 if [[ ${PV} != *_rc* ]] ; then
137 rm -rf lib/{readline,termcap}/*
138 touch lib/{readline,termcap}/Makefile.in # for config.status
139 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
140 fi
141
142 # Avoid regenerating docs after patches #407985
143 sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
144 touch -r . doc/*
145
146 epatch "${FILESDIR}"/${PN}-4.3-compat-lvl.patch
147 epatch "${FILESDIR}"/${PN}-4.3-parse-time-keyword.patch
148 epatch "${FILESDIR}"/${PN}-4.3-append-process-segfault.patch
149 epatch "${FILESDIR}"/${PN}-4.3-term-cleanup.patch
150 epatch "${FILESDIR}"/${PN}-4.3-funcdef-import.patch
151
152 epatch_user
153 }
154
155 src_configure() {
156 local myconf=()
157
158 # For descriptions of these, see config-top.h
159 # bashrc/#26952 bash_logout/#90488 ssh/#24762
160 append-cppflags \
161 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
162 -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
163 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
164 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
165 -DNON_INTERACTIVE_LOGIN_SHELLS \
166 -DSSH_SOURCE_BASHRC \
167 $(use bashlogger && echo -DSYSLOG_HISTORY)
168
169 # Don't even think about building this statically without
170 # reading Bug 7714 first. If you still build it statically,
171 # don't come crying to us with bugs ;).
172 #use static && export LDFLAGS="${LDFLAGS} -static"
173 use nls || myconf+=( --disable-nls )
174
175 # Historically, we always used the builtin readline, but since
176 # our handling of SONAME upgrades has gotten much more stable
177 # in the PM (and the readline ebuild itself preserves the old
178 # libs during upgrades), linking against the system copy should
179 # be safe.
180 # Exact cached version here doesn't really matter as long as it
181 # is at least what's in the DEPEND up above.
182 export ac_cv_rl_version=${READLINE_VER}
183
184 # Force linking with system curses ... the bundled termcap lib
185 # sucks bad compared to ncurses. For the most part, ncurses
186 # is here because readline needs it. But bash itself calls
187 # ncurses in one or two small places :(.
188
189 if [[ ${PV} != *_rc* ]] ; then
190 # Use system readline only with released versions.
191 myconf+=( --with-installed-readline=. )
192 fi
193
194 if use plugins; then
195 append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
196 else
197 # Disable the plugins logic by hand since bash doesn't
198 # provide a way of doing it.
199 export ac_cv_func_dl{close,open,sym}=no \
200 ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
201 sed -i \
202 -e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
203 configure || die
204 fi
205 tc-export AR #444070
206 econf \
207 --docdir='$(datarootdir)'/doc/${PF} \
208 --htmldir='$(docdir)/html' \
209 --with-curses \
210 $(use_with afs) \
211 $(use_enable net net-redirections) \
212 --disable-profiling \
213 $(use_enable mem-scramble) \
214 $(use_with mem-scramble bash-malloc) \
215 $(use_enable readline) \
216 $(use_enable readline history) \
217 $(use_enable readline bang-history) \
218 "${myconf[@]}"
219 }
220
221 src_compile() {
222 emake
223
224 if use plugins ; then
225 emake -C examples/loadables all others
226 fi
227 }
228
229 src_install() {
230 local d f
231
232 default
233
234 dodir /bin
235 mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
236 dosym bash /bin/rbash
237
238 insinto /etc/bash
239 doins "${FILESDIR}"/{bashrc,bash_logout}
240 insinto /etc/skel
241 for f in bash{_logout,_profile,rc} ; do
242 newins "${FILESDIR}"/dot-${f} .${f}
243 done
244
245 local sed_args=(
246 -e "s:#${USERLAND}#@::"
247 -e '/#@/d'
248 )
249 if ! use readline ; then
250 sed_args+=( #432338
251 -e '/^shopt -s histappend/s:^:#:'
252 -e 's:use_color=true:use_color=false:'
253 )
254 fi
255 sed -i \
256 "${sed_args[@]}" \
257 "${ED}"/etc/skel/.bashrc \
258 "${ED}"/etc/bash/bashrc || die
259
260 if use plugins ; then
261 exeinto /usr/$(get_libdir)/bash
262 doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
263 insinto /usr/include/bash-plugins
264 doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
265 fi
266
267 if use examples ; then
268 for d in examples/{functions,misc,scripts,scripts.noah,scripts.v2} ; do
269 exeinto /usr/share/doc/${PF}/${d}
270 insinto /usr/share/doc/${PF}/${d}
271 for f in ${d}/* ; do
272 if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
273 doexe ${f}
274 else
275 doins ${f}
276 fi
277 done
278 done
279 fi
280
281 doman doc/*.1
282 newdoc CWRU/changelog ChangeLog
283 dosym bash.info /usr/share/info/bashref.info
284 }
285
286 pkg_preinst() {
287 if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
288 mkdir -p "${EROOT}"/etc/bash
289 mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
290 fi
291
292 if [[ -L ${EROOT}/bin/sh ]] ; then
293 # rewrite the symlink to ensure that its mtime changes. having /bin/sh
294 # missing even temporarily causes a fatal error with paludis.
295 local target=$(readlink "${EROOT}"/bin/sh)
296 local tmp=$(emktemp "${EROOT}"/bin)
297 ln -sf "${target}" "${tmp}"
298 mv -f "${tmp}" "${EROOT}"/bin/sh
299 fi
300 }
301
302 pkg_postinst() {
303 # If /bin/sh does not exist, provide it
304 if [[ ! -e ${EROOT}/bin/sh ]] ; then
305 ln -sf bash "${EROOT}"/bin/sh
306 fi
307 }
308
309
310
311 1.1 app-shells/bash/bash-4.0_p38-r1.ebuild
312
313 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.0_p38-r1.ebuild?rev=1.1&view=markup
314 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.0_p38-r1.ebuild?rev=1.1&content-type=text/plain
315
316 Index: bash-4.0_p38-r1.ebuild
317 ===================================================================
318 # Copyright 1999-2014 Gentoo Foundation
319 # Distributed under the terms of the GNU General Public License v2
320 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.0_p38-r1.ebuild,v 1.1 2014/09/24 14:01:55 polynomial-c Exp $
321
322 EAPI="4"
323
324 inherit eutils flag-o-matic toolchain-funcs
325
326 # Official patchlevel
327 # See ftp://ftp.cwru.edu/pub/bash/bash-4.0-patches/
328 PLEVEL=${PV##*_p}
329 MY_PV=${PV/_p*}
330 MY_PV=${MY_PV/_/-}
331 MY_P=${PN}-${MY_PV}
332 [[ ${PV} != *_p* ]] && PLEVEL=0
333 patches() {
334 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
335 [[ ${plevel} -eq 0 ]] && return 1
336 eval set -- {1..${plevel}}
337 set -- $(printf "${pn}${pv/\.}-%03d " "$@")
338 if [[ ${opt} == -s ]] ; then
339 echo "${@/#/${DISTDIR}/}"
340 else
341 local u
342 for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
343 printf "${u}/${pn}-${pv}-patches/%s " "$@"
344 done
345 fi
346 }
347
348 DESCRIPTION="The standard GNU Bourne again shell"
349 HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
350 SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
351
352 LICENSE="GPL-3"
353 SLOT="${MY_PV}"
354 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
355 IUSE="afs mem-scramble +net nls +readline"
356
357 DEPEND=">=sys-libs/ncurses-5.2-r2
358 readline? ( >=sys-libs/readline-6.2 )
359 nls? ( virtual/libintl )"
360 RDEPEND="${DEPEND}"
361
362 S=${WORKDIR}/${MY_P}
363
364 pkg_setup() {
365 if is-flag -malign-double ; then #7332
366 eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
367 eerror "as it breaks LFS (struct stat64) on x86."
368 die "remove -malign-double from your CFLAGS mr ricer"
369 fi
370 }
371
372 src_unpack() {
373 unpack ${MY_P}.tar.gz
374 }
375
376 src_prepare() {
377 # Include official patches
378 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
379
380 # Clean out local libs so we know we use system ones
381 rm -rf lib/{readline,termcap}/*
382 touch lib/{readline,termcap}/Makefile.in # for config.status
383 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
384
385 epatch "${FILESDIR}"/${PN}-4.0-configure.patch #304901
386 epatch "${FILESDIR}"/${PN}-4.x-deferred-heredocs.patch
387 sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
388 epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671
389 epatch "${FILESDIR}"/${PN}-4.0-ldflags-for-build.patch #211947
390 epatch "${FILESDIR}"/${PN}-4.0-negative-return.patch
391 epatch "${FILESDIR}"/${PN}-4.0-parallel-build.patch #267613
392 sed -i '/\.o: .*shell\.h/s:$: pathnames.h:' Makefile.in #267613
393 epatch "${FILESDIR}"/${PN}-3.1-funcdef-import.patch
394
395 epatch_user
396 }
397
398 src_configure() {
399 local myconf=()
400
401 # For descriptions of these, see config-top.h
402 # bashrc/#26952 bash_logout/#90488 ssh/#24762
403 append-cppflags \
404 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
405 -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
406 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
407 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
408 -DNON_INTERACTIVE_LOGIN_SHELLS \
409 -DSSH_SOURCE_BASHRC
410
411 # Don't even think about building this statically without
412 # reading Bug 7714 first. If you still build it statically,
413 # don't come crying to us with bugs ;).
414 #use static && export LDFLAGS="${LDFLAGS} -static"
415 use nls || myconf+=( --disable-nls )
416
417 # Historically, we always used the builtin readline, but since
418 # our handling of SONAME upgrades has gotten much more stable
419 # in the PM (and the readline ebuild itself preserves the old
420 # libs during upgrades), linking against the system copy should
421 # be safe.
422 # Exact cached version here doesn't really matter as long as it
423 # is at least what's in the DEPEND up above.
424 export ac_cv_rl_version=6.2
425
426 # Force linking with system curses ... the bundled termcap lib
427 # sucks bad compared to ncurses. For the most part, ncurses
428 # is here because readline needs it. But bash itself calls
429 # ncurses in one or two small places :(.
430
431 tc-export AR #444070
432 econf \
433 --with-installed-readline=. \
434 --with-curses \
435 $(use_with afs) \
436 $(use_enable net net-redirections) \
437 --disable-profiling \
438 $(use_enable mem-scramble) \
439 $(use_with mem-scramble bash-malloc) \
440 $(use_enable readline) \
441 $(use_enable readline history) \
442 $(use_enable readline bang-history) \
443 "${myconf[@]}"
444 }
445
446 src_install() {
447 into /
448 newbin bash bash-${SLOT}
449
450 newman doc/bash.1 bash-${SLOT}.1
451 newman doc/builtins.1 builtins-${SLOT}.1
452
453 insinto /usr/share/info
454 newins doc/bashref.info bash-${SLOT}.info
455 dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
456
457 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
458 }
459
460
461
462 1.1 app-shells/bash/bash-4.1_p11-r1.ebuild
463
464 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.1_p11-r1.ebuild?rev=1.1&view=markup
465 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.1_p11-r1.ebuild?rev=1.1&content-type=text/plain
466
467 Index: bash-4.1_p11-r1.ebuild
468 ===================================================================
469 # Copyright 1999-2014 Gentoo Foundation
470 # Distributed under the terms of the GNU General Public License v2
471 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.1_p11-r1.ebuild,v 1.1 2014/09/24 14:01:55 polynomial-c Exp $
472
473 EAPI="4"
474
475 inherit eutils flag-o-matic toolchain-funcs
476
477 # Official patchlevel
478 # See ftp://ftp.cwru.edu/pub/bash/bash-4.1-patches/
479 PLEVEL=${PV##*_p}
480 MY_PV=${PV/_p*}
481 MY_PV=${MY_PV/_/-}
482 MY_P=${PN}-${MY_PV}
483 [[ ${PV} != *_p* ]] && PLEVEL=0
484 patches() {
485 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
486 [[ ${plevel} -eq 0 ]] && return 1
487 eval set -- {1..${plevel}}
488 set -- $(printf "${pn}${pv/\.}-%03d " "$@")
489 if [[ ${opt} == -s ]] ; then
490 echo "${@/#/${DISTDIR}/}"
491 else
492 local u
493 for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
494 printf "${u}/${pn}-${pv}-patches/%s " "$@"
495 done
496 fi
497 }
498
499 DESCRIPTION="The standard GNU Bourne again shell"
500 HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
501 SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
502
503 LICENSE="GPL-3"
504 SLOT="${MY_PV}"
505 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
506 IUSE="afs mem-scramble +net nls +readline"
507
508 DEPEND=">=sys-libs/ncurses-5.2-r2
509 readline? ( >=sys-libs/readline-6.2 )
510 nls? ( virtual/libintl )"
511 RDEPEND="${DEPEND}"
512
513 S=${WORKDIR}/${MY_P}
514
515 pkg_setup() {
516 if is-flag -malign-double ; then #7332
517 eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
518 eerror "as it breaks LFS (struct stat64) on x86."
519 die "remove -malign-double from your CFLAGS mr ricer"
520 fi
521 }
522
523 src_unpack() {
524 unpack ${MY_P}.tar.gz
525 }
526
527 src_prepare() {
528 # Include official patches
529 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
530
531 # Clean out local libs so we know we use system ones
532 rm -rf lib/{readline,termcap}/*
533 touch lib/{readline,termcap}/Makefile.in # for config.status
534 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
535
536 epatch "${FILESDIR}"/${PN}-4.1-fbsd-eaccess.patch #303411
537 sed -i '1i#define NEED_FPURGE_DECL' execute_cmd.c # needs fpurge() decl
538 epatch "${FILESDIR}"/${PN}-4.1-parallel-build.patch
539 epatch "${FILESDIR}"/${PN}-3.1-funcdef-import.patch
540
541 epatch_user
542 }
543
544 src_configure() {
545 local myconf=()
546
547 myconf+=( --without-lispdir ) #335896
548
549 # For descriptions of these, see config-top.h
550 # bashrc/#26952 bash_logout/#90488 ssh/#24762
551 append-cppflags \
552 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
553 -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
554 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
555 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
556 -DNON_INTERACTIVE_LOGIN_SHELLS \
557 -DSSH_SOURCE_BASHRC
558
559 # Don't even think about building this statically without
560 # reading Bug 7714 first. If you still build it statically,
561 # don't come crying to us with bugs ;).
562 #use static && export LDFLAGS="${LDFLAGS} -static"
563 use nls || myconf+=( --disable-nls )
564
565 # Historically, we always used the builtin readline, but since
566 # our handling of SONAME upgrades has gotten much more stable
567 # in the PM (and the readline ebuild itself preserves the old
568 # libs during upgrades), linking against the system copy should
569 # be safe.
570 # Exact cached version here doesn't really matter as long as it
571 # is at least what's in the DEPEND up above.
572 export ac_cv_rl_version=6.2
573
574 # Force linking with system curses ... the bundled termcap lib
575 # sucks bad compared to ncurses. For the most part, ncurses
576 # is here because readline needs it. But bash itself calls
577 # ncurses in one or two small places :(.
578
579 tc-export AR #444070
580 econf \
581 --with-installed-readline=. \
582 --with-curses \
583 $(use_with afs) \
584 $(use_enable net net-redirections) \
585 --disable-profiling \
586 $(use_enable mem-scramble) \
587 $(use_with mem-scramble bash-malloc) \
588 $(use_enable readline) \
589 $(use_enable readline history) \
590 $(use_enable readline bang-history) \
591 "${myconf[@]}"
592 }
593
594 src_install() {
595 into /
596 newbin bash bash-${SLOT}
597
598 newman doc/bash.1 bash-${SLOT}.1
599 newman doc/builtins.1 builtins-${SLOT}.1
600
601 insinto /usr/share/info
602 newins doc/bashref.info bash-${SLOT}.info
603 dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
604
605 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
606 }
607
608
609
610 1.1 app-shells/bash/bash-3.1_p17-r1.ebuild
611
612 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-3.1_p17-r1.ebuild?rev=1.1&view=markup
613 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-3.1_p17-r1.ebuild?rev=1.1&content-type=text/plain
614
615 Index: bash-3.1_p17-r1.ebuild
616 ===================================================================
617 # Copyright 1999-2014 Gentoo Foundation
618 # Distributed under the terms of the GNU General Public License v2
619 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.1_p17-r1.ebuild,v 1.1 2014/09/24 14:01:55 polynomial-c Exp $
620
621 EAPI="4"
622
623 inherit eutils flag-o-matic toolchain-funcs
624
625 # Official patchlevel
626 # See ftp://ftp.cwru.edu/pub/bash/bash-3.1-patches/
627 PLEVEL=${PV##*_p}
628 MY_PV=${PV/_p*}
629 MY_PV=${MY_PV/_/-}
630 MY_P=${PN}-${MY_PV}
631 [[ ${PV} != *_p* ]] && PLEVEL=0
632 patches() {
633 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
634 [[ ${plevel} -eq 0 ]] && return 1
635 eval set -- {1..${plevel}}
636 set -- $(printf "${pn}${pv/\.}-%03d " "$@")
637 if [[ ${opt} == -s ]] ; then
638 echo "${@/#/${DISTDIR}/}"
639 else
640 local u
641 for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
642 printf "${u}/${pn}-${pv}-patches/%s " "$@"
643 done
644 fi
645 }
646
647 DESCRIPTION="The standard GNU Bourne again shell"
648 HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
649 SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
650
651 LICENSE="GPL-2"
652 SLOT="${MY_PV}"
653 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
654 IUSE="afs +net nls +readline"
655
656 DEPEND=">=sys-libs/ncurses-5.2-r2
657 readline? ( >=sys-libs/readline-6.2 )
658 nls? ( virtual/libintl )"
659 RDEPEND="${DEPEND}"
660
661 S=${WORKDIR}/${MY_P}
662
663 pkg_setup() {
664 if is-flag -malign-double ; then #7332
665 eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
666 eerror "as it breaks LFS (struct stat64) on x86."
667 die "remove -malign-double from your CFLAGS mr ricer"
668 fi
669 }
670
671 src_unpack() {
672 unpack ${MY_P}.tar.gz
673 }
674
675 src_prepare() {
676 # Include official patches
677 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
678
679 # Clean out local libs so we know we use system ones
680 rm -rf lib/{readline,termcap}/*
681 touch lib/{readline,termcap}/Makefile.in # for config.status
682 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
683
684 epatch "${FILESDIR}"/${PN}-3.1-gentoo.patch
685 epatch "${FILESDIR}"/autoconf-mktime-2.53.patch #220040
686 epatch "${FILESDIR}"/${PN}-3.1-ulimit.patch
687 epatch "${FILESDIR}"/${PN}-3.0-read-memleak.patch
688 epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
689 epatch "${FILESDIR}"/bash-3.1-fix-dash-login-shell.patch #118257
690 epatch "${FILESDIR}"/bash-3.1-dev-fd-test-as-user.patch #131875
691 epatch "${FILESDIR}"/${PN}-3.1-funcdef-import.patch
692
693 epatch_user
694 }
695
696 src_configure() {
697 local myconf=()
698
699 # Force pgrp synchronization
700 # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
701 export bash_cv_pgrp_pipe=yes
702
703 # For descriptions of these, see config-top.h
704 # bashrc/#26952 bash_logout/#90488 ssh/#24762
705 append-cppflags \
706 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
707 -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
708 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
709 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
710 -DNON_INTERACTIVE_LOGIN_SHELLS \
711 -DSSH_SOURCE_BASHRC
712
713 # Don't even think about building this statically without
714 # reading Bug 7714 first. If you still build it statically,
715 # don't come crying to us with bugs ;).
716 #use static && export LDFLAGS="${LDFLAGS} -static"
717 use nls || myconf+=( --disable-nls )
718
719 # Historically, we always used the builtin readline, but since
720 # our handling of SONAME upgrades has gotten much more stable
721 # in the PM (and the readline ebuild itself preserves the old
722 # libs during upgrades), linking against the system copy should
723 # be safe.
724 # Exact cached version here doesn't really matter as long as it
725 # is at least what's in the DEPEND up above.
726 export ac_cv_rl_version=6.2
727
728 # Force linking with system curses ... the bundled termcap lib
729 # sucks bad compared to ncurses. For the most part, ncurses
730 # is here because readline needs it. But bash itself calls
731 # ncurses in one or two small places :(.
732
733 tc-export AR #444070
734 econf \
735 --with-installed-readline=. \
736 --with-curses \
737 $(use_with afs) \
738 $(use_enable net net-redirections) \
739 --disable-profiling \
740 --without-gnu-malloc \
741 $(use_enable readline) \
742 $(use_enable readline history) \
743 $(use_enable readline bang-history) \
744 "${myconf[@]}"
745 }
746
747 src_compile() {
748 emake -j1 #102426
749 }
750
751 src_install() {
752 into /
753 newbin bash bash-${SLOT}
754
755 newman doc/bash.1 bash-${SLOT}.1
756 newman doc/builtins.1 builtins-${SLOT}.1
757
758 insinto /usr/share/info
759 newins doc/bashref.info bash-${SLOT}.info
760 dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
761
762 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
763 }
764
765
766
767 1.1 app-shells/bash/bash-3.2_p51-r1.ebuild
768
769 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-3.2_p51-r1.ebuild?rev=1.1&view=markup
770 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-3.2_p51-r1.ebuild?rev=1.1&content-type=text/plain
771
772 Index: bash-3.2_p51-r1.ebuild
773 ===================================================================
774 # Copyright 1999-2014 Gentoo Foundation
775 # Distributed under the terms of the GNU General Public License v2
776 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-3.2_p51-r1.ebuild,v 1.1 2014/09/24 14:01:55 polynomial-c Exp $
777
778 EAPI="4"
779
780 inherit eutils flag-o-matic toolchain-funcs
781
782 # Official patchlevel
783 # See ftp://ftp.cwru.edu/pub/bash/bash-3.2-patches/
784 PLEVEL=${PV##*_p}
785 MY_PV=${PV/_p*}
786 MY_PV=${MY_PV/_/-}
787 MY_P=${PN}-${MY_PV}
788 [[ ${PV} != *_p* ]] && PLEVEL=0
789 patches() {
790 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
791 [[ ${plevel} -eq 0 ]] && return 1
792 eval set -- {1..${plevel}}
793 set -- $(printf "${pn}${pv/\.}-%03d " "$@")
794 if [[ ${opt} == -s ]] ; then
795 echo "${@/#/${DISTDIR}/}"
796 else
797 local u
798 for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
799 printf "${u}/${pn}-${pv}-patches/%s " "$@"
800 done
801 fi
802 }
803
804 DESCRIPTION="The standard GNU Bourne again shell"
805 HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
806 SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
807
808 LICENSE="GPL-2"
809 SLOT="${MY_PV}"
810 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
811 IUSE="afs +net nls +readline"
812
813 DEPEND=">=sys-libs/ncurses-5.2-r2
814 readline? ( >=sys-libs/readline-6.2 )
815 nls? ( virtual/libintl )"
816 RDEPEND="${DEPEND}"
817
818 S=${WORKDIR}/${MY_P}
819
820 pkg_setup() {
821 if is-flag -malign-double ; then #7332
822 eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
823 eerror "as it breaks LFS (struct stat64) on x86."
824 die "remove -malign-double from your CFLAGS mr ricer"
825 fi
826 }
827
828 src_unpack() {
829 unpack ${MY_P}.tar.gz
830 }
831
832 src_prepare() {
833 # Include official patches
834 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
835
836 # Clean out local libs so we know we use system ones
837 rm -rf lib/{readline,termcap}/*
838 touch lib/{readline,termcap}/Makefile.in # for config.status
839 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
840
841 epatch "${FILESDIR}"/autoconf-mktime-2.59.patch #220040
842 epatch "${FILESDIR}"/${PN}-3.1-gentoo.patch
843 epatch "${FILESDIR}"/${PN}-3.2-loadables.patch
844 epatch "${FILESDIR}"/${PN}-3.2-protos.patch
845 epatch "${FILESDIR}"/${PN}-3.2-session-leader.patch #231775
846 epatch "${FILESDIR}"/${PN}-3.2-parallel-build.patch #189671
847 epatch "${FILESDIR}"/${PN}-3.2-ldflags-for-build.patch #211947
848 epatch "${FILESDIR}"/${PN}-3.2-process-subst.patch
849 epatch "${FILESDIR}"/${PN}-3.2-ulimit.patch
850 epatch "${FILESDIR}"/${PN}-3.0-trap-fg-signals.patch
851 epatch "${FILESDIR}"/${PN}-3.2-dev-fd-test-as-user.patch #131875
852 epatch "${FILESDIR}"/${PN}-3.1-funcdef-import.patch
853
854 epatch_user
855 }
856
857 src_configure() {
858 local myconf=()
859
860 # Force pgrp synchronization
861 # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=81653
862 export bash_cv_pgrp_pipe=yes
863
864 # For descriptions of these, see config-top.h
865 # bashrc/#26952 bash_logout/#90488 ssh/#24762
866 append-cppflags \
867 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
868 -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
869 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
870 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
871 -DNON_INTERACTIVE_LOGIN_SHELLS \
872 -DSSH_SOURCE_BASHRC
873
874 # Don't even think about building this statically without
875 # reading Bug 7714 first. If you still build it statically,
876 # don't come crying to us with bugs ;).
877 #use static && export LDFLAGS="${LDFLAGS} -static"
878 use nls || myconf+=( --disable-nls )
879
880 # Historically, we always used the builtin readline, but since
881 # our handling of SONAME upgrades has gotten much more stable
882 # in the PM (and the readline ebuild itself preserves the old
883 # libs during upgrades), linking against the system copy should
884 # be safe.
885 # Exact cached version here doesn't really matter as long as it
886 # is at least what's in the DEPEND up above.
887 export ac_cv_rl_version=6.2
888
889 # Force linking with system curses ... the bundled termcap lib
890 # sucks bad compared to ncurses. For the most part, ncurses
891 # is here because readline needs it. But bash itself calls
892 # ncurses in one or two small places :(.
893
894 tc-export AR #444070
895 econf \
896 --with-installed-readline=. \
897 --with-curses \
898 $(use_with afs) \
899 $(use_enable net net-redirections) \
900 --disable-profiling \
901 --without-gnu-malloc \
902 $(use_enable readline) \
903 $(use_enable readline history) \
904 $(use_enable readline bang-history) \
905 "${myconf[@]}"
906 }
907
908 src_install() {
909 into /
910 newbin bash bash-${SLOT}
911
912 newman doc/bash.1 bash-${SLOT}.1
913 newman doc/builtins.1 builtins-${SLOT}.1
914
915 insinto /usr/share/info
916 newins doc/bashref.info bash-${SLOT}.info
917 dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
918
919 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
920 }
921
922
923
924 1.1 app-shells/bash/bash-4.2_p47-r1.ebuild
925
926 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.2_p47-r1.ebuild?rev=1.1&view=markup
927 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/bash-4.2_p47-r1.ebuild?rev=1.1&content-type=text/plain
928
929 Index: bash-4.2_p47-r1.ebuild
930 ===================================================================
931 # Copyright 1999-2014 Gentoo Foundation
932 # Distributed under the terms of the GNU General Public License v2
933 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p47-r1.ebuild,v 1.1 2014/09/24 14:01:55 polynomial-c Exp $
934
935 EAPI="4"
936
937 inherit eutils flag-o-matic toolchain-funcs multilib
938
939 # Official patchlevel
940 # See ftp://ftp.cwru.edu/pub/bash/bash-4.2-patches/
941 PLEVEL=${PV##*_p}
942 MY_PV=${PV/_p*}
943 MY_PV=${MY_PV/_/-}
944 MY_P=${PN}-${MY_PV}
945 [[ ${PV} != *_p* ]] && PLEVEL=0
946 patches() {
947 local opt=$1 plevel=${2:-${PLEVEL}} pn=${3:-${PN}} pv=${4:-${MY_PV}}
948 [[ ${plevel} -eq 0 ]] && return 1
949 eval set -- {1..${plevel}}
950 set -- $(printf "${pn}${pv/\.}-%03d " "$@")
951 if [[ ${opt} == -s ]] ; then
952 echo "${@/#/${DISTDIR}/}"
953 else
954 local u
955 for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${pn} ; do
956 printf "${u}/${pn}-${pv}-patches/%s " "$@"
957 done
958 fi
959 }
960
961 DESCRIPTION="The standard GNU Bourne again shell"
962 HOMEPAGE="http://tiswww.case.edu/php/chet/bash/bashtop.html"
963 SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
964
965 LICENSE="GPL-3"
966 SLOT="0"
967 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
968 IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline vanilla"
969
970 DEPEND=">=sys-libs/ncurses-5.2-r2
971 readline? ( >=sys-libs/readline-6.2 )
972 nls? ( virtual/libintl )"
973 RDEPEND="${DEPEND}
974 !!<sys-apps/portage-2.1.6.7_p1
975 !!<sys-apps/paludis-0.26.0_alpha5"
976 # we only need yacc when the .y files get patched (bash42-005)
977 DEPEND+=" virtual/yacc"
978
979 S=${WORKDIR}/${MY_P}
980
981 pkg_setup() {
982 if is-flag -malign-double ; then #7332
983 eerror "Detected bad CFLAGS '-malign-double'. Do not use this"
984 eerror "as it breaks LFS (struct stat64) on x86."
985 die "remove -malign-double from your CFLAGS mr ricer"
986 fi
987 if use bashlogger ; then
988 ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
989 ewarn "This will log ALL output you enter into the shell, you have been warned."
990 fi
991 }
992
993 src_unpack() {
994 unpack ${MY_P}.tar.gz
995 }
996
997 src_prepare() {
998 # Include official patches
999 [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
1000
1001 # Clean out local libs so we know we use system ones
1002 rm -rf lib/{readline,termcap}/*
1003 touch lib/{readline,termcap}/Makefile.in # for config.status
1004 sed -ri -e 's:\$[(](RL|HIST)_LIBSRC[)]/[[:alpha:]]*.h::g' Makefile.in || die
1005
1006 # Avoid regenerating docs after patches #407985
1007 sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
1008 touch -r . doc/*
1009
1010 epatch "${FILESDIR}"/${PN}-4.2-execute-job-control.patch #383237
1011 epatch "${FILESDIR}"/${PN}-4.2-parallel-build.patch
1012 epatch "${FILESDIR}"/${PN}-4.2-no-readline.patch
1013 epatch "${FILESDIR}"/${PN}-4.2-read-retry.patch #447810
1014 if ! use vanilla ; then
1015 epatch "${FILESDIR}"/${PN}-4.2-speed-up-read-N.patch
1016 fi
1017 epatch "${FILESDIR}"/${PN}-3.1-funcdef-import.patch
1018
1019 epatch_user
1020 }
1021
1022 src_configure() {
1023 local myconf=()
1024
1025 # For descriptions of these, see config-top.h
1026 # bashrc/#26952 bash_logout/#90488 ssh/#24762
1027 append-cppflags \
1028 -DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
1029 -DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
1030 -DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
1031 -DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
1032 -DNON_INTERACTIVE_LOGIN_SHELLS \
1033 -DSSH_SOURCE_BASHRC \
1034 $(use bashlogger && echo -DSYSLOG_HISTORY)
1035
1036 # Don't even think about building this statically without
1037 # reading Bug 7714 first. If you still build it statically,
1038 # don't come crying to us with bugs ;).
1039 #use static && export LDFLAGS="${LDFLAGS} -static"
1040 use nls || myconf+=( --disable-nls )
1041
1042 # Historically, we always used the builtin readline, but since
1043 # our handling of SONAME upgrades has gotten much more stable
1044 # in the PM (and the readline ebuild itself preserves the old
1045 # libs during upgrades), linking against the system copy should
1046 # be safe.
1047 # Exact cached version here doesn't really matter as long as it
1048 # is at least what's in the DEPEND up above.
1049 export ac_cv_rl_version=6.2
1050
1051 # Force linking with system curses ... the bundled termcap lib
1052 # sucks bad compared to ncurses. For the most part, ncurses
1053 # is here because readline needs it. But bash itself calls
1054 # ncurses in one or two small places :(.
1055
1056 use plugins && append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
1057 tc-export AR #444070
1058 econf \
1059 --with-installed-readline=. \
1060 --with-curses \
1061 $(use_with afs) \
1062 $(use_enable net net-redirections) \
1063 --disable-profiling \
1064 $(use_enable mem-scramble) \
1065 $(use_with mem-scramble bash-malloc) \
1066 $(use_enable readline) \
1067 $(use_enable readline history) \
1068 $(use_enable readline bang-history) \
1069 "${myconf[@]}"
1070 }
1071
1072 src_compile() {
1073 emake
1074
1075 if use plugins ; then
1076 emake -C examples/loadables all others
1077 fi
1078 }
1079
1080 src_install() {
1081 emake install DESTDIR="${D}"
1082
1083 dodir /bin
1084 mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
1085 dosym bash /bin/rbash
1086
1087 insinto /etc/bash
1088 doins "${FILESDIR}"/{bashrc,bash_logout}
1089 insinto /etc/skel
1090 for f in bash{_logout,_profile,rc} ; do
1091 newins "${FILESDIR}"/dot-${f} .${f}
1092 done
1093
1094 local sed_args=(
1095 -e "s:#${USERLAND}#@::"
1096 -e '/#@/d'
1097 )
1098 if ! use readline ; then
1099 sed_args+=( #432338
1100 -e '/^shopt -s histappend/s:^:#:'
1101 -e 's:use_color=true:use_color=false:'
1102 )
1103 fi
1104 sed -i \
1105 "${sed_args[@]}" \
1106 "${ED}"/etc/skel/.bashrc \
1107 "${ED}"/etc/bash/bashrc || die
1108
1109 if use plugins ; then
1110 exeinto /usr/$(get_libdir)/bash
1111 doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
1112 insinto /usr/include/bash-plugins
1113 doins *.h builtins/*.h examples/loadables/*.h include/*.h \
1114 lib/{glob/glob.h,tilde/tilde.h}
1115 fi
1116
1117 if use examples ; then
1118 for d in examples/{functions,misc,scripts,scripts.noah,scripts.v2} ; do
1119 exeinto /usr/share/doc/${PF}/${d}
1120 insinto /usr/share/doc/${PF}/${d}
1121 for f in ${d}/* ; do
1122 if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
1123 doexe ${f}
1124 else
1125 doins ${f}
1126 fi
1127 done
1128 done
1129 fi
1130
1131 doman doc/*.1
1132 dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
1133 dosym bash.info /usr/share/info/bashref.info
1134 }
1135
1136 pkg_preinst() {
1137 if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
1138 mkdir -p "${EROOT}"/etc/bash
1139 mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
1140 fi
1141
1142 if [[ -L ${EROOT}/bin/sh ]]; then
1143 # rewrite the symlink to ensure that its mtime changes. having /bin/sh
1144 # missing even temporarily causes a fatal error with paludis.
1145 local target=$(readlink "${EROOT}"/bin/sh)
1146 local tmp=$(emktemp "${EROOT}"/bin)
1147 ln -sf "${target}" "${tmp}"
1148 mv -f "${tmp}" "${EROOT}"/bin/sh
1149 fi
1150 }
1151
1152 pkg_postinst() {
1153 # If /bin/sh does not exist, provide it
1154 if [[ ! -e ${EROOT}/bin/sh ]]; then
1155 ln -sf bash "${EROOT}"/bin/sh
1156 fi
1157 }