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:=b6593abe1089d6aab1551c105c9300e3
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 -$(MAKE) -C $(PKG_BUILD_DIR) distclean
40 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
43 --target=$(GNU_HOST_NAME) \
44 --host=$(GNU_HOST_NAME) \
45 --build=$(GNU_HOST_NAME) \
51 --datadir=/usr/share \
52 --includedir=/usr/include \
53 --infodir=/usr/share/info \
55 --libexecdir=/usr/lib \
56 --localstatedir=/var \
57 --mandir=/usr/share/man \
61 $(DISABLE_LARGEFILE) \
68 --without-cxx-binding \
74 --with-terminfo-dirs=/usr/share/terminfo \
75 --with-default-terminfo-dir=/usr/share/terminfo \
77 $(MAKE) -C $(PKG_BUILD_DIR) \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
80 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
81 $(TARGET_CONFIGURE_OPTS) \
82 CFLAGS="$(TARGET_CFLAGS)" \
83 CPPFLAGS="$(TARGET_CPPFLAGS)" \
84 LDFLAGS="$(TARGET_LDFLAGS)" \
86 --target=$(GNU_TARGET_NAME) \
87 --host=$(GNU_TARGET_NAME) \
88 --build=$(GNU_HOST_NAME) \
94 --datadir=/usr/share \
95 --includedir=/usr/include \
96 --infodir=/usr/share/info \
98 --libexecdir=/usr/lib \
99 --localstatedir=/var \
100 --mandir=/usr/share/man \
101 --sbindir=/usr/sbin \
104 $(DISABLE_LARGEFILE) \
111 --without-cxx-binding \
117 --with-terminfo-dirs=/usr/share/terminfo \
118 --with-default-terminfo-dir=/usr/share/terminfo \
120 rm -f $(PKG_BUILD_DIR)/lib/lib*
121 $(MAKE) -C $(PKG_BUILD_DIR) \
122 $(TARGET_CONFIGURE_OPTS) \
123 BUILD_CC="$(TARGET_CC)" \
126 DESTDIR="$(PKG_INSTALL_DIR)" \
127 libs install.libs install.data
130 define Package/libncurses/install
131 $(INSTALL_DIR) $(1)/usr/lib
132 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}*.so.* $(1)/usr/lib/
133 $(INSTALL_DIR) $(1)/usr/share/terminfo
134 (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
136 [ -d "$$$$dir" ] || continue; \
137 mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
140 for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
141 $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
142 $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
143 $(1)/usr/share/terminfo/$$$$file; \
147 define Build/InstallDev
148 mkdir -p $(STAGING_DIR)/usr/include
149 $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(STAGING_DIR)/usr/include/
150 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(STAGING_DIR)/usr/include/
151 $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses_dll.h $(STAGING_DIR)/usr/include/
152 $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(STAGING_DIR)/usr/include/
153 $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(STAGING_DIR)/usr/include/
154 $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(STAGING_DIR)/usr/include/
155 $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(STAGING_DIR)/usr/include/
156 $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(STAGING_DIR)/usr/include/
157 $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(STAGING_DIR)/usr/include/
158 mkdir -p $(STAGING_DIR)/usr/lib
159 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(STAGING_DIR)/usr/lib/
160 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(STAGING_DIR)/usr/lib/
163 define Build/UninstallDev
165 $(STAGING_DIR)/usr/include/curses.h \
166 $(STAGING_DIR)/usr/include/ncurses.h \
167 $(STAGING_DIR)/usr/include/ncurses_dll.h \
168 $(STAGING_DIR)/usr/include/menu.h \
169 $(STAGING_DIR)/usr/include/panel.h \
170 $(STAGING_DIR)/usr/include/term{,cap}.h \
171 $(STAGING_DIR)/usr/include/unctrl.h \
172 $(STAGING_DIR)/usr/include/form.h \
173 $(STAGING_DIR)/usr/include/eti.h \
174 $(STAGING_DIR)/usr/lib/libcurses.so \
175 $(STAGING_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*}
178 $(eval $(call BuildPackage,libncurses))