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.

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