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.6 KiB

  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=btrfs-progs
  7. PKG_VERSION:=5.16.1
  8. PKG_RELEASE:=$(AUTORELEASE)
  9. PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
  10. PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs
  11. PKG_HASH:=3da4da5361cf86bddda80edb4c4f30ea076cb4ebec29904fa08afc930ef9e1a8
  12. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
  13. PKG_MAINTAINER:=Karel Kočí <karel.koci@nic.cz>
  14. PKG_LICENSE:=GPL-2.0-only
  15. PKG_LICENSE_FILES:=COPYING
  16. PKG_INSTALL:=1
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_BUILD_DEPENDS:=acl
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/btrfs-progs
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. SUBMENU:=Filesystem
  24. TITLE:=Btrfs filesystems utilities
  25. URL:=https://btrfs.wiki.kernel.org/
  26. DEPENDS:= \
  27. +libattr \
  28. +libuuid \
  29. +libmount \
  30. +zlib \
  31. +libblkid \
  32. +liblzo \
  33. +libpthread \
  34. +kmod-fs-btrfs \
  35. +BTRFS_PROGS_ZSTD:libzstd
  36. endef
  37. define Package/btrfs-progs/description
  38. Btrfs is a new copy on write filesystem for Linux aimed at implementing
  39. advanced features while focusing on fault tolerance, repair and easy
  40. administration. Initially developed by Oracle, Btrfs is licensed under the
  41. GPL and open for contribution from anyone.
  42. endef
  43. define Package/btrfs-progs/config
  44. source "$(SOURCE)/Config.in"
  45. endef
  46. boxprogs = btrfsck mkfs.btrfs btrfs-image btrfstune btrfs-find-root
  47. progs = btrfs-map-logical btrfs-select-super
  48. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  49. TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
  50. EXTRA_CFLAGS=$(TARGET_CPPFLAGS)
  51. CONFIGURE_ARGS += \
  52. --disable-backtrace \
  53. --disable-convert \
  54. --disable-documentation \
  55. --disable-libudev \
  56. --disable-python
  57. ifneq ($(CONFIG_BTRFS_PROGS_ZSTD),y)
  58. CONFIGURE_ARGS += --disable-zstd
  59. endif
  60. MAKE_INSTALL_FLAGS += BUILD_PROGRAMS=0
  61. Build/Compile=$(call Build/Compile/Default,btrfs.box $(progs))
  62. define Build/InstallDev
  63. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  64. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  65. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs* $(1)/usr/lib/
  66. endef
  67. define Package/btrfs-progs/install
  68. $(INSTALL_DIR) $(1)/usr/lib
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.so* $(1)/usr/lib
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfsutil.so* $(1)/usr/lib
  71. $(INSTALL_DIR) $(1)/usr/bin
  72. $(INSTALL_BIN) $(PKG_BUILD_DIR)/btrfs.box $(1)/usr/bin/btrfs
  73. $(foreach prog,$(boxprogs),$(LN) btrfs $(1)/usr/bin/$(prog);)
  74. $(foreach prog,$(progs),$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(prog) $(1)/usr/bin/;)
  75. $(INSTALL_DIR) $(1)/lib/preinit
  76. $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/lib/preinit/85_btrfs_scan
  77. endef
  78. $(eval $(call BuildPackage,btrfs-progs))