diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-02 12:24:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-02 12:30:01 +0000 |
commit | 8ba70a1c28a4e0ee73db5308b38abc923b0be44d (patch) | |
tree | 0ed9bff8e4bd70766c81dbb559d32781bdd93ce8 /recipes-extended/bash/bash.inc | |
download | meta-gplv2-8ba70a1c28a4e0ee73db5308b38abc923b0be44d.tar.gz |
Create meta-gplv2 from files from OE-Core
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'recipes-extended/bash/bash.inc')
-rw-r--r-- | recipes-extended/bash/bash.inc | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/recipes-extended/bash/bash.inc b/recipes-extended/bash/bash.inc new file mode 100644 index 0000000..a05b987 --- /dev/null +++ b/recipes-extended/bash/bash.inc | |||
@@ -0,0 +1,67 @@ | |||
1 | SUMMARY = "An sh-compatible command language interpreter" | ||
2 | HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html" | ||
3 | SECTION = "base/shell" | ||
4 | |||
5 | DEPENDS = "ncurses bison-native virtual/libiconv" | ||
6 | |||
7 | inherit autotools gettext texinfo update-alternatives ptest | ||
8 | |||
9 | EXTRA_AUTORECONF += "--exclude=autoheader" | ||
10 | EXTRA_OECONF = "--enable-job-control --without-bash-malloc" | ||
11 | |||
12 | # If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the | ||
13 | # startup files, even if they are not interactive. | ||
14 | # This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137. | ||
15 | CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS" | ||
16 | |||
17 | ALTERNATIVE_${PN} = "bash sh" | ||
18 | ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash" | ||
19 | ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash" | ||
20 | ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh" | ||
21 | ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}" | ||
22 | ALTERNATIVE_PRIORITY = "100" | ||
23 | |||
24 | RDEPENDS_${PN} += "base-files" | ||
25 | RDEPENDS_${PN}_class-nativesdk = "" | ||
26 | RDEPENDS_${PN}-ptest += "make" | ||
27 | |||
28 | USERADD_PACKAGES = "${PN}-ptest" | ||
29 | USERADD_PARAM_${PN}-ptest = "--create-home --user-group test" | ||
30 | |||
31 | do_configure_prepend () { | ||
32 | if [ ! -e ${S}/acinclude.m4 ]; then | ||
33 | cat ${S}/aclocal.m4 > ${S}/acinclude.m4 | ||
34 | fi | ||
35 | } | ||
36 | |||
37 | do_compile_ptest () { | ||
38 | oe_runmake buildtest | ||
39 | } | ||
40 | |||
41 | do_install_append () { | ||
42 | # Move /usr/bin/bash to /bin/bash, if need | ||
43 | if [ "${base_bindir}" != "${bindir}" ]; then | ||
44 | mkdir -p ${D}${base_bindir} | ||
45 | mv ${D}${bindir}/bash ${D}${base_bindir} | ||
46 | fi | ||
47 | } | ||
48 | do_install_append_class-target () { | ||
49 | # Clean host path in bashbug | ||
50 | sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ | ||
51 | -e "s,-I${WORKDIR}/\S* ,,g" ${D}${bindir}/bashbug | ||
52 | } | ||
53 | |||
54 | do_install_ptest () { | ||
55 | make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test | ||
56 | cp ${B}/Makefile ${D}${PTEST_PATH} | ||
57 | sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \ | ||
58 | -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" ${D}${PTEST_PATH}/Makefile | ||
59 | } | ||
60 | |||
61 | pkg_postinst_${PN} () { | ||
62 | grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells | ||
63 | } | ||
64 | |||
65 | pkg_postrm_${PN} () { | ||
66 | printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells | ||
67 | } | ||