summaryrefslogtreecommitdiff
path: root/yocto-poky/meta/recipes-extended/bash/bash.inc
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2015-09-15 22:41:29 +0300
committerPatrick Williams <patrick@stwcx.xyz>2015-09-15 22:41:29 +0300
commit21f9b84b4b729fbd7acbd465e7a3f726e4d20f91 (patch)
treeeb2d091d427ca0813b445509d59cc8e27e8ad25f /yocto-poky/meta/recipes-extended/bash/bash.inc
parent101cef31e2bf54c678501155cd2106251acbd076 (diff)
parentc124f4f2e04dca16a428a76c89677328bc7bf908 (diff)
downloadopenbmc-21f9b84b4b729fbd7acbd465e7a3f726e4d20f91.tar.xz
Merge commit 'c124f4f2e04dca16a428a76c89677328bc7bf908' as 'yocto-poky'
Diffstat (limited to 'yocto-poky/meta/recipes-extended/bash/bash.inc')
-rw-r--r--yocto-poky/meta/recipes-extended/bash/bash.inc60
1 files changed, 60 insertions, 0 deletions
diff --git a/yocto-poky/meta/recipes-extended/bash/bash.inc b/yocto-poky/meta/recipes-extended/bash/bash.inc
new file mode 100644
index 000000000..c06f157b8
--- /dev/null
+++ b/yocto-poky/meta/recipes-extended/bash/bash.inc
@@ -0,0 +1,60 @@
+SUMMARY = "An sh-compatible command language interpreter"
+HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
+SECTION = "base/shell"
+
+DEPENDS = "ncurses bison-native"
+
+inherit autotools gettext texinfo update-alternatives ptest
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+EXTRA_OECONF = "--enable-job-control"
+
+# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
+# startup files, even if they are not interactive.
+# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
+CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
+
+ALTERNATIVE_${PN} = "sh"
+ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
+ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
+ALTERNATIVE_PRIORITY = "100"
+
+RDEPENDS_${PN} += "base-files"
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-ptest += "make"
+
+do_configure_prepend () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+}
+
+do_compile_ptest () {
+ oe_runmake buildtest
+}
+
+do_install_append () {
+ # Move /usr/bin/bash to /bin/bash, if need
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ mkdir -p ${D}${base_bindir}
+ mv ${D}${bindir}/bash ${D}${base_bindir}
+ fi
+}
+do_install_append_class-target () {
+ # Clean host path in bashbug
+ sed -i -e "s,${STAGING_DIR_TARGET},,g" ${D}${bindir}/bashbug
+}
+
+do_install_ptest () {
+ make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
+ cp ${B}/Makefile ${D}${PTEST_PATH}
+ sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
+}
+
+pkg_postinst_${PN} () {
+ grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+ printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}