Makefile 2.4 KB

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