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.

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