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.

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