You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2013-2015 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:=xz
  9. PKG_VERSION:=5.2.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://tukaani.org/xz \
  13. http://fossies.org/linux/misc
  14. PKG_MD5SUM:=f90c9a0c8b259aee2234c4e0d7fd70af
  15. PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/xz/Default
  22. SUBMENU:=Compression
  23. SECTION:=utils
  24. CATEGORY:=Utilities
  25. URL:=http://tukaani.org/xz
  26. endef
  27. define Package/xz-utils
  28. $(call Package/xz/Default)
  29. TITLE:=XZ Utils (meta)
  30. MENU:=1
  31. endef
  32. define Package/liblzma
  33. $(call Package/xz/Default)
  34. SECTION:=libs
  35. CATEGORY:=Libraries
  36. DEPENDS:=+libpthread
  37. TITLE:=liblzma library from XZ Utils
  38. endef
  39. # $(1): package name & command in /usr/bin/
  40. # $(2): package dependencies
  41. # $(3): symbolic links to $(1) in /usr/bin/
  42. define BuildSubPackage
  43. define Package/$(1)
  44. $(call Package/xz/Default)
  45. DEPENDS:=xz-utils $(2)
  46. TITLE:=$(1) utility from XZ Utils
  47. endef
  48. define Package/$(1)/description
  49. Contains: $(1) $(3)
  50. endef
  51. define Package/$(1)/install
  52. $(INSTALL_DIR) $$(1)/usr/bin
  53. $(CP) $(foreach f,$(1) $(3),$(PKG_INSTALL_DIR)/usr/bin/$(f)) $$(1)/usr/bin/
  54. endef
  55. $$(eval $$(call BuildPackage,$(1)))
  56. endef
  57. CONFIGURE_ARGS += \
  58. --enable-small \
  59. --enable-assume-ram=4 \
  60. --disable-assembler \
  61. --disable-werror \
  62. # API uses "restrict" keyword introduced in C99 standard
  63. TARGET_CFLAGS += \
  64. -std=c99 \
  65. define Build/InstallDev
  66. $(INSTALL_DIR) $(1)/usr/include
  67. $(CP) \
  68. $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
  69. $(1)/usr/include/
  70. $(INSTALL_DIR) $(1)/usr/lib
  71. $(CP) \
  72. $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
  73. $(1)/usr/lib/
  74. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  75. $(CP) \
  76. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
  77. $(1)/usr/lib/pkgconfig/
  78. endef
  79. define Package/xz-utils/install
  80. true
  81. endef
  82. define Package/liblzma/install
  83. $(INSTALL_DIR) $(1)/usr/lib
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
  85. endef
  86. $(eval $(call BuildPackage,xz-utils))
  87. $(eval $(call BuildPackage,liblzma))
  88. $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
  89. $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
  90. $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
  91. $(eval $(call BuildSubPackage,xzdec, +liblzma,))
  92. $(eval $(call BuildSubPackage,xzdiff, +bash +xz, lzcmp lzdiff xzcmp))
  93. $(eval $(call BuildSubPackage,xzgrep, +bash +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
  94. $(eval $(call BuildSubPackage,xzless, +bash +xz, lzless))
  95. $(eval $(call BuildSubPackage,xzmore, +bash +xz, lzmore))