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.

95 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.11
  8. PKG_RELEASE:=1
  9. PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
  10. PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs
  11. PKG_HASH:=d41961b0a92160c80f894ad9a1882822889c2e1d084cbf3e08b8c214a5cf0137
  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-python
  56. ifneq ($(CONFIG_BTRFS_PROGS_ZSTD),y)
  57. CONFIGURE_ARGS += --disable-zstd
  58. endif
  59. MAKE_INSTALL_FLAGS += BUILD_PROGRAMS=0
  60. Build/Compile=$(call Build/Compile/Default,btrfs.box $(progs))
  61. define Build/InstallDev
  62. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  63. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs* $(1)/usr/lib/
  65. endef
  66. define Package/btrfs-progs/install
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.so* $(1)/usr/lib
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfsutil.so* $(1)/usr/lib
  70. $(INSTALL_DIR) $(1)/usr/bin
  71. $(INSTALL_BIN) $(PKG_BUILD_DIR)/btrfs.box $(1)/usr/bin/btrfs
  72. $(foreach prog,$(boxprogs),$(LN) btrfs $(1)/usr/bin/$(prog);)
  73. $(foreach prog,$(progs),$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(prog) $(1)/usr/bin/;)
  74. $(INSTALL_DIR) $(1)/lib/preinit
  75. $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/lib/preinit/85_btrfs_scan
  76. endef
  77. $(eval $(call BuildPackage,btrfs-progs))