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.

120 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2013-2015 OpenWrt.org
  3. # Copyright (C) 2017 Daniel Engberg <daniel.engberg.lists@pyret.net>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=xz
  10. PKG_VERSION:=5.2.4
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=@SF/lzmautils
  14. PKG_HASH:=3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf
  15. PKG_MAINTAINER:=
  16. PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_CPE_ID:=cpe:/a:tukaani:xz
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/xz/Default
  23. SUBMENU:=Compression
  24. SECTION:=utils
  25. CATEGORY:=Utilities
  26. URL:=https://tukaani.org/xz
  27. endef
  28. define Package/xz-utils
  29. $(call Package/xz/Default)
  30. TITLE:=XZ Utils (meta)
  31. MENU:=1
  32. endef
  33. define Package/liblzma
  34. $(call Package/xz/Default)
  35. SECTION:=libs
  36. CATEGORY:=Libraries
  37. DEPENDS:=+libpthread
  38. TITLE:=liblzma library from XZ Utils
  39. endef
  40. # $(1): package name & command in /usr/bin/
  41. # $(2): package dependencies
  42. # $(3): symbolic links to $(1) in /usr/bin/
  43. define BuildSubPackage
  44. define Package/$(1)
  45. $(call Package/xz/Default)
  46. DEPENDS:=xz-utils $(2)
  47. TITLE:=$(1) utility from XZ Utils
  48. endef
  49. define Package/$(1)/description
  50. Contains: $(1) $(3)
  51. endef
  52. define Package/$(1)/install
  53. $(INSTALL_DIR) $$(1)/usr/bin
  54. $(CP) $(foreach f,$(1) $(3),$(PKG_INSTALL_DIR)/usr/bin/$(f)) $$(1)/usr/bin/
  55. endef
  56. $$(eval $$(call BuildPackage,$(1)))
  57. endef
  58. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  59. CONFIGURE_ARGS += \
  60. --enable-small \
  61. --enable-assume-ram=4 \
  62. --disable-assembler \
  63. --disable-debug \
  64. --disable-doc \
  65. --disable-rpath \
  66. --disable-symbol-versions \
  67. --disable-werror \
  68. --with-pic
  69. define Build/InstallDev
  70. $(INSTALL_DIR) $(1)/usr/include
  71. $(CP) \
  72. $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
  73. $(1)/usr/include/
  74. $(INSTALL_DIR) $(1)/usr/lib
  75. $(CP) \
  76. $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
  77. $(1)/usr/lib/
  78. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  79. $(CP) \
  80. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
  81. $(1)/usr/lib/pkgconfig/
  82. endef
  83. define Package/xz-utils/install
  84. true
  85. endef
  86. define Package/liblzma/install
  87. $(INSTALL_DIR) $(1)/usr/lib
  88. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
  89. endef
  90. $(eval $(call BuildPackage,xz-utils))
  91. $(eval $(call BuildPackage,liblzma))
  92. $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
  93. $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
  94. $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
  95. $(eval $(call BuildSubPackage,xzdec, +liblzma,))
  96. $(eval $(call BuildSubPackage,xzdiff, +bash +xz, lzcmp lzdiff xzcmp))
  97. $(eval $(call BuildSubPackage,xzgrep, +bash +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
  98. $(eval $(call BuildSubPackage,xzless, +bash +xz, lzless))
  99. $(eval $(call BuildSubPackage,xzmore, +bash +xz, lzmore))