summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/bash/bash.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/bash/bash.inc')
-rw-r--r--meta/recipes-extended/bash/bash.inc58
1 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
new file mode 100644
index 0000000000..d35d25cc92
--- /dev/null
+++ b/meta/recipes-extended/bash/bash.inc
@@ -0,0 +1,58 @@
1SUMMARY = "An sh-compatible command language interpreter"
2HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
3SECTION = "base/shell"
4
5DEPENDS = "ncurses bison-native"
6
7inherit autotools-brokensep gettext texinfo update-alternatives ptest
8
9PARALLEL_MAKE = ""
10
11EXTRA_OECONF = "--enable-job-control"
12
13ALTERNATIVE_${PN} = "sh"
14ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
15ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
16ALTERNATIVE_PRIORITY = "100"
17
18export AUTOHEADER = "true"
19
20RDEPENDS_${PN} += "base-files"
21RDEPENDS_${PN}_class-nativesdk = ""
22RDEPENDS_${PN}-ptest += "make"
23
24do_configure_prepend () {
25 if [ ! -e ${S}/acinclude.m4 ]; then
26 cat ${S}/aclocal.m4 > ${S}/acinclude.m4
27 fi
28}
29
30do_compile_ptest () {
31 oe_runmake buildtest
32}
33
34do_install_append () {
35 # Move /usr/bin/bash to /bin/bash, if need
36 if [ "${base_bindir}" != "${bindir}" ]; then
37 mkdir -p ${D}${base_bindir}
38 mv ${D}${bindir}/bash ${D}${base_bindir}
39 fi
40}
41do_install_append_class-target () {
42 # Clean host path in bashbug
43 sed -i -e "s,${STAGING_DIR_TARGET},,g" ${D}${bindir}/bashbug
44}
45
46do_install_ptest () {
47 make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
48 cp ${B}/Makefile ${D}${PTEST_PATH}
49 sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
50}
51
52pkg_postinst_${PN} () {
53 grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
54}
55
56pkg_postrm_${PN} () {
57 printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
58}