coolsnowwolf-packages/utils/btrfs-progs/Makefile

102 lines
2.7 KiB
Makefile
Raw Permalink Normal View History

2018-10-18 16:56:47 +08:00
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=btrfs-progs
PKG_VERSION:=5.16.1
PKG_RELEASE:=$(AUTORELEASE)
2018-10-18 16:56:47 +08:00
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
2020-07-08 14:18:52 +08:00
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs
PKG_HASH:=3da4da5361cf86bddda80edb4c4f30ea076cb4ebec29904fa08afc930ef9e1a8
2018-10-18 16:56:47 +08:00
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
2020-07-08 14:18:52 +08:00
PKG_MAINTAINER:=Karel Kočí <karel.koci@nic.cz>
PKG_LICENSE:=GPL-2.0-only
2018-10-18 16:56:47 +08:00
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=acl
PKG_FIXUP:=autoreconf
2018-10-18 16:56:47 +08:00
include $(INCLUDE_DIR)/package.mk
ifneq ($(CONFIG_USE_MUSL),)
TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
endif
2018-10-18 16:56:47 +08:00
define Package/btrfs-progs
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Filesystem
TITLE:=Btrfs filesystems utilities
2020-07-08 14:18:52 +08:00
URL:=https://btrfs.wiki.kernel.org/
DEPENDS:= \
+libattr \
+libuuid \
2021-06-15 17:47:11 +08:00
+libmount \
2020-07-08 14:18:52 +08:00
+zlib \
+libblkid \
+liblzo \
+libpthread \
+kmod-fs-btrfs \
+BTRFS_PROGS_ZSTD:libzstd
2018-10-18 16:56:47 +08:00
endef
define Package/btrfs-progs/description
Btrfs is a new copy on write filesystem for Linux aimed at implementing
advanced features while focusing on fault tolerance, repair and easy
administration. Initially developed by Oracle, Btrfs is licensed under the
GPL and open for contribution from anyone.
endef
2020-07-08 14:18:52 +08:00
define Package/btrfs-progs/config
source "$(SOURCE)/Config.in"
endef
boxprogs = btrfsck mkfs.btrfs btrfs-image btrfstune btrfs-find-root
progs = btrfs-map-logical btrfs-select-super
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
EXTRA_CFLAGS=$(TARGET_CPPFLAGS)
2018-10-18 16:56:47 +08:00
CONFIGURE_ARGS += \
--disable-backtrace \
--disable-convert \
--disable-documentation \
--disable-libudev \
2020-07-08 14:18:52 +08:00
--disable-python
ifneq ($(CONFIG_BTRFS_PROGS_ZSTD),y)
CONFIGURE_ARGS += --disable-zstd
endif
2018-10-18 16:56:47 +08:00
2020-07-08 14:18:52 +08:00
MAKE_INSTALL_FLAGS += BUILD_PROGRAMS=0
Build/Compile=$(call Build/Compile/Default,btrfs.box $(progs))
2018-10-18 16:56:47 +08:00
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
2020-07-08 14:18:52 +08:00
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs* $(1)/usr/lib/
2018-10-18 16:56:47 +08:00
endef
define Package/btrfs-progs/install
$(INSTALL_DIR) $(1)/usr/lib
2020-07-08 14:18:52 +08:00
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbtrfsutil.so* $(1)/usr/lib
2018-10-18 16:56:47 +08:00
$(INSTALL_DIR) $(1)/usr/bin
2020-07-08 14:18:52 +08:00
$(INSTALL_BIN) $(PKG_BUILD_DIR)/btrfs.box $(1)/usr/bin/btrfs
$(foreach prog,$(boxprogs),$(LN) btrfs $(1)/usr/bin/$(prog);)
$(foreach prog,$(progs),$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(prog) $(1)/usr/bin/;)
$(INSTALL_DIR) $(1)/lib/preinit
$(INSTALL_BIN) ./files/btrfs-scan.init $(1)/lib/preinit/85_btrfs_scan
2018-10-18 16:56:47 +08:00
endef
$(eval $(call BuildPackage,btrfs-progs))