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.

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