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.

124 lines
3.0 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.5
  11. PKG_RELEASE:=3
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_SOURCE_URL:=@SF/lzmautils
  14. PKG_HASH:=3e1e518ffc912f86608a8cb35e4bd41ad1aec210df2a47aaa1f95e7f5576ef56
  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. $(if $(3),ALTERNATIVES:=$(foreach f,$(1) $(3),300:/usr/bin/$(f):/usr/libexec/$(1)-lzmautils))
  49. endef
  50. define Package/$(1)/description
  51. Contains: $(1) $(3)
  52. endef
  53. define Package/$(1)/install
  54. $(INSTALL_DIR) $$(1)$(if $(3),/usr/libexec,/usr/bin)
  55. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)$(if $(3),/usr/libexec/$(1)-lzmautils,/usr/bin/$(1))
  56. endef
  57. $$(eval $$(call BuildPackage,$(1)))
  58. endef
  59. TARGET_LDFLAGS += -Wl,--gc-sections -flto
  60. CONFIGURE_ARGS += \
  61. --enable-small \
  62. --enable-assume-ram=4 \
  63. --disable-assembler \
  64. --disable-debug \
  65. --disable-doc \
  66. --disable-rpath \
  67. --disable-symbol-versions \
  68. --disable-werror \
  69. --with-pic
  70. CONFIGURE_VARS += \
  71. gl_cv_posix_shell=/bin/sh
  72. define Build/InstallDev
  73. $(INSTALL_DIR) $(1)/usr/include
  74. $(CP) \
  75. $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
  76. $(1)/usr/include/
  77. $(INSTALL_DIR) $(1)/usr/lib
  78. $(CP) \
  79. $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
  80. $(1)/usr/lib/
  81. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  82. $(CP) \
  83. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
  84. $(1)/usr/lib/pkgconfig/
  85. endef
  86. define Package/xz-utils/install
  87. true
  88. endef
  89. define Package/liblzma/install
  90. $(INSTALL_DIR) $(1)/usr/lib
  91. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
  92. endef
  93. $(eval $(call BuildPackage,xz-utils))
  94. $(eval $(call BuildPackage,liblzma))
  95. $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
  96. $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
  97. $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
  98. $(eval $(call BuildSubPackage,xzdec, +liblzma,))
  99. $(eval $(call BuildSubPackage,xzdiff, +xz, lzcmp lzdiff xzcmp))
  100. $(eval $(call BuildSubPackage,xzgrep, +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
  101. $(eval $(call BuildSubPackage,xzless, +xz, lzless))
  102. $(eval $(call BuildSubPackage,xzmore, +xz, lzmore))