e701882d3da0466bca4bf7e8e37ee67939baa769
[openwrt/staging/florian.git] / package / ncurses / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=ncurses
12 PKG_VERSION:=5.6
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@GNU/ncurses
17 PKG_MD5SUM:=b6593abe1089d6aab1551c105c9300e3
18
19 PKG_BUILD_DEPENDS:=ncurses/host
20
21 include $(INCLUDE_DIR)/host-build.mk
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libncurses
25 SECTION:=libs
26 CATEGORY:=Libraries
27 TITLE:=Terminal handling library
28 URL:=http://www.gnu.org/software/ncurses/
29 endef
30
31 define Host/Compile
32 $(MAKE) -C $(HOST_BUILD_DIR) libs
33 endef
34
35 define Host/Install
36 $(MAKE) -C $(HOST_BUILD_DIR) install.progs
37 endef
38
39 TARGET_CFLAGS += $(FPIC)
40
41 CONFIGURE_ARGS += \
42 --enable-echo \
43 --enable-const \
44 --enable-overwrite \
45 --disable-rpath \
46 --without-ada \
47 --without-cxx \
48 --without-cxx-binding \
49 --without-debug \
50 --without-profile \
51 --without-progs \
52 --with-normal \
53 --with-shared \
54 --with-terminfo-dirs=/usr/share/terminfo \
55 --with-default-terminfo-dir=/usr/share/terminfo
56
57 define Build/Compile
58 cp \
59 $(HOST_BUILD_DIR)/ncurses/make_keys \
60 $(HOST_BUILD_DIR)/ncurses/make_hash \
61 $(PKG_BUILD_DIR)/ncurses/
62 touch \
63 $(PKG_BUILD_DIR)/ncurses/make_keys \
64 $(PKG_BUILD_DIR)/ncurses/make_hash
65 $(MAKE) -C $(PKG_BUILD_DIR) \
66 $(TARGET_CONFIGURE_OPTS) \
67 BUILD_CC="$(TARGET_CC)" \
68 HOSTCC="$(HOSTCC)" \
69 HOSTCCFLAGS="" \
70 DESTDIR="$(PKG_INSTALL_DIR)" \
71 libs install.libs install.data
72 endef
73
74 define Package/libncurses/install
75 $(INSTALL_DIR) $(1)/usr/lib
76 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}*.so.* $(1)/usr/lib/
77 $(INSTALL_DIR) $(1)/usr/share/terminfo
78 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
79 for dir in ??; do \
80 [ -d "$$$$dir" ] || continue; \
81 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
82 done \
83 )
84 for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
85 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
86 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
87 $(1)/usr/share/terminfo/$$$$file; \
88 done
89 endef
90
91 define Build/InstallDev
92 mkdir -p $(1)/usr/include
93 $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(1)/usr/include/
94 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(1)/usr/include/
95 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses_dll.h $(1)/usr/include/
96 $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(1)/usr/include/
97 $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(1)/usr/include/
98 $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(1)/usr/include/
99 $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(1)/usr/include/
100 $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(1)/usr/include/
101 $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(1)/usr/include/
102 mkdir -p $(1)/usr/lib
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(1)/usr/lib/
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(1)/usr/lib/
105 endef
106
107 $(eval $(call HostBuild))
108 $(eval $(call BuildPackage,libncurses))