increase dvbapp PR.
[vuplus_openembedded] / recipes / ncurses / ncurses.inc
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
7 inherit autotools
8
9 PARALLEL_MAKE=""
10
11 FILESPATH = "${FILE_DIRNAME}/local:${FILE_DIRNAME}/ncurses-${PV}-${PR}:${FILE_DIRNAME}/ncurses-${PV}:${FILE_DIRNAME}/ncurses:${FILE_DIRNAME}"
12
13 EXTRA_OECONF = "\
14   --enable-static \
15   --with-shared \
16   --with-libtool \
17   --without-profile \
18   --without-debug \
19   --disable-rpath \
20   --enable-echo \
21   --enable-const \
22   --without-ada \
23   --enable-termcap \
24   --without-cxx-binding \
25   --with-terminfo-dirs=${sysconfdir}/terminfo:${datadir}/terminfo \
26   --enable-overwrite \
27 "
28
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}"'
32
33 do_stage() {
34         autotools_stage_all
35         ln -sf curses.h ${STAGING_INCDIR}/ncurses.h
36         ln -sf libncurses.so ${STAGING_LIBDIR}/libtermcap.so
37         ln -sf libncurses.a ${STAGING_LIBDIR}/libtermcap.a
38 }
39
40 # This is necessary so that the "tic" command executed during the install can
41 # link with the correct libary in staging.
42 export LD_LIBRARY_PATH = "${STAGING_LIBDIR_NATIVE}"
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         ln -sf rxvt ${D}${sysconfdir}/terminfo/r/rxvt-unicode
72
73         if [ "${PN}" = "ncurses" ]; then
74                 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
75                 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
76         fi
77 }
78                 
79                 
80 pkg_postinst_ncurses-tools () {
81         if [ "${PN}" = "ncurses" ]; then
82                 update-alternatives --install ${bindir}/clear clear clear.${PN} 100
83                 update-alternatives --install ${bindir}/reset reset reset.${PN} 100
84         fi
85 }
86                                 
87                         
88 pkg_prerm_ncurses-tools () {
89         if [ "${PN}" = "ncurses" ]; then
90                 update-alternatives --remove clear clear.${PN}
91                 update-alternatives --remove reset reset.${PN}
92         fi
93 }
94
95 PACKAGES =+ "${PN}-tools ${PN}-terminfo"
96
97 # clear and reset are already in busybox
98 FILES_${PN} = "\
99   ${bindir}/tput \
100   ${bindir}/tset \
101   ${libdir}/lib*.so.* \
102   ${datadir}/tabset \
103   ${sysconfdir}/terminfo \
104 "
105 FILES_${PN}-tools = "\
106   ${bindir}/tic \
107   ${bindir}/toe \
108   ${bindir}/infotocap \
109   ${bindir}/captoinfo \
110   ${bindir}/infocmp \
111   ${bindir}/clear.${PN} \
112   ${bindir}/reset.${PN} \
113   ${bindir}/tack \
114 "
115 FILES_${PN}-terminfo = "\
116   ${datadir}/terminfo \
117 "
118   
119 RSUGGESTS_${PN} = "ncurses-terminfo"
120 RPROVIDES_${PN} = "libncurses5"
121 RCONFLICTS_${PN} = "libncurses5"
122 RREPLACES_${PN} = "libncurses5"
123