7 |
7 |
|
8 |
8 |
# Uncomment if we have a patchset
|
9 |
9 |
GENTOO_PATCH_DEV="sam"
|
10 |
|
GENTOO_PATCH_VER="${PV}"
|
|
10 |
GENTOO_PATCH_VER="${PV}-r2"
|
11 |
11 |
|
12 |
12 |
# Official patchlevel
|
13 |
|
# See ftp://ftp.cwru.edu/pub/bash/bash-4.2-patches/
|
|
13 |
# See ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
|
14 |
14 |
PLEVEL="${PV##*_p}"
|
15 |
15 |
MY_PV="${PV/_p*}"
|
16 |
16 |
MY_PV="${MY_PV/_/-}"
|
... | ... | |
28 |
28 |
fi
|
29 |
29 |
}
|
30 |
30 |
|
|
31 |
# The version of readline this bash normally ships with.
|
|
32 |
READLINE_VER="6.3"
|
|
33 |
|
31 |
34 |
DESCRIPTION="The standard GNU Bourne again shell"
|
32 |
35 |
HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html"
|
33 |
36 |
SRC_URI="mirror://gnu/bash/${MY_P}.tar.gz $(patches)"
|
... | ... | |
41 |
44 |
LICENSE="GPL-3"
|
42 |
45 |
SLOT="${MY_PV}"
|
43 |
46 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~m68k ~mips ppc ppc64 ~s390 sparc x86"
|
44 |
|
IUSE="afs mem-scramble +net nls +readline static"
|
|
47 |
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
|
45 |
48 |
|
46 |
|
LIB_DEPEND=">=sys-libs/ncurses-5.2-r2[static-libs(+)]
|
47 |
|
nls? ( virtual/libintl )
|
48 |
|
readline? ( >=sys-libs/readline-6.2[static-libs(+)] )"
|
49 |
|
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
|
50 |
|
DEPEND="${RDEPEND}
|
51 |
|
static? ( ${LIB_DEPEND} )"
|
|
49 |
DEPEND=">=sys-libs/ncurses-5.2-r2:0=
|
|
50 |
readline? ( >=sys-libs/readline-${READLINE_VER}:0= )
|
|
51 |
nls? ( virtual/libintl )"
|
|
52 |
RDEPEND="${DEPEND}
|
|
53 |
!<sys-apps/portage-2.1.6.7_p1"
|
52 |
54 |
# We only need bison (yacc) when the .y files get patched (bash42-005)
|
53 |
55 |
BDEPEND="sys-devel/bison"
|
54 |
56 |
|
55 |
57 |
PATCHES=(
|
56 |
|
"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-execute-job-control.patch # bug #383237
|
57 |
|
"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-parallel-build.patch
|
58 |
|
"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-no-readline.patch
|
59 |
|
"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-read-retry.patch # bug #447810
|
60 |
|
"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-4.2-speed-up-read-N.patch
|
|
58 |
"${WORKDIR}"/${P}-r2-patches/${PN}-4.3-mapfile-improper-array-name-validation.patch
|
|
59 |
"${WORKDIR}"/${P}-r2-patches/${PN}-4.3-arrayfunc.patch
|
|
60 |
"${WORKDIR}"/${P}-r2-patches/${PN}-4.3-protos.patch
|
|
61 |
"${WORKDIR}"/${P}-r2-patches/${PN}-4.4-popd-offset-overflow.patch # bug #600174
|
61 |
62 |
)
|
62 |
63 |
|
63 |
64 |
pkg_setup() {
|
... | ... | |
67 |
68 |
eerror "as it breaks LFS (struct stat64) on x86."
|
68 |
69 |
die "remove -malign-double from your CFLAGS mr ricer"
|
69 |
70 |
fi
|
|
71 |
|
|
72 |
if use bashlogger ; then
|
|
73 |
ewarn "The logging patch should ONLY be used in restricted (i.e. honeypot) envs."
|
|
74 |
ewarn "This will log ALL output you enter into the shell, you have been warned."
|
|
75 |
fi
|
70 |
76 |
}
|
71 |
77 |
|
72 |
78 |
src_unpack() {
|
... | ... | |
81 |
87 |
# Include official patches
|
82 |
88 |
[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
|
83 |
89 |
|
84 |
|
# Clean out local libs so we know we use system ones
|
85 |
|
rm -rf lib/{readline,termcap}/* || die
|
86 |
|
touch lib/{readline,termcap}/Makefile.in || die # for config.status
|
87 |
|
sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
|
|
90 |
# Clean out local libs so we know we use system ones w/releases.
|
|
91 |
if [[ ${PV} != *_rc* ]] ; then
|
|
92 |
rm -rf lib/{readline,termcap}/* || die
|
|
93 |
touch lib/{readline,termcap}/Makefile.in || die # for config.status
|
|
94 |
sed -ri -e 's:\$[{(](RL|HIST)_LIBSRC[)}]/[[:alpha:]_-]*\.h::g' Makefile.in || die
|
|
95 |
fi
|
88 |
96 |
|
89 |
|
# Avoid regenerating docs after patches #407985
|
|
97 |
# Avoid regenerating docs after patches, bug #407985
|
90 |
98 |
sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
|
91 |
99 |
touch -r . doc/* || die
|
92 |
100 |
|
... | ... | |
110 |
118 |
fi
|
111 |
119 |
|
112 |
120 |
local myconf=(
|
113 |
|
--with-installed-readline=.
|
|
121 |
--docdir='$(datarootdir)'/doc/${PF}
|
|
122 |
--htmldir='$(docdir)/html'
|
114 |
123 |
|
115 |
124 |
# Force linking with system curses ... the bundled termcap lib
|
116 |
125 |
# sucks bad compared to ncurses. For the most part, ncurses
|
... | ... | |
131 |
140 |
# For descriptions of these, see config-top.h
|
132 |
141 |
# bashrc/#26952 bash_logout/#90488 ssh/#24762 mktemp/#574426
|
133 |
142 |
append-cppflags \
|
134 |
|
-DDEFAULT_PATH_VALUE=\'\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\' \
|
135 |
|
-DSTANDARD_UTILS_PATH=\'\"/bin:/usr/bin:/sbin:/usr/sbin\"\' \
|
136 |
|
-DSYS_BASHRC=\'\"/etc/bash/bashrc\"\' \
|
137 |
|
-DSYS_BASH_LOGOUT=\'\"/etc/bash/bash_logout\"\' \
|
|
143 |
-DDEFAULT_PATH_VALUE=\'\""${EPREFIX}"/usr/local/sbin:"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/sbin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/bin\"\' \
|
|
144 |
-DSTANDARD_UTILS_PATH=\'\""${EPREFIX}"/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/sbin:"${EPREFIX}"/usr/sbin\"\' \
|
|
145 |
-DSYS_BASHRC=\'\""${EPREFIX}"/etc/bash/bashrc\"\' \
|
|
146 |
-DSYS_BASH_LOGOUT=\'\""${EPREFIX}"/etc/bash/bash_logout\"\' \
|
138 |
147 |
-DNON_INTERACTIVE_LOGIN_SHELLS \
|
139 |
148 |
-DSSH_SOURCE_BASHRC \
|
140 |
|
-DUSE_MKTEMP -DUSE_MKSTEMP
|
|
149 |
-DUSE_MKTEMP -DUSE_MKSTEMP \
|
|
150 |
$(use bashlogger && echo -DSYSLOG_HISTORY)
|
141 |
151 |
|
142 |
|
use static && append-ldflags -static
|
|
152 |
# Don't even think about building this statically without
|
|
153 |
# reading bug #7714 first. If you still build it statically,
|
|
154 |
# don't come crying to us with bugs ;).
|
|
155 |
#use static && export LDFLAGS="${LDFLAGS} -static"
|
143 |
156 |
use nls || myconf+=( --disable-nls )
|
144 |
157 |
|
145 |
158 |
# Historically, we always used the builtin readline, but since
|
... | ... | |
149 |
162 |
# be safe.
|
150 |
163 |
# Exact cached version here doesn't really matter as long as it
|
151 |
164 |
# is at least what's in the DEPEND up above.
|
152 |
|
export ac_cv_rl_version=6.2
|
|
165 |
export ac_cv_rl_version=${READLINE_VER}
|
|
166 |
|
|
167 |
if [[ ${PV} != *_rc* ]] ; then
|
|
168 |
# Use system readline only with released versions.
|
|
169 |
myconf+=( --with-installed-readline=. )
|
|
170 |
fi
|
|
171 |
|
|
172 |
if use plugins ; then
|
|
173 |
append-ldflags -Wl,-rpath,/usr/$(get_libdir)/bash
|
|
174 |
else
|
|
175 |
# Disable the plugins logic by hand since bash doesn't
|
|
176 |
# provide a way of doing it.
|
|
177 |
export ac_cv_func_dl{close,open,sym}=no \
|
|
178 |
ac_cv_lib_dl_dlopen=no ac_cv_header_dlfcn_h=no
|
|
179 |
|
|
180 |
sed -i \
|
|
181 |
-e '/LOCAL_LDFLAGS=/s:-rdynamic::' \
|
|
182 |
configure || die
|
|
183 |
fi
|
153 |
184 |
|
154 |
185 |
# bug #444070
|
155 |
186 |
tc-export AR
|
... | ... | |
157 |
188 |
econf "${myconf[@]}"
|
158 |
189 |
}
|
159 |
190 |
|
|
191 |
src_compile() {
|
|
192 |
emake
|
|
193 |
|
|
194 |
if use plugins ; then
|
|
195 |
emake -C examples/loadables all others
|
|
196 |
fi
|
|
197 |
}
|
|
198 |
|
160 |
199 |
src_install() {
|
161 |
200 |
into /
|
162 |
201 |
newbin bash bash-${SLOT}
|