diff options
Diffstat (limited to 'meta/packages/ncurses/ncurses.inc')
| -rw-r--r-- | meta/packages/ncurses/ncurses.inc | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/meta/packages/ncurses/ncurses.inc b/meta/packages/ncurses/ncurses.inc new file mode 100644 index 0000000000..030cd1034c --- /dev/null +++ b/meta/packages/ncurses/ncurses.inc | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | DESCRIPTION = "Ncurses library" | ||
| 2 | HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html" | ||
| 3 | LICENSE = "MIT" | ||
| 4 | SECTION = "libs" | ||
| 5 | DEPENDS = "ncurses-native" | ||
| 6 | PACKAGES_prepend = "ncurses-tools " | ||
| 7 | PACKAGES_append = " ncurses-terminfo" | ||
| 8 | FILES_ncurses_append = " ${datadir}/tabset" | ||
| 9 | RSUGGESTS_${PN} = "ncurses-terminfo" | ||
| 10 | RPROVIDES = "libncurses5" | ||
| 11 | |||
| 12 | inherit autotools | ||
| 13 | |||
| 14 | # This keeps only tput/tset in ncurses | ||
| 15 | # clear/reset are in already busybox | ||
| 16 | FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear.${PN} ${bindir}/reset.${PN} ${bindir}/tack " | ||
| 17 | FILES_ncurses-terminfo = "${datadir}/terminfo" | ||
| 18 | FILES_${PN} = "${bindir}/tput ${bindir}/tset ${libdir}/lib*.so.* usr/share/tabset etc/terminfo" | ||
| 19 | |||
| 20 | PARALLEL_MAKE="" | ||
| 21 | |||
| 22 | EXTRA_OECONF = "--with-shared \ | ||
| 23 | --without-profile \ | ||
| 24 | --without-debug \ | ||
| 25 | --disable-rpath \ | ||
| 26 | --enable-echo \ | ||
| 27 | --enable-const \ | ||
| 28 | --without-ada \ | ||
| 29 | --enable-termcap \ | ||
| 30 | --without-cxx-binding \ | ||
| 31 | --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \ | ||
| 32 | --enable-overwrite" | ||
| 33 | export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}" | ||
| 34 | export BUILD_LDFLAGS = "" | ||
| 35 | export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"' | ||
| 36 | |||
| 37 | do_stage() { | ||
| 38 | autotools_stage_all | ||
| 39 | ln -sf curses.h ${STAGING_INCDIR}/ncurses.h | ||
| 40 | ln -sf libncurses.so ${STAGING_LIBDIR}/libtermcap.so | ||
| 41 | ln -sf libncurses.a ${STAGING_LIBDIR}/libtermcap.a | ||
| 42 | } | ||
| 43 | |||
| 44 | do_install() { | ||
| 45 | autotools_do_install | ||
| 46 | |||
| 47 | # our ncurses has termcap support | ||
| 48 | ln -sf libncurses.so ${D}${libdir}/libtermcap.so | ||
| 49 | ln -sf libncurses.a ${D}${libdir}/libtermcap.a | ||
| 50 | |||
| 51 | # include some basic terminfo files | ||
| 52 | # stolen ;) from gentoo and modified a bit | ||
| 53 | for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86 | ||
| 54 | do | ||
| 55 | local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)" | ||
| 56 | local basedir="$(basename $(dirname "${termfile}"))" | ||
| 57 | |||
| 58 | if [ -n "${termfile}" ] | ||
| 59 | then | ||
| 60 | install -d ${D}${sysconfdir}/terminfo/${basedir} | ||
| 61 | mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/ | ||
| 62 | ln -s /etc/terminfo/${basedir}/${x} \ | ||
| 63 | ${D}${datadir}/terminfo/${basedir}/${x} | ||
| 64 | fi | ||
| 65 | done | ||
| 66 | # i think we can use xterm-color as default xterm | ||
| 67 | if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ] | ||
| 68 | then | ||
| 69 | ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm | ||
| 70 | fi | ||
| 71 | |||
| 72 | mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN} | ||
| 73 | mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN} | ||
| 74 | } | ||
| 75 | |||
| 76 | |||
| 77 | pkg_postinst_ncurses-tools () { | ||
| 78 | update-alternatives --install ${bindir}/clear clear clear.${PN} 100 | ||
| 79 | update-alternatives --install ${bindir}/reset reset reset.${PN} 100 | ||
| 80 | } | ||
| 81 | |||
| 82 | |||
| 83 | pkg_prerm_ncurses-tools () { | ||
| 84 | update-alternatives --remove clear clear.${PN} | ||
| 85 | update-alternatives --remove reset reset.${PN} | ||
| 86 | } | ||
