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.

96 lines
2.5 KiB

  1. #
  2. # Copyright (C) 2016 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:=squashfs-tools
  9. PKG_VERSION:=4.5
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_LICENSE:=GPL-2.0-only
  12. PKG_LICENSE_FILES:=COPYING
  13. PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  14. PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:=https://codeload.github.com/plougher/squashfs-tools/tar.gz/${PKG_VERSION}?
  17. PKG_HASH:=b9e16188e6dc1857fe312633920f7d71cc36b0162eb50f3ecb1f0040f02edddd
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/squashfs-tools/Default
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. SUBMENU:=Filesystem
  24. TITLE:=Tools to create and extract Squashfs filesystems
  25. URL:=https://github.com/plougher/squashfs-tools
  26. DEPENDS += +libpthread +zlib \
  27. +SQUASHFS_TOOLS_LZO_SUPPORT:liblzo \
  28. +SQUASHFS_TOOLS_LZ4_SUPPORT:liblz4 \
  29. +SQUASHFS_TOOLS_XZ_SUPPORT:liblzma \
  30. +SQUASHFS_TOOLS_ZSTD_SUPPORT:libzstd
  31. endef
  32. define Package/squashfs-tools-mksquashfs
  33. $(call Package/squashfs-tools/Default)
  34. TITLE+= mksquashfs
  35. endef
  36. define Package/squashfs-tools-unsquashfs
  37. $(call Package/squashfs-tools/Default)
  38. TITLE+= unsquashfs
  39. endef
  40. define Package/squashfs-tools-unsquashfs/config
  41. source "$(SOURCE)/Config.in"
  42. endef
  43. Build/Configure:=
  44. MAKE_FLAGS += \
  45. XATTR_SUPPORT=
  46. ifneq ($(CONFIG_SQUASHFS_TOOLS_XZ_SUPPORT),)
  47. MAKE_FLAGS += XZ_SUPPORT=1
  48. endif
  49. ifneq ($(CONFIG_SQUASHFS_TOOLS_LZO_SUPPORT),)
  50. MAKE_FLAGS += LZO_SUPPORT=1
  51. endif
  52. ifneq ($(CONFIG_SQUASHFS_TOOLS_LZ4_SUPPORT),)
  53. MAKE_FLAGS += LZ4_SUPPORT=1
  54. endif
  55. ifneq ($(CONFIG_SQUASHFS_TOOLS_ZSTD_SUPPORT),)
  56. MAKE_FLAGS += ZSTD_SUPPORT=1
  57. endif
  58. define Build/Compile
  59. $(MAKE) -C $(PKG_BUILD_DIR)/squashfs-tools \
  60. CC="$(TARGET_CC)" \
  61. EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  62. EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
  63. $(MAKE_FLAGS) \
  64. mksquashfs unsquashfs
  65. endef
  66. define Package/squashfs-tools-mksquashfs/install
  67. $(INSTALL_DIR) $(1)/usr/sbin
  68. $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/mksquashfs $(1)/usr/sbin/mksquashfs
  69. $(LN) mksquashfs $(1)/usr/sbin/sqfstar
  70. endef
  71. define Package/squashfs-tools-unsquashfs/install
  72. $(INSTALL_DIR) $(1)/usr/sbin
  73. $(INSTALL_BIN) $(PKG_BUILD_DIR)/squashfs-tools/unsquashfs $(1)/usr/sbin/unsquashfs
  74. $(LN) unsquashfs $(1)/usr/sbin/sqfscat
  75. endef
  76. $(eval $(call BuildPackage,squashfs-tools-mksquashfs))
  77. $(eval $(call BuildPackage,squashfs-tools-unsquashfs))