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.

123 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:=5
  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-or-later GPL-2.0-or-later GPL-3.0-or-later
  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. CONFIGURE_VARS += \
  70. gl_cv_posix_shell=/bin/sh
  71. define Build/InstallDev
  72. $(INSTALL_DIR) $(1)/usr/include
  73. $(CP) \
  74. $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
  75. $(1)/usr/include/
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) \
  78. $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
  79. $(1)/usr/lib/
  80. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  81. $(CP) \
  82. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
  83. $(1)/usr/lib/pkgconfig/
  84. endef
  85. define Package/xz-utils/install
  86. true
  87. endef
  88. define Package/liblzma/install
  89. $(INSTALL_DIR) $(1)/usr/lib
  90. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
  91. endef
  92. $(eval $(call BuildPackage,xz-utils))
  93. $(eval $(call BuildPackage,liblzma))
  94. $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
  95. $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
  96. $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
  97. $(eval $(call BuildSubPackage,xzdec, +liblzma,))
  98. $(eval $(call BuildSubPackage,xzdiff, +xz, lzcmp lzdiff xzcmp))
  99. $(eval $(call BuildSubPackage,xzgrep, +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
  100. $(eval $(call BuildSubPackage,xzless, +xz, lzless))
  101. $(eval $(call BuildSubPackage,xzmore, +xz, lzmore))