1
0

Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=f2fs-tools
  9. PKG_VERSION:=1.16.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/
  13. PKG_HASH:=208c7a07e95383fbd7b466b5681590789dcb41f41bf197369c41a95383b57c5e
  14. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  15. PKG_LICENSE:=GPL-2.0-only
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:f2fs-tools_project:f2fs-tools
  18. PKG_FIXUP:=autoreconf
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/f2fs-tools/Default
  23. SECTION:=utils
  24. CATEGORY:=Utilities
  25. SUBMENU:=Filesystem
  26. DEPENDS:=+libf2fs
  27. URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
  28. VARIANT:=default
  29. endef
  30. define Package/f2fs-tools/SELinux
  31. SECTION:=utils
  32. CATEGORY:=Utilities
  33. SUBMENU:=Filesystem
  34. DEPENDS:=+libf2fs-selinux +libselinux
  35. URL:=http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git
  36. VARIANT:=selinux
  37. endef
  38. define Package/mkf2fs
  39. $(Package/f2fs-tools/Default)
  40. TITLE:=Utility for creating a Flash-Friendly File System (F2FS)
  41. CONFLICTS:=mkf2fs-selinux
  42. endef
  43. define Package/mkf2fs-selinux
  44. $(Package/f2fs-tools/SELinux)
  45. TITLE:=Utility for creating a Flash-Friendly File System (F2FS) with SELinux support
  46. endef
  47. define Package/f2fsck
  48. $(Package/f2fs-tools/Default)
  49. TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS)
  50. CONFLICTS:=f2fsck-selinux
  51. endef
  52. define Package/f2fsck-selinux
  53. $(Package/f2fs-tools/SELinux)
  54. TITLE:=Utility for checking/repairing a Flash-Friendly File System (F2FS) with SELinux support
  55. endef
  56. define Package/f2fs-tools
  57. $(Package/f2fs-tools/Default)
  58. TITLE:=Tools for Flash-Friendly File System (F2FS)
  59. DEPENDS += +mkf2fs +f2fsck
  60. CONFLICTS:=f2fs-tools-selinux
  61. endef
  62. define Package/f2fs-tools-selinux
  63. $(Package/f2fs-tools/SELinux)
  64. TITLE:=Tools for Flash-Friendly File System (F2FS) with SELinux support
  65. DEPENDS += +mkf2fs-selinux +f2fsck-selinux
  66. endef
  67. define Package/libf2fs
  68. SECTION:=libs
  69. CATEGORY:=Libraries
  70. TITLE:=Library for Flash-Friendly File System (F2FS) tools
  71. DEPENDS:=+libuuid
  72. ABI_VERSION:=6
  73. CONFLICTS:=libf2fs-selinux
  74. VARIANT:=default
  75. endef
  76. define Package/libf2fs-selinux
  77. SECTION:=libs
  78. CATEGORY:=Libraries
  79. TITLE:=Library for Flash-Friendly File System (F2FS) tools with SELinux support
  80. DEPENDS:=+libuuid +libselinux
  81. ABI_VERSION:=6
  82. VARIANT:=selinux
  83. endef
  84. CONFIGURE_ARGS += \
  85. --disable-static \
  86. --without-blkid \
  87. --without-lzo2 \
  88. --without-lz4
  89. ifneq ($(BUILD_VARIANT),selinux)
  90. CONFIGURE_ARGS += --without-selinux
  91. endif
  92. CONFIGURE_VARS += \
  93. ac_cv_file__git=no
  94. ifneq ($(CONFIG_USE_MUSL),)
  95. CONFIGURE_VARS += ac_cv_func_lseek64=yes
  96. endif
  97. define Package/libf2fs/install
  98. $(INSTALL_DIR) $(1)/usr/lib
  99. $(CP) \
  100. $(PKG_INSTALL_DIR)/usr/lib/libf2fs.so.* $(1)/usr/lib/
  101. endef
  102. Package/libf2fs-selinux/install = $(Package/libf2fs/install)
  103. define Package/mkf2fs/install
  104. $(INSTALL_DIR) $(1)/usr/sbin
  105. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.f2fs $(1)/usr/sbin
  106. endef
  107. Package/mkf2fs-selinux/install = $(Package/mkf2fs/install)
  108. define Package/f2fsck/install
  109. $(INSTALL_DIR) $(1)/usr/sbin
  110. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.f2fs $(1)/usr/sbin
  111. ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/defrag.f2fs
  112. ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/dump.f2fs
  113. ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/sload.f2fs
  114. ln -s /usr/sbin/fsck.f2fs $(1)/usr/sbin/resize.f2fs
  115. endef
  116. Package/f2fsck-selinux/install = $(Package/f2fsck/install)
  117. define Package/f2fs-tools/install
  118. $(INSTALL_DIR) $(1)/usr/sbin
  119. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fibmap.f2fs $(1)/usr/sbin
  120. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/parse.f2fs $(1)/usr/sbin
  121. endef
  122. Package/f2fs-tools-selinux/install = $(Package/f2fs-tools/install)
  123. $(eval $(call BuildPackage,libf2fs))
  124. $(eval $(call BuildPackage,libf2fs-selinux))
  125. $(eval $(call BuildPackage,mkf2fs))
  126. $(eval $(call BuildPackage,mkf2fs-selinux))
  127. $(eval $(call BuildPackage,f2fsck))
  128. $(eval $(call BuildPackage,f2fsck-selinux))
  129. $(eval $(call BuildPackage,f2fs-tools))
  130. $(eval $(call BuildPackage,f2fs-tools-selinux))