f2fs-tools: add selinux variant

This variant is build with `libselinux` and required to set labels
during runtime.

Signed-off-by: Paul Spooren <mail@aparcar.org>
master
Paul Spooren 2020-08-19 15:02:24 -10:00 committed by Daniel Golle
parent 2e06f8ae24
commit aeea91d5ee
1 changed files with 54 additions and 1 deletions

View File

@ -31,22 +31,51 @@ define Package/f2fs-tools/Default
SUBMENU:=Filesystem SUBMENU:=Filesystem
DEPENDS:=+libf2fs DEPENDS:=+libf2fs
URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
VARIANT:=default
endef
define Package/f2fs-tools/SELinux
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Filesystem
DEPENDS:=+libf2fs-selinux +libselinux
URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
VARIANT:=selinux
endef endef
define Package/mkf2fs define Package/mkf2fs
$(Package/f2fs-tools/Default) $(Package/f2fs-tools/Default)
TITLE:=Utility for creating a Flash-Friendly File System (F2FS) TITLE:=Utility for creating a Flash-Friendly File System (F2FS)
CONFLICTS:=mkf2fs-selinux
endef
define Package/mkf2fs-selinux
$(Package/f2fs-tools/SELinux)
TITLE:=Utility for creating a Flash-Friendly File System (F2FS) with SELinux support
endef endef
define Package/f2fsck define Package/f2fsck
$(Package/f2fs-tools/Default) $(Package/f2fs-tools/Default)
TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS) TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS)
CONFLICTS:=f2fsck-selinux
endef
define Package/f2fsck-selinux
$(Package/f2fs-tools/SELinux)
TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS) with SELinux support
endef endef
define Package/f2fs-tools define Package/f2fs-tools
$(Package/f2fs-tools/Default) $(Package/f2fs-tools/Default)
TITLE:=Tools for Flash-Friendly File System (F2FS) TITLE:=Tools for Flash-Friendly File System (F2FS)
DEPENDS += +mkf2fs +f2fsck DEPENDS += +mkf2fs +f2fsck
CONFLICTS:=f2fs-tools-selinux
endef
define Package/f2fs-tools-selinux
$(Package/f2fs-tools/SELinux)
TITLE:=Tools for Flash-Friendly File System (F2FS) with SELinux support
DEPENDS += +mkf2fs-selinux +f2fsck-selinux
endef endef
define Package/libf2fs define Package/libf2fs
@ -55,13 +84,25 @@ define Package/libf2fs
TITLE:=Library for Flash-Friendly File System (F2FS) tools TITLE:=Library for Flash-Friendly File System (F2FS) tools
DEPENDS:=+libuuid DEPENDS:=+libuuid
ABI_VERSION:=6 ABI_VERSION:=6
CONFLICTS:=libf2fs-selinux
endef
define Package/libf2fs-selinux
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for Flash-Friendly File System (F2FS) tools with SELinux support
DEPENDS:=+libuuid +libselinux
ABI_VERSION:=6
endef endef
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--disable-static \ --disable-static \
--without-selinux \
--without-blkid --without-blkid
ifneq ($(BUILD_VARIANT),selinux)
CONFIGURE_ARGS += --without-selinux
endif
CONFIGURE_VARS += \ CONFIGURE_VARS += \
ac_cv_file__git=no ac_cv_file__git=no
@ -71,11 +112,15 @@ define Package/libf2fs/install
$(PKG_INSTALL_DIR)/usr/lib/libf2fs.so.* $(1)/usr/lib/ $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so.* $(1)/usr/lib/
endef endef
Package/libf2fs-selinux/install = $(Package/libf2fs/install)
define Package/mkf2fs/install define Package/mkf2fs/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.f2fs $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.f2fs $(1)/usr/sbin
endef endef
Package/mkf2fs-selinux/install = $(Package/mkf2fs/install)
define Package/f2fsck/install define Package/f2fsck/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin
@ -85,6 +130,8 @@ define Package/f2fsck/install
ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs
endef endef
Package/f2fsck-selinux/install = $(Package/f2fsck/install)
define Package/f2fs-tools/install define Package/f2fs-tools/install
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/f2fstat $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/f2fstat $(1)/usr/sbin
@ -92,7 +139,13 @@ define Package/f2fs-tools/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/parse.f2fs $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/parse.f2fs $(1)/usr/sbin
endef endef
Package/f2fs-tools-selinux/install = $(Package/f2fs-tools/install)
$(eval $(call BuildPackage,libf2fs)) $(eval $(call BuildPackage,libf2fs))
$(eval $(call BuildPackage,libf2fs-selinux))
$(eval $(call BuildPackage,mkf2fs)) $(eval $(call BuildPackage,mkf2fs))
$(eval $(call BuildPackage,mkf2fs-selinux))
$(eval $(call BuildPackage,f2fsck)) $(eval $(call BuildPackage,f2fsck))
$(eval $(call BuildPackage,f2fsck-selinux))
$(eval $(call BuildPackage,f2fs-tools)) $(eval $(call BuildPackage,f2fs-tools))
$(eval $(call BuildPackage,f2fs-tools-selinux))