2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@GNU
/ncurses
17 PKG_MD5SUM
:=cce05daf61a64501ef6cd8da1f727ec6
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/libncurses
27 TITLE
:=Terminal handling library
28 URL
:=http
://www.gnu.org
/software
/ncurses
/
33 define Package
/terminfo
36 TITLE
:=Terminal Info Database
(ncurses
)
37 URL
:=http
://www.gnu.org
/software
/ncurses
/
41 define Package
/libncursesw
44 TITLE
:=Terminal handling library
(Unicode
)
45 URL
:=http
://www.gnu.org
/software
/ncurses
/
50 TARGET_CFLAGS
+= $(FPIC
)
59 --without-cxx-binding \
64 --disable-home-terminfo \
67 --with-terminfo-dirs
=/usr
/share
/terminfo \
68 --with-default-terminfo-dir
=/usr
/share
/terminfo
70 ifeq ($(HOST_OS
),FreeBSD
)
72 --with-terminfo
=/usr
/share
/terminfo.db
75 ifeq ($(BUILD_VARIANT
),libncursesw
)
78 --with-build-cppflags
=-D_GNU_SOURCE
82 BUILD_CC
="$(HOSTCC)" \
87 define Build
/Install
/Default
89 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
90 $(MAKE_INSTALL_FLAGS
) \
91 $(1) install.libs
install.data
;
94 define Package
/terminfo
/install
96 ifneq ($(HOST_OS
),FreeBSD
)
97 $(INSTALL_DIR
) $(1)/usr
/share
/terminfo
98 (cd
$(PKG_INSTALL_DIR
)/usr
/share
/terminfo
; \
100 [ -d
"$$$$dir" ] || continue
; \
101 mv
$$$$dir $$$$(echo
-ne
"\x$$$$dir"); \
104 for file in a
/ansi d
/dumb l
/linux r
/rxvt r
/rxvt-unicode s
/screen v
/vt100 v
/vt102 x
/xterm x
/xterm-color
; do \
105 $(INSTALL_DIR
) $(1)/usr
/share
/terminfo
/`dirname $$$$file`; \
106 $(CP
) $(PKG_INSTALL_DIR
)/usr
/share
/terminfo
/$$$$file \
107 $(1)/usr
/share
/terminfo
/$$$$file; \
112 define Package
/libncurses
/install
113 $(INSTALL_DIR
) $(1)/usr
/lib
114 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{curses
,ncurses
,panel
,menu
,form
}.so
* $(1)/usr
/lib
/
117 define Package
/libncursesw
/install
118 $(INSTALL_DIR
) $(1)/usr
/lib
119 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{ncurses
,panel
,menu
,form
}w.so
* $(1)/usr
/lib
/
122 ifeq ($(BUILD_VARIANT
),libncursesw
)
123 define Build
/InstallDev
124 $(INSTALL_DIR
) $(1)/usr
/include/ncursesw
/
125 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/ncursesw
/
127 $(INSTALL_DIR
) $(1)/usr
/lib
128 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{ncurses
,panel
,menu
,form
}w.
{a
,so
*} $(1)/usr
/lib
/
130 $(INSTALL_DIR
) $(1)/usr
/bin
$(2)/bin
131 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ncursesw5-config
$(2)/bin
/
132 $(SED
) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
133 $(2)/bin
/ncursesw5-config
134 ln
-sf
$(STAGING_DIR
)/host
/bin
/ncursesw5-config
$(1)/usr
/bin
/ncursesw5-config
137 define Build
/InstallDev
138 $(INSTALL_DIR
) $(1)/usr
/include
139 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
141 $(INSTALL_DIR
) $(1)/usr
/lib
142 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/lib
{curses
,ncurses
,panel
,menu
,form
}.
{a
,so
*} $(1)/usr
/lib
/
144 $(INSTALL_DIR
) $(1)/usr
/bin
$(2)/bin
145 $(CP
) $(PKG_INSTALL_DIR
)/usr
/bin
/ncurses5-config
$(2)/bin
/
146 $(SED
) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
147 $(2)/bin
/ncurses5-config
148 ln
-sf
$(STAGING_DIR
)/host
/bin
/ncurses5-config
$(1)/usr
/bin
/ncurses5-config
152 $(eval
$(call BuildPackage
,terminfo
))
153 $(eval
$(call BuildPackage
,libncurses
))
154 $(eval
$(call BuildPackage
,libncursesw
))