2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@GNU/ncurses
18 PKG_MD5SUM:=464d6a49010cf2a6eb9ce59a264d4d47
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23 include $(INCLUDE_DIR)/package.mk
25 define Package/libncurses
28 TITLE:=Terminal handling library
29 DESCRIPTION:=Terminal handling library
30 URL:=http://www.gnu.org/software/ncurses/
33 define Build/Configure
37 rm -rf $(PKG_INSTALL_DIR)
38 mkdir -p $(PKG_INSTALL_DIR)
39 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
42 --target=$(GNU_HOST_NAME) \
43 --host=$(GNU_HOST_NAME) \
44 --build=$(GNU_HOST_NAME) \
50 --datadir=/usr/share \
51 --includedir=/usr/include \
52 --infodir=/usr/share/info \
54 --libexecdir=/usr/lib \
55 --localstatedir=/var \
56 --mandir=/usr/share/man \
60 $(DISABLE_LARGEFILE) \
67 --without-cxx-binding \
73 --with-terminfo-dirs=/usr/share/terminfo \
74 --with-default-terminfo-dir=/usr/share/terminfo \
76 $(MAKE) -C $(PKG_BUILD_DIR) \
77 DESTDIR="$(PKG_INSTALL_DIR)" \
79 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
80 $(TARGET_CONFIGURE_OPTS) \
81 CFLAGS="$(TARGET_CFLAGS)" \
82 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
83 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
85 --target=$(GNU_TARGET_NAME) \
86 --host=$(GNU_TARGET_NAME) \
87 --build=$(GNU_HOST_NAME) \
93 --datadir=/usr/share \
94 --includedir=/usr/include \
95 --infodir=/usr/share/info \
97 --libexecdir=/usr/lib \
98 --localstatedir=/var \
99 --mandir=/usr/share/man \
100 --sbindir=/usr/sbin \
103 $(DISABLE_LARGEFILE) \
110 --without-cxx-binding \
116 --with-terminfo-dirs=/usr/share/terminfo \
117 --with-default-terminfo-dir=/usr/share/terminfo \
119 rm -f $(PKG_BUILD_DIR)/lib/lib*
120 $(MAKE) -C $(PKG_BUILD_DIR) \
121 $(TARGET_CONFIGURE_OPTS) \
122 BUILD_CC="$(TARGET_CC)" \
125 DESTDIR="$(PKG_INSTALL_DIR)" \
126 libs install.libs install.data
129 define Package/libncurses/install
130 $(INSTALL_DIR) $(1)/usr/lib
131 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu}*.so.* $(1)/usr/lib/
132 $(INSTALL_DIR) $(1)/usr/share/terminfo
133 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
135 [ -d "$$$$dir" ] || continue; \
136 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
139 for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
140 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
141 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
142 $(1)/usr/share/terminfo/$$$$file; \
146 define Build/InstallDev
147 mkdir -p $(STAGING_DIR)/usr/include
148 $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(STAGING_DIR)/usr/include/
149 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(STAGING_DIR)/usr/include/
150 $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(STAGING_DIR)/usr/include/
151 $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(STAGING_DIR)/usr/include/
152 $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(STAGING_DIR)/usr/include/
153 $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(STAGING_DIR)/usr/include/
154 $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(STAGING_DIR)/usr/include/
155 $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(STAGING_DIR)/usr/include/
156 mkdir -p $(STAGING_DIR)/usr/lib
157 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(STAGING_DIR)/usr/lib/
158 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(STAGING_DIR)/usr/lib/
161 define Build/UninstallDev
163 $(STAGING_DIR)/usr/include/curses.h \
164 $(STAGING_DIR)/usr/include/ncurses.h \
165 $(STAGING_DIR)/usr/include/menu.h \
166 $(STAGING_DIR)/usr/include/panel.h \
167 $(STAGING_DIR)/usr/include/term{,cap}.h \
168 $(STAGING_DIR)/usr/include/unctrl.h \
169 $(STAGING_DIR)/usr/lib/libcurses.so \
170 $(STAGING_DIR)/usr/lib/lib{ncurses,panel,menu}.{a,so*}
173 $(eval $(call BuildPackage,libncurses))