1 DESCRIPTION = "Ncurses library"
2 HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
5 DEPENDS = "ncurses-native"
11 FILESPATH = "${FILE_DIRNAME}/local:${FILE_DIRNAME}/ncurses-${PV}-${PR}:${FILE_DIRNAME}/ncurses-${PV}:${FILE_DIRNAME}/ncurses:${FILE_DIRNAME}"
24 --without-cxx-binding \
25 --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \
29 export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}"
30 export BUILD_LDFLAGS = ""
31 export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"'
33 # This is necessary so that the "tic" command executed during the install can
34 # link with the correct libary in staging.
35 export LD_LIBRARY_PATH = "${STAGING_LIBDIR_NATIVE}"
40 # our ncurses has termcap support
41 ln -sf libncurses.so ${D}${libdir}/libtermcap.so
42 ln -sf libncurses.a ${D}${libdir}/libtermcap.a
43 ln -sf curses.h ${D}${includedir}/ncurses.h
46 # include some basic terminfo files
47 # stolen ;) from gentoo and modified a bit
48 for x in ansi console dumb linux rxvt screen sun vt{52,100,102,200,220} xterm-color xterm-xfree86
50 local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
51 local basedir="$(basename $(dirname "${termfile}"))"
53 if [ -n "${termfile}" ]
55 install -d ${D}${sysconfdir}/terminfo/${basedir}
56 mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
57 ln -s /etc/terminfo/${basedir}/${x} \
58 ${D}${datadir}/terminfo/${basedir}/${x}
61 # i think we can use xterm-color as default xterm
62 if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
64 ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
66 ln -sf rxvt ${D}${sysconfdir}/terminfo/r/rxvt-unicode
68 if [ "${PN}" = "ncurses" ]; then
69 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
70 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
75 pkg_postinst_ncurses-tools () {
76 if [ "${PN}" = "ncurses" ]; then
77 update-alternatives --install ${bindir}/clear clear clear.${PN} 100
78 update-alternatives --install ${bindir}/reset reset reset.${PN} 100
83 pkg_prerm_ncurses-tools () {
84 if [ "${PN}" = "ncurses" ]; then
85 update-alternatives --remove clear clear.${PN}
86 update-alternatives --remove reset reset.${PN}
90 PACKAGES =+ "${PN}-tools ${PN}-terminfo"
92 # clear and reset are already in busybox
98 ${sysconfdir}/terminfo \
100 FILES_${PN}-tools = "\
103 ${bindir}/infotocap \
104 ${bindir}/captoinfo \
106 ${bindir}/clear.${PN} \
107 ${bindir}/reset.${PN} \
110 FILES_${PN}-terminfo = "\
111 ${datadir}/terminfo \
114 RSUGGESTS_${PN} = "ncurses-terminfo"
115 RPROVIDES_${PN} = "libncurses5"
116 RCONFLICTS_${PN} = "libncurses5"
117 RREPLACES_${PN} = "libncurses5"