diff options
Diffstat (limited to 'meta/recipes-extended/bash/bash.inc')
-rw-r--r-- | meta/recipes-extended/bash/bash.inc | 58 |
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 @@ | |||
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" | ||
6 | |||
7 | inherit autotools-brokensep gettext texinfo update-alternatives ptest | ||
8 | |||
9 | PARALLEL_MAKE = "" | ||
10 | |||
11 | EXTRA_OECONF = "--enable-job-control" | ||
12 | |||
13 | ALTERNATIVE_${PN} = "sh" | ||
14 | ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh" | ||
15 | ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash" | ||
16 | ALTERNATIVE_PRIORITY = "100" | ||
17 | |||
18 | export AUTOHEADER = "true" | ||
19 | |||
20 | RDEPENDS_${PN} += "base-files" | ||
21 | RDEPENDS_${PN}_class-nativesdk = "" | ||
22 | RDEPENDS_${PN}-ptest += "make" | ||
23 | |||
24 | do_configure_prepend () { | ||
25 | if [ ! -e ${S}/acinclude.m4 ]; then | ||
26 | cat ${S}/aclocal.m4 > ${S}/acinclude.m4 | ||
27 | fi | ||
28 | } | ||
29 | |||
30 | do_compile_ptest () { | ||
31 | oe_runmake buildtest | ||
32 | } | ||
33 | |||
34 | do_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 | } | ||
41 | do_install_append_class-target () { | ||
42 | # Clean host path in bashbug | ||
43 | sed -i -e "s,${STAGING_DIR_TARGET},,g" ${D}${bindir}/bashbug | ||
44 | } | ||
45 | |||
46 | do_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 | |||
52 | pkg_postinst_${PN} () { | ||
53 | grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells | ||
54 | } | ||
55 | |||
56 | pkg_postrm_${PN} () { | ||
57 | printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells | ||
58 | } | ||