1
0

Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.3
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=@SF/lzmautils \
  14. http://tukaani.org/xz
  15. PKG_MD5SUM:=fd9ca16de1052aac899ad3495ad20dfa906c27b4a5070102a2ec35ca3a4740c1
  16. PKG_LICENSE:=Public-Domain LGPL-2.1+ GPL-2.0+ GPL-3.0+
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  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:=http://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. CONFIGURE_ARGS += \
  59. --enable-small \
  60. --enable-assume-ram=4 \
  61. --disable-assembler \
  62. --disable-werror \
  63. # API uses "restrict" keyword introduced in C99 standard
  64. TARGET_CFLAGS += \
  65. -std=c99 \
  66. define Build/InstallDev
  67. $(INSTALL_DIR) $(1)/usr/include
  68. $(CP) \
  69. $(PKG_INSTALL_DIR)/usr/include/lzma{,.h} \
  70. $(1)/usr/include/
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) \
  73. $(PKG_INSTALL_DIR)/usr/lib/liblzma.{a,so*} \
  74. $(1)/usr/lib/
  75. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  76. $(CP) \
  77. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liblzma.pc \
  78. $(1)/usr/lib/pkgconfig/
  79. endef
  80. define Package/xz-utils/install
  81. true
  82. endef
  83. define Package/liblzma/install
  84. $(INSTALL_DIR) $(1)/usr/lib
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblzma.so.* $(1)/usr/lib/
  86. endef
  87. $(eval $(call BuildPackage,xz-utils))
  88. $(eval $(call BuildPackage,liblzma))
  89. $(eval $(call BuildSubPackage,lzmadec, +liblzma,))
  90. $(eval $(call BuildSubPackage,lzmainfo, +liblzma,))
  91. $(eval $(call BuildSubPackage,xz, +liblzma, lzcat lzma unlzma unxz xzcat))
  92. $(eval $(call BuildSubPackage,xzdec, +liblzma,))
  93. $(eval $(call BuildSubPackage,xzdiff, +bash +xz, lzcmp lzdiff xzcmp))
  94. $(eval $(call BuildSubPackage,xzgrep, +bash +xz, lzegrep lzfgrep lzgrep xzegrep xzfgrep))
  95. $(eval $(call BuildSubPackage,xzless, +bash +xz, lzless))
  96. $(eval $(call BuildSubPackage,xzmore, +bash +xz, lzmore))