1 DESCRIPTION = "Ncurses library"
2 HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
5 DEPENDS = "ncurses-native"
6 RSUGGESTS_${PN} = "ncurses-terminfo"
12 EXTRA_OECONF = "--with-shared \
20 --without-cxx-binding \
21 --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \
24 export BUILD_CCFLAGS = "-I${S}/ncurses -I${S}/include ${BUILD_CFLAGS}"
25 export BUILD_LDFLAGS = ""
26 export EXTRA_OEMAKE = '"BUILD_LDFLAGS=" "BUILD_CCFLAGS=${BUILD_CCFLAGS}"'
30 ln -sf curses.h ${STAGING_INCDIR}/ncurses.h
31 ln -sf libncurses.so ${STAGING_LIBDIR}/libtermcap.so
32 ln -sf libncurses.a ${STAGING_LIBDIR}/libtermcap.a
35 # This is necessary so that the "tic" command executed during the install can
36 # link with the correct libary in staging.
37 export LD_LIBRARY_PATH = "${STAGING_LIBDIR_NATIVE}"
42 # our ncurses has termcap support
43 ln -sf libncurses.so ${D}${libdir}/libtermcap.so
44 ln -sf libncurses.a ${D}${libdir}/libtermcap.a
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
67 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
68 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
72 pkg_postinst_ncurses-tools () {
73 update-alternatives --install ${bindir}/clear clear clear.${PN} 100
74 update-alternatives --install ${bindir}/reset reset reset.${PN} 100
78 pkg_prerm_ncurses-tools () {
79 update-alternatives --remove clear clear.${PN}
80 update-alternatives --remove reset reset.${PN}
84 PACKAGES =+ "${PN}-ncurses ${PN}-panel ${PN}-menu ${PN}-form ${PN}-terminfo ${PN}-tools"
85 FILES_${PN}-ncurses = "${libdir}/libncurses.so.*"
86 FILES_${PN}-panel = "${libdir}/libpanel.so.*"
87 FILES_${PN}-menu = "${libdir}/libmenu.so.*"
88 FILES_${PN}-form = "${libdir}/libform.so.*"
89 FILES_${PN}-terminfo = "\
93 FILES_${PN}-tools = "\
100 ${bindir}/clear.${PN} \
101 ${bindir}/reset.${PN} \
107 ${sysconfdir}/terminfo \