7 |
7 |
|
8 |
8 |
# Uncomment if we have a patchset
|
9 |
9 |
GENTOO_PATCH_DEV="sam"
|
10 |
|
GENTOO_PATCH_VER="${PV}-r2"
|
|
10 |
GENTOO_PATCH_VER="${PV}"
|
11 |
11 |
|
12 |
12 |
# Official patchlevel
|
13 |
|
# See ftp://ftp.cwru.edu/pub/bash/bash-4.4-patches/
|
|
13 |
# See ftp://ftp.cwru.edu/pub/bash/bash-5.0-patches/
|
14 |
14 |
PLEVEL="${PV##*_p}"
|
15 |
15 |
MY_PV="${PV/_p*}"
|
16 |
16 |
MY_PV="${MY_PV/_/-}"
|
... | ... | |
38 |
38 |
}
|
39 |
39 |
|
40 |
40 |
# The version of readline this bash normally ships with.
|
41 |
|
READLINE_VER="7.0"
|
|
41 |
READLINE_VER="8.0"
|
42 |
42 |
|
43 |
43 |
DESCRIPTION="The standard GNU Bourne again shell"
|
44 |
44 |
HOMEPAGE="https://tiswww.case.edu/php/chet/bash/bashtop.html"
|
... | ... | |
53 |
53 |
fi
|
54 |
54 |
|
55 |
55 |
LICENSE="GPL-3"
|
56 |
|
SLOT="${MY_PV}"
|
|
56 |
SLOT="0"
|
57 |
57 |
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
|
58 |
58 |
IUSE="afs bashlogger examples mem-scramble +net nls plugins +readline"
|
59 |
59 |
|
... | ... | |
66 |
66 |
${DEPEND}
|
67 |
67 |
"
|
68 |
68 |
# We only need bison (yacc) when the .y files get patched (bash42-005)
|
69 |
|
#BDEPEND="sys-devel/bison"
|
|
69 |
BDEPEND="sys-devel/bison"
|
70 |
70 |
|
71 |
71 |
S="${WORKDIR}/${MY_P}"
|
72 |
72 |
|
|
73 |
PATCHES=(
|
|
74 |
# Patches from Chet sent to bashbug ml
|
|
75 |
"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-5.0-history-append.patch
|
|
76 |
"${WORKDIR}"/${PN}-${GENTOO_PATCH_VER}-patches/${PN}-5.0-syslog-history-extern.patch
|
|
77 |
)
|
|
78 |
|
73 |
79 |
pkg_setup() {
|
74 |
80 |
# bug #7332
|
75 |
81 |
if is-flag -malign-double ; then
|
... | ... | |
96 |
102 |
# Include official patches
|
97 |
103 |
[[ ${PLEVEL} -gt 0 ]] && eapply -p0 $(patches -s)
|
98 |
104 |
|
99 |
|
eapply "${WORKDIR}"/${P}-r2-patches/${PN}-4.4-jobs_overflow.patch # bug #644720
|
100 |
|
eapply "${WORKDIR}"/${P}-r2-patches/${PN}-4.4-set-SHOBJ_STATUS.patch # bug #644720
|
101 |
|
|
102 |
105 |
# Clean out local libs so we know we use system ones w/releases.
|
103 |
106 |
if is_release ; then
|
104 |
107 |
rm -rf lib/{readline,termcap}/* || die
|
... | ... | |
113 |
116 |
sed -i -r '/^(HS|RL)USER/s:=.*:=:' doc/Makefile.in || die
|
114 |
117 |
touch -r . doc/* || die
|
115 |
118 |
|
|
119 |
eapply -p0 "${PATCHES[@]}"
|
116 |
120 |
eapply_user
|
117 |
121 |
}
|
118 |
122 |
|
... | ... | |
201 |
205 |
}
|
202 |
206 |
|
203 |
207 |
src_install() {
|
204 |
|
into /
|
205 |
|
newbin bash bash-${SLOT}
|
|
208 |
local d f
|
|
209 |
|
|
210 |
default
|
|
211 |
|
|
212 |
dodir /bin
|
|
213 |
mv "${ED}"/usr/bin/bash "${ED}"/bin/ || die
|
|
214 |
dosym bash /bin/rbash
|
|
215 |
|
|
216 |
insinto /etc/bash
|
|
217 |
doins "${FILESDIR}"/bash_logout
|
|
218 |
doins "$(prefixify_ro "${FILESDIR}"/bashrc)"
|
|
219 |
|
|
220 |
keepdir /etc/bash/bashrc.d
|
206 |
221 |
|
207 |
|
newman doc/bash.1 bash-${SLOT}.1
|
208 |
|
newman doc/builtins.1 builtins-${SLOT}.1
|
|
222 |
insinto /etc/skel
|
|
223 |
for f in bash{_logout,_profile,rc} ; do
|
|
224 |
newins "${FILESDIR}"/dot-${f} .${f}
|
|
225 |
done
|
209 |
226 |
|
210 |
|
insinto /usr/share/info
|
211 |
|
newins doc/bashref.info bash-${SLOT}.info
|
212 |
|
dosym bash-${SLOT}.info /usr/share/info/bashref-${SLOT}.info
|
|
227 |
local sed_args=(
|
|
228 |
-e 's:#GNU#@::'
|
|
229 |
-e '/#@/d'
|
|
230 |
)
|
|
231 |
|
|
232 |
if ! use readline ; then
|
|
233 |
# bug #432338
|
|
234 |
sed_args+=(
|
|
235 |
-e '/^shopt -s histappend/s:^:#:'
|
|
236 |
-e 's:use_color=true:use_color=false:'
|
|
237 |
)
|
|
238 |
fi
|
|
239 |
|
|
240 |
sed -i \
|
|
241 |
"${sed_args[@]}" \
|
|
242 |
"${ED}"/etc/skel/.bashrc \
|
|
243 |
"${ED}"/etc/bash/bashrc || die
|
|
244 |
|
|
245 |
if use plugins ; then
|
|
246 |
exeinto /usr/$(get_libdir)/bash
|
|
247 |
doexe $(echo examples/loadables/*.o | sed 's:\.o::g')
|
213 |
248 |
|
214 |
|
dodoc README NEWS AUTHORS CHANGES COMPAT Y2K doc/FAQ doc/INTRO
|
|
249 |
insinto /usr/include/bash-plugins
|
|
250 |
doins *.h builtins/*.h include/*.h lib/{glob/glob.h,tilde/tilde.h}
|
|
251 |
fi
|
|
252 |
|
|
253 |
if use examples ; then
|
|
254 |
for d in examples/{functions,misc,scripts,startup-files} ; do
|
|
255 |
exeinto /usr/share/doc/${PF}/${d}
|
|
256 |
docinto ${d}
|
|
257 |
for f in ${d}/* ; do
|
|
258 |
if [[ ${f##*/} != PERMISSION ]] && [[ ${f##*/} != *README ]] ; then
|
|
259 |
doexe ${f}
|
|
260 |
else
|
|
261 |
dodoc ${f}
|
|
262 |
fi
|
|
263 |
done
|
|
264 |
done
|
|
265 |
fi
|
|
266 |
|
|
267 |
doman doc/*.1
|
|
268 |
newdoc CWRU/changelog ChangeLog
|
|
269 |
dosym bash.info /usr/share/info/bashref.info
|
|
270 |
}
|
|
271 |
|
|
272 |
pkg_preinst() {
|
|
273 |
if [[ -e ${EROOT}/etc/bashrc ]] && [[ ! -d ${EROOT}/etc/bash ]] ; then
|
|
274 |
mkdir -p "${EROOT}"/etc/bash
|
|
275 |
mv -f "${EROOT}"/etc/bashrc "${EROOT}"/etc/bash/
|
|
276 |
fi
|
|
277 |
}
|
|
278 |
|
|
279 |
pkg_postinst() {
|
|
280 |
# If /bin/sh does not exist, provide it
|
|
281 |
if [[ ! -e ${EROOT}/bin/sh ]] ; then
|
|
282 |
ln -sf bash "${EROOT}"/bin/sh
|
|
283 |
fi
|
215 |
284 |
}
|