get rid of $Id$ - it has never helped us and it has broken too many patches ;)
[openwrt-10.03/.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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ncurses
11 PKG_VERSION:=5.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@GNU/ncurses
16 PKG_MD5SUM:=cce05daf61a64501ef6cd8da1f727ec6
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/libncurses
21   SECTION:=libs
22   CATEGORY:=Libraries
23   TITLE:=Terminal handling library
24   URL:=http://www.gnu.org/software/ncurses/
25 endef
26
27 TARGET_CFLAGS += $(FPIC)
28
29 CONFIGURE_ARGS += \
30         --enable-echo \
31         --enable-const \
32         --enable-overwrite \
33         --disable-rpath \
34         --without-ada \
35         --without-cxx \
36         --without-cxx-binding \
37         --without-debug \
38         --without-profile \
39         --without-progs \
40         --with-normal \
41         --with-shared \
42         --with-terminfo-dirs=/usr/share/terminfo \
43         --with-default-terminfo-dir=/usr/share/terminfo
44
45 define Build/Compile
46         $(MAKE) -C $(PKG_BUILD_DIR) \
47                 $(TARGET_CONFIGURE_OPTS) \
48                 BUILD_CC="$(HOSTCC)" \
49                 HOSTCC="$(HOSTCC)" \
50                 HOSTCCFLAGS="" \
51                 DESTDIR="$(PKG_INSTALL_DIR)" \
52                 libs install.libs install.data
53 endef
54
55 define Package/libncurses/install
56         $(INSTALL_DIR) $(1)/usr/lib
57         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}*.so.* $(1)/usr/lib/
58         $(INSTALL_DIR) $(1)/usr/share/terminfo
59         (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
60                 for dir in ??; do \
61                         [ -d "$$$$dir" ] || continue; \
62                         mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
63                 done \
64         )
65         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 \
66                 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
67                 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
68                         $(1)/usr/share/terminfo/$$$$file; \
69         done
70 endef
71
72 define Build/InstallDev
73         mkdir -p $(1)/usr/include
74         $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(1)/usr/include/
75         $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(1)/usr/include/
76         $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses_dll.h $(1)/usr/include/
77         $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(1)/usr/include/
78         $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(1)/usr/include/
79         $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(1)/usr/include/
80         $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(1)/usr/include/
81         $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(1)/usr/include/
82         $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(1)/usr/include/
83         mkdir -p $(1)/usr/lib
84         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(1)/usr/lib/
85         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(1)/usr/lib/
86 endef
87
88 $(eval $(call BuildPackage,libncurses))