Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #
  2. # Copyright (C) 2007-2008 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=bzip2
  9. PKG_VERSION:=1.0.6
  10. PKG_RELEASE:=5
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://distfiles.gentoo.org/distfiles/ \
  13. http://distcache.freebsd.org/ports-distfiles/
  14. PKG_HASH:=a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd
  15. PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
  16. PKG_LICENSE:=BZIP2
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:bzip:bzip2
  19. include $(INCLUDE_DIR)/host-build.mk
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/bzip2/Default
  22. SUBMENU:=Compression
  23. URL:=http://www.bzip.org/
  24. endef
  25. define Package/libbz2
  26. $(call Package/bzip2/Default)
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. DEPENDS:=
  30. TITLE:=bzip2 library.
  31. ABI_VERSION:=1.0
  32. endef
  33. define Package/libbz2/description
  34. bzip2 is a freely available, patent free, high-quality
  35. data compressor. This packages provides libbz2 library.
  36. endef
  37. define Package/bzip2
  38. $(call Package/bzip2/Default)
  39. SECTION:=utils
  40. CATEGORY:=Utilities
  41. DEPENDS:=+libbz2
  42. TITLE:=bzip2 is a compression utility.
  43. endef
  44. define Package/bzip2/description
  45. bzip2 is a freely available, patent free, high-quality
  46. data compressor. This package provides the binary.
  47. endef
  48. TARGET_CFLAGS += \
  49. $(FPIC)
  50. CONFIGURE_ARGS += --prefix=/usr
  51. MAKE_FLAGS += \
  52. -f Makefile-libbz2_so \
  53. CFLAGS="$(TARGET_CFLAGS)" \
  54. LDFLAGS="$(TARGET_LDFLAGS)" \
  55. all
  56. define Build/InstallDev
  57. $(INSTALL_DIR) $(1)/usr/include
  58. $(CP) $(PKG_BUILD_DIR)/bzlib.h $(1)/usr/include/
  59. $(INSTALL_DIR) $(1)/usr/lib
  60. $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/
  61. $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0
  62. $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so
  63. endef
  64. define Package/libbz2/install
  65. $(INSTALL_DIR) $(1)/usr/lib/
  66. $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/
  67. $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0
  68. endef
  69. define Package/bzip2/install
  70. $(INSTALL_DIR) $(1)/usr/bin/
  71. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bzip2-shared $(1)/usr/bin/bzip2
  72. $(INSTALL_DIR) $(1)/bin/
  73. $(LN) ../usr/bin/bzip2 $(1)/bin/bzip2
  74. endef
  75. HOST_CFLAGS += \
  76. $(FPIC)
  77. HOST_MAKE_FLAGS+= \
  78. CFLAGS="$(HOST_CFLAGS)" \
  79. LDFLAGS="$(HOST_LDFLAGS)" \
  80. all
  81. HOST_CONFIGURE_ARGS+= \
  82. --prefix=$(STAGING_DIR_HOSTPKG)
  83. define Host/Install
  84. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
  85. $(MAKE) -C $(HOST_BUILD_DIR) PREFIX=$(STAGING_DIR_HOSTPKG)/ install
  86. endef
  87. $(eval $(call HostBuild))
  88. $(eval $(call BuildPackage,libbz2))
  89. $(eval $(call BuildPackage,bzip2))