| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2014 OpenWrt.org |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=f2fs-tools |
| 11 | PKG_VERSION:=1.16.0 |
| 12 | PKG_RELEASE:=3 |
| 13 | |
| 14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 15 | PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ |
| 16 | PKG_HASH:=208c7a07e95383fbd7b466b5681590789dcb41f41bf197369c41a95383b57c5e |
| 17 | |
| 18 | PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> |
| 19 | PKG_LICENSE:=GPL-2.0-only |
| 20 | PKG_LICENSE_FILES:=COPYING |
| 21 | PKG_CPE_ID:=cpe:/a:f2fs-tools_project:f2fs-tools |
| 22 | |
| 23 | PKG_FIXUP:=autoreconf |
| 24 | PKG_BUILD_PARALLEL:=1 |
| 25 | PKG_INSTALL:=1 |
| 26 | |
| 27 | include $(INCLUDE_DIR)/package.mk |
| 28 | |
| 29 | define Package/f2fs-tools/Default |
| 30 | SECTION:=utils |
| 31 | CATEGORY:=Utilities |
| 32 | SUBMENU:=Filesystem |
| 33 | DEPENDS:=+libf2fs |
| 34 | URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git |
| 35 | VARIANT:=default |
| 36 | endef |
| 37 | |
| 38 | define Package/f2fs-tools/SELinux |
| 39 | SECTION:=utils |
| 40 | CATEGORY:=Utilities |
| 41 | SUBMENU:=Filesystem |
| 42 | DEPENDS:=+libf2fs-selinux +libselinux |
| 43 | URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git |
| 44 | VARIANT:=selinux |
| 45 | endef |
| 46 | |
| 47 | define Package/mkf2fs |
| 48 | $(Package/f2fs-tools/Default) |
| 49 | TITLE:=Utility for creating a Flash-Friendly File System (F2FS) |
| 50 | CONFLICTS:=mkf2fs-selinux |
| 51 | endef |
| 52 | |
| 53 | define Package/mkf2fs-selinux |
| 54 | $(Package/f2fs-tools/SELinux) |
| 55 | TITLE:=Utility for creating a Flash-Friendly File System (F2FS) with SELinux support |
| 56 | endef |
| 57 | |
| 58 | define Package/f2fsck |
| 59 | $(Package/f2fs-tools/Default) |
| 60 | TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS) |
| 61 | CONFLICTS:=f2fsck-selinux |
| 62 | endef |
| 63 | |
| 64 | define Package/f2fsck-selinux |
| 65 | $(Package/f2fs-tools/SELinux) |
| 66 | TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS) with SELinux support |
| 67 | endef |
| 68 | |
| 69 | define Package/f2fs-tools |
| 70 | $(Package/f2fs-tools/Default) |
| 71 | TITLE:=Tools for Flash-Friendly File System (F2FS) |
| 72 | DEPENDS += +mkf2fs +f2fsck |
| 73 | CONFLICTS:=f2fs-tools-selinux |
| 74 | endef |
| 75 | |
| 76 | define Package/f2fs-tools-selinux |
| 77 | $(Package/f2fs-tools/SELinux) |
| 78 | TITLE:=Tools for Flash-Friendly File System (F2FS) with SELinux support |
| 79 | DEPENDS += +mkf2fs-selinux +f2fsck-selinux |
| 80 | endef |
| 81 | |
| 82 | define Package/libf2fs |
| 83 | SECTION:=libs |
| 84 | CATEGORY:=Libraries |
| 85 | TITLE:=Library for Flash-Friendly File System (F2FS) tools |
| 86 | DEPENDS:=+libuuid |
| 87 | ABI_VERSION:=6 |
| 88 | CONFLICTS:=libf2fs-selinux |
| 89 | VARIANT:=default |
| 90 | endef |
| 91 | |
| 92 | define Package/libf2fs-selinux |
| 93 | SECTION:=libs |
| 94 | CATEGORY:=Libraries |
| 95 | TITLE:=Library for Flash-Friendly File System (F2FS) tools with SELinux support |
| 96 | DEPENDS:=+libuuid +libselinux |
| 97 | ABI_VERSION:=6 |
| 98 | VARIANT:=selinux |
| 99 | endef |
| 100 | |
| 101 | CONFIGURE_ARGS += \ |
| 102 | --disable-static \ |
| 103 | --without-blkid \ |
| 104 | --without-lzo2 \ |
| 105 | --without-lz4 |
| 106 | |
| 107 | ifneq ($(BUILD_VARIANT),selinux) |
| 108 | CONFIGURE_ARGS += --without-selinux |
| 109 | endif |
| 110 | |
| 111 | CONFIGURE_VARS += \ |
| 112 | ac_cv_file__git=no |
| 113 | |
| 114 | ifneq ($(CONFIG_USE_MUSL),) |
| 115 | CONFIGURE_VARS += ac_cv_func_lseek64=yes |
| 116 | endif |
| 117 | |
| 118 | define Package/libf2fs/install |
| 119 | $(INSTALL_DIR) $(1)/usr/lib |
| 120 | $(CP) \ |
| 121 | $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so.* $(1)/usr/lib/ |
| 122 | endef |
| 123 | |
| 124 | Package/libf2fs-selinux/install = $(Package/libf2fs/install) |
| 125 | |
| 126 | define Package/mkf2fs/install |
| 127 | $(INSTALL_DIR) $(1)/usr/sbin |
| 128 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.f2fs $(1)/usr/sbin |
| 129 | endef |
| 130 | |
| 131 | Package/mkf2fs-selinux/install = $(Package/mkf2fs/install) |
| 132 | |
| 133 | define Package/f2fsck/install |
| 134 | $(INSTALL_DIR) $(1)/usr/sbin |
| 135 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin |
| 136 | $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs |
| 137 | $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs |
| 138 | $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs |
| 139 | $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs |
| 140 | $(LN) ../sbin/fsck.f2fs $(1)/usr/sbin/f2fslabel |
| 141 | endef |
| 142 | |
| 143 | Package/f2fsck-selinux/install = $(Package/f2fsck/install) |
| 144 | |
| 145 | define Package/f2fs-tools/install |
| 146 | $(INSTALL_DIR) $(1)/usr/sbin |
| 147 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fibmap.f2fs $(1)/usr/sbin |
| 148 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/parse.f2fs $(1)/usr/sbin |
| 149 | endef |
| 150 | |
| 151 | Package/f2fs-tools-selinux/install = $(Package/f2fs-tools/install) |
| 152 | |
| 153 | $(eval $(call BuildPackage,libf2fs)) |
| 154 | $(eval $(call BuildPackage,libf2fs-selinux)) |
| 155 | $(eval $(call BuildPackage,mkf2fs)) |
| 156 | $(eval $(call BuildPackage,mkf2fs-selinux)) |
| 157 | $(eval $(call BuildPackage,f2fsck)) |
| 158 | $(eval $(call BuildPackage,f2fsck-selinux)) |
| 159 | $(eval $(call BuildPackage,f2fs-tools)) |
| 160 | $(eval $(call BuildPackage,f2fs-tools-selinux)) |