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.

86 lines
2.5 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.4.1
  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:=f3e07fb248d608bdad5b63973513211de5daba47aaecfa44d29a836f6e7a9d69
  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:=+libattr +libuuid +zlib +libblkid +liblzo +libpthread +BTRFS_PROGS_ZSTD:libzstd
  27. endef
  28. define Package/btrfs-progs/description
  29. Btrfs is a new copy on write filesystem for Linux aimed at implementing
  30. advanced features while focusing on fault tolerance, repair and easy
  31. administration. Initially developed by Oracle, Btrfs is licensed under the
  32. GPL and open for contribution from anyone.
  33. endef
  34. define Package/btrfs-progs/config
  35. source "$(SOURCE)/Config.in"
  36. endef
  37. boxprogs = btrfsck mkfs.btrfs btrfs-image btrfstune btrfs-find-root
  38. progs = btrfs-map-logical btrfs-select-super
  39. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  40. TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
  41. EXTRA_CFLAGS=$(TARGET_CPPFLAGS)
  42. CONFIGURE_ARGS += \
  43. --disable-backtrace \
  44. --disable-convert \
  45. --disable-documentation \
  46. --disable-python
  47. ifneq ($(CONFIG_BTRFS_PROGS_ZSTD),y)
  48. CONFIGURE_ARGS += --disable-zstd
  49. endif
  50. MAKE_INSTALL_FLAGS += BUILD_PROGRAMS=0
  51. Build/Compile=$(call Build/Compile/Default,btrfs.box $(progs))
  52. define Build/InstallDev
  53. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  54. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  55. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs* $(1)/usr/lib/
  56. endef
  57. define Package/btrfs-progs/install
  58. $(INSTALL_DIR) $(1)/usr/lib
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.so* $(1)/usr/lib
  60. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfsutil.so* $(1)/usr/lib
  61. $(INSTALL_DIR) $(1)/usr/bin
  62. $(INSTALL_BIN) $(PKG_BUILD_DIR)/btrfs.box $(1)/usr/bin/btrfs
  63. $(foreach prog,$(boxprogs),$(LN) btrfs $(1)/usr/bin/$(prog);)
  64. $(foreach prog,$(progs),$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(prog) $(1)/usr/bin/;)
  65. $(INSTALL_DIR) $(1)/lib/preinit
  66. $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/lib/preinit/85_btrfs_scan
  67. endef
  68. $(eval $(call BuildPackage,btrfs-progs))