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.

217 lines
6.4 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:=ntfs-3g
  7. PKG_VERSION:=2021.8.22
  8. PKG_RELEASE:=2
  9. PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
  10. PKG_SOURCE_URL:=https://www.tuxera.com/opensource/
  11. PKG_HASH:=55b883aa05d94b2ec746ef3966cb41e66bed6db99f22ddd41d1b8b94bb202efb
  12. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
  13. PKG_LICENSE:=GPL-2.0-only LGPL-2.1-or-later
  14. PKG_LICENSE_FILES:=COPYING COPYING.LIB
  15. PKG_CPE_ID:=cpe:/a:ntfs-3g:ntfs-3g
  16. PKG_FIXUP:=autoreconf
  17. PKG_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. # release contains fuseext/int hint
  20. PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
  21. # define build dir, respect fuseext/int
  22. PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/ntfs-3g/common
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. URL:=https://www.tuxera.com
  28. SUBMENU:=Filesystem
  29. TITLE:=Stable Read/Write NTFS Driver
  30. endef
  31. define Package/ntfs-3g
  32. $(call Package/ntfs-3g/common)
  33. DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
  34. endef
  35. define Package/ntfs-3g/description
  36. Ntfs-3g is a NTFS driver, which can create, remove, rename,
  37. move files, directories, hard links, and streams. It can read
  38. and write files, including streams and sparse files. It can
  39. handle special files like symbolic links, devices, and FIFOs.
  40. Moreover it can also read transparently compressed files.
  41. Contains:
  42. - ntfs-3g
  43. - ntfs-3g.probe
  44. - mount.ntfs-3g (symlink to ntfs-3g)
  45. endef
  46. define Package/ntfs-3g/config
  47. config PACKAGE_NTFS-3G_USE_LIBFUSE
  48. bool "use external FUSE library, selects package libfuse"
  49. depends on PACKAGE_ntfs-3g
  50. help
  51. Ntfs-3g by default uses a minimalized lite version of FUSE.
  52. If libfuse is part of your filesystem anyway (because of sshfs, owfs
  53. etc.) it makes sense to activate this option and save some kilobytes
  54. of space.
  55. config PACKAGE_NTFS-3G_HAS_PROBE
  56. bool "install the ntfs-3g.probe utility"
  57. depends on PACKAGE_ntfs-3g
  58. default y
  59. endef
  60. define Package/ntfs-3g-low
  61. $(call Package/ntfs-3g/common)
  62. TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
  63. DEPENDS+= +ntfs-3g
  64. endef
  65. define Package/ntfs-3g-low/description
  66. Contains:
  67. - lowntfs-3g
  68. - mount.lowntfs-3g (symlink to lowntfs-3g)
  69. A driver variant using the fuse low-level interface missing some of the
  70. enhanced functionality for streams or the like. You might want to check:
  71. http://www.tuxera.com/community/ntfs-3g-manual/
  72. endef
  73. define Package/ntfs-3g-utils/description
  74. Suite of NTFS utilities for doing neat things with NTFS.
  75. Contains:
  76. - mkntfs - Create an NTFS filesystem.
  77. - ntfscat - Dump a file's content to the standard output.
  78. - ntfsclone - Efficiently clone, backup, restore or rescue NTFS.
  79. - ntfscluster - Locate the files which use the given sectors or clusters.
  80. - ntfscmp - Compare two NTFS filesystems and tell the differences.
  81. - ntfscp - Copy a file to an NTFS volume.
  82. - ntfssecaudit - Display ownership and permissions, check consistency
  83. - ntfsfix - Check and fix some common errors, clear the LogFile.
  84. - ntfsinfo - Show information about NTFS or one of the files or directories within it.
  85. - ntfslabel - Show, or set, an NTFS filesystem's volume label.
  86. - ntfsls - List information about files in a directory residing on an NTFS.
  87. - ntfsresize - Resize NTFS without losing data.
  88. - ntfsundelete - Recover deleted files from NTFS.
  89. - ntfsusermap - Define mapping of Windows accounts to Linux logins
  90. endef
  91. define Package/ntfs-3g-utils
  92. $(call Package/ntfs-3g/common)
  93. TITLE:=ntfs-3g utilities
  94. DEPENDS+= +ntfs-3g +libgcrypt +libuuid
  95. endef
  96. CONFIGURE_ARGS += \
  97. --enable-shared \
  98. --enable-static \
  99. --with-uuid
  100. # configure/make according selection
  101. ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
  102. CONFIGURE_ARGS += --with-fuse=external
  103. TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
  104. else
  105. CONFIGURE_ARGS += --with-fuse=internal
  106. TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
  107. endif
  108. # enable ntfsprogs and extras
  109. ifneq ($(CONFIG_PACKAGE_ntfs-3g-utils)$(SDK)$(DEVELOPER),)
  110. CONFIGURE_ARGS += --enable-ntfsprogs --enable-extras
  111. else
  112. CONFIGURE_ARGS += --disable-ntfsprogs --disable-extras
  113. endif
  114. # redefine prepare to extract to our build dir
  115. # apply patches
  116. define Build/Prepare
  117. rm -rf $(PKG_BUILD_DIR)/
  118. mkdir -p $(PKG_BUILD_DIR)/
  119. $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
  120. $(Build/Patch)
  121. endef
  122. define Build/InstallDev
  123. $(INSTALL_DIR) $(1)/usr/include
  124. $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
  125. $(INSTALL_DIR) $(1)/usr/lib
  126. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
  127. endef
  128. define Package/ntfs-3g/install
  129. $(INSTALL_DIR) $(1)/usr/bin
  130. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g $(1)/usr/bin/
  131. $(if $(CONFIG_PACKAGE_NTFS-3G_HAS_PROBE),$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.probe $(1)/usr/bin/,)
  132. $(INSTALL_DIR) $(1)/usr/lib
  133. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
  134. $(INSTALL_DIR) $(1)/sbin
  135. $(LN) ../usr/bin/ntfs-3g $(1)/sbin/mount.ntfs-3g
  136. endef
  137. define Package/ntfs-3g/postinst
  138. #!/bin/sh
  139. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  140. ID="ntfs-3g"
  141. if ! [ -f '/etc/filesystems' ]; then
  142. echo "Create '$$FILE'."
  143. touch "$$FILE"
  144. fi
  145. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  146. echo "Add '$$ID' to known filesystems."
  147. echo "$$ID" >> "$$FILE"
  148. fi
  149. endef
  150. define Package/ntfs-3g-low/install
  151. $(INSTALL_DIR) $(1)/usr/bin
  152. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
  153. $(INSTALL_DIR) $(1)/sbin
  154. $(LN) ../usr/bin/lowntfs-3g $(1)/sbin/mount.lowntfs-3g
  155. endef
  156. define Package/ntfs-3g-low/postinst
  157. #!/bin/sh
  158. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  159. ID="lowntfs-3g"
  160. if ! [ -f '/etc/filesystems' ]; then
  161. echo "Create '$$FILE'."
  162. touch "$$FILE"
  163. fi
  164. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  165. echo "Add '$$ID' to known filesystems."
  166. echo "$$ID" >> "$$FILE"
  167. fi
  168. endef
  169. define Package/ntfs-3g-utils/install
  170. rm -f $(PKG_INSTALL_DIR)/usr/sbin/mkfs.ntfs
  171. $(INSTALL_DIR) $(1)/usr/{bin,sbin}
  172. $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
  173. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  174. $(LN) mkntfs $(1)/usr/sbin/mkfs.ntfs
  175. endef
  176. $(eval $(call BuildPackage,ntfs-3g))
  177. $(eval $(call BuildPackage,ntfs-3g-low))
  178. $(eval $(call BuildPackage,ntfs-3g-utils))