libgcrypt: restore BBCLASSEXTEND
[openembedded.git] / 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 # 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}"
36
37 do_install() {
38         autotools_do_install
39
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
44
45
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
49         do
50                 local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
51                 local basedir="$(basename $(dirname "${termfile}"))"
52
53                 if [ -n "${termfile}" ]
54                 then
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}
59                 fi
60         done
61         # i think we can use xterm-color as default xterm
62         if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
63         then
64                 ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
65         fi
66         ln -sf rxvt ${D}${sysconfdir}/terminfo/r/rxvt-unicode
67
68         if [ "${PN}" = "ncurses" ]; then
69                 mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
70                 mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
71         fi
72 }
73                 
74                 
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
79         fi
80 }
81                                 
82                         
83 pkg_prerm_ncurses-tools () {
84         if [ "${PN}" = "ncurses" ]; then
85                 update-alternatives --remove clear clear.${PN}
86                 update-alternatives --remove reset reset.${PN}
87         fi
88 }
89
90 PACKAGES =+ "${PN}-tools ${PN}-terminfo"
91
92 # clear and reset are already in busybox
93 FILES_${PN} = "\
94   ${bindir}/tput \
95   ${bindir}/tset \
96   ${libdir}/lib*.so.* \
97   ${datadir}/tabset \
98   ${sysconfdir}/terminfo \
99 "
100 FILES_${PN}-tools = "\
101   ${bindir}/tic \
102   ${bindir}/toe \
103   ${bindir}/infotocap \
104   ${bindir}/captoinfo \
105   ${bindir}/infocmp \
106   ${bindir}/clear.${PN} \
107   ${bindir}/reset.${PN} \
108   ${bindir}/tack \
109 "
110 FILES_${PN}-terminfo = "\
111   ${datadir}/terminfo \
112 "
113   
114 RSUGGESTS_${PN} = "ncurses-terminfo"
115 RPROVIDES_${PN} = "libncurses5"
116 RCONFLICTS_${PN} = "libncurses5"
117 RREPLACES_${PN} = "libncurses5"
118