Makefile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=ncurses
  10. PKG_VERSION:=5.6
  11. PKG_RELEASE:=1
  12. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=@GNU/ncurses
  15. PKG_MD5SUM:=b6593abe1089d6aab1551c105c9300e3
  16. PKG_CAT:=zcat
  17. PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/libncurses
  20. SECTION:=libs
  21. CATEGORY:=Libraries
  22. TITLE:=Terminal handling library
  23. DESCRIPTION:=Terminal handling library
  24. URL:=http://www.gnu.org/software/ncurses/
  25. endef
  26. define Build/Configure
  27. endef
  28. define Build/Compile
  29. rm -rf $(PKG_INSTALL_DIR)
  30. mkdir -p $(PKG_INSTALL_DIR)
  31. -$(MAKE) -C $(PKG_BUILD_DIR) distclean
  32. (cd $(PKG_BUILD_DIR); rm -f config.cache; \
  33. CONFIG_SITE="" \
  34. ./configure \
  35. --target=$(GNU_HOST_NAME) \
  36. --host=$(GNU_HOST_NAME) \
  37. --build=$(GNU_HOST_NAME) \
  38. --program-prefix="" \
  39. --program-suffix="" \
  40. --prefix=/usr \
  41. --exec-prefix=/usr \
  42. --bindir=/usr/bin \
  43. --datadir=/usr/share \
  44. --includedir=/usr/include \
  45. --infodir=/usr/share/info \
  46. --libdir=/usr/lib \
  47. --libexecdir=/usr/lib \
  48. --localstatedir=/var \
  49. --mandir=/usr/share/man \
  50. --sbindir=/usr/sbin \
  51. --sysconfdir=/etc \
  52. $(DISABLE_NLS) \
  53. $(DISABLE_LARGEFILE) \
  54. --enable-echo \
  55. --enable-const \
  56. --enable-overwrite \
  57. --disable-rpath \
  58. --without-ada \
  59. --without-cxx \
  60. --without-cxx-binding \
  61. --without-debug \
  62. --without-profile \
  63. --with-progs \
  64. --with-normal \
  65. --without-shared \
  66. --with-terminfo-dirs=/usr/share/terminfo \
  67. --with-default-terminfo-dir=/usr/share/terminfo \
  68. );
  69. $(MAKE) -C $(PKG_BUILD_DIR) \
  70. DESTDIR="$(PKG_INSTALL_DIR)" \
  71. libs install.progs
  72. (cd $(PKG_BUILD_DIR); rm -f config.cache; \
  73. $(TARGET_CONFIGURE_OPTS) \
  74. CFLAGS="$(TARGET_CFLAGS)" \
  75. CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
  76. LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
  77. ./configure \
  78. --target=$(GNU_TARGET_NAME) \
  79. --host=$(GNU_TARGET_NAME) \
  80. --build=$(GNU_HOST_NAME) \
  81. --program-prefix="" \
  82. --program-suffix="" \
  83. --prefix=/usr \
  84. --exec-prefix=/usr \
  85. --bindir=/usr/bin \
  86. --datadir=/usr/share \
  87. --includedir=/usr/include \
  88. --infodir=/usr/share/info \
  89. --libdir=/usr/lib \
  90. --libexecdir=/usr/lib \
  91. --localstatedir=/var \
  92. --mandir=/usr/share/man \
  93. --sbindir=/usr/sbin \
  94. --sysconfdir=/etc \
  95. $(DISABLE_NLS) \
  96. $(DISABLE_LARGEFILE) \
  97. --enable-echo \
  98. --enable-const \
  99. --enable-overwrite \
  100. --disable-rpath \
  101. --without-ada \
  102. --without-cxx \
  103. --without-cxx-binding \
  104. --without-debug \
  105. --without-profile \
  106. --without-progs \
  107. --with-normal \
  108. --with-shared \
  109. --with-terminfo-dirs=/usr/share/terminfo \
  110. --with-default-terminfo-dir=/usr/share/terminfo \
  111. );
  112. rm -f $(PKG_BUILD_DIR)/lib/lib*
  113. $(MAKE) -C $(PKG_BUILD_DIR) \
  114. $(TARGET_CONFIGURE_OPTS) \
  115. BUILD_CC="$(TARGET_CC)" \
  116. HOSTCC="$(HOSTCC)" \
  117. HOSTCCFLAGS="" \
  118. DESTDIR="$(PKG_INSTALL_DIR)" \
  119. libs install.libs install.data
  120. endef
  121. define Package/libncurses/install
  122. $(INSTALL_DIR) $(1)/usr/lib
  123. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}*.so.* $(1)/usr/lib/
  124. $(INSTALL_DIR) $(1)/usr/share/terminfo
  125. (cd $(PKG_INSTALL_DIR)/usr/share/terminfo; \
  126. for dir in ??; do \
  127. [ -d "$$$$dir" ] || continue; \
  128. mv $$$$dir $$$$(echo -ne "\x$$$$dir"); \
  129. done \
  130. )
  131. for file in a/ansi d/dumb l/linux r/rxvt s/screen v/vt100 v/vt102 x/xterm x/xterm-color; do \
  132. $(INSTALL_DIR) $(1)/usr/share/terminfo/`dirname $$$$file`; \
  133. $(CP) $(PKG_INSTALL_DIR)/usr/share/terminfo/$$$$file \
  134. $(1)/usr/share/terminfo/$$$$file; \
  135. done
  136. endef
  137. define Build/InstallDev
  138. mkdir -p $(STAGING_DIR)/usr/include
  139. $(CP) $(PKG_INSTALL_DIR)/usr/include/curses.h $(STAGING_DIR)/usr/include/
  140. $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses.h $(STAGING_DIR)/usr/include/
  141. $(CP) $(PKG_INSTALL_DIR)/usr/include/ncurses_dll.h $(STAGING_DIR)/usr/include/
  142. $(CP) $(PKG_INSTALL_DIR)/usr/include/menu.h $(STAGING_DIR)/usr/include/
  143. $(CP) $(PKG_INSTALL_DIR)/usr/include/panel.h $(STAGING_DIR)/usr/include/
  144. $(CP) $(PKG_INSTALL_DIR)/usr/include/term{,cap}.h $(STAGING_DIR)/usr/include/
  145. $(CP) $(PKG_INSTALL_DIR)/usr/include/unctrl.h $(STAGING_DIR)/usr/include/
  146. $(CP) $(PKG_INSTALL_DIR)/usr/include/form.h $(STAGING_DIR)/usr/include/
  147. $(CP) $(PKG_INSTALL_DIR)/usr/include/eti.h $(STAGING_DIR)/usr/include/
  148. mkdir -p $(STAGING_DIR)/usr/lib
  149. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcurses.so $(STAGING_DIR)/usr/lib/
  150. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*} $(STAGING_DIR)/usr/lib/
  151. endef
  152. define Build/UninstallDev
  153. rm -rf \
  154. $(STAGING_DIR)/usr/include/curses.h \
  155. $(STAGING_DIR)/usr/include/ncurses.h \
  156. $(STAGING_DIR)/usr/include/ncurses_dll.h \
  157. $(STAGING_DIR)/usr/include/menu.h \
  158. $(STAGING_DIR)/usr/include/panel.h \
  159. $(STAGING_DIR)/usr/include/term{,cap}.h \
  160. $(STAGING_DIR)/usr/include/unctrl.h \
  161. $(STAGING_DIR)/usr/include/form.h \
  162. $(STAGING_DIR)/usr/include/eti.h \
  163. $(STAGING_DIR)/usr/lib/libcurses.so \
  164. $(STAGING_DIR)/usr/lib/lib{ncurses,panel,menu,form}.{a,so*}
  165. endef
  166. $(eval $(call BuildPackage,libncurses))