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.

213 lines
6.2 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:=1
  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. endef
  54. define Package/ntfs-3g-low
  55. $(call Package/ntfs-3g/common)
  56. TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
  57. DEPENDS+= +ntfs-3g
  58. endef
  59. define Package/ntfs-3g-low/description
  60. Contains:
  61. - lowntfs-3g
  62. - mount.lowntfs-3g (symlink to lowntfs-3g)
  63. A driver variant using the fuse low-level interface missing some of the
  64. enhanced functionality for streams or the like. You might want to check:
  65. http://www.tuxera.com/community/ntfs-3g-manual/
  66. endef
  67. define Package/ntfs-3g-utils/description
  68. Suite of NTFS utilities for doing neat things with NTFS.
  69. Contains:
  70. - mkntfs - Create an NTFS filesystem.
  71. - ntfscat - Dump a file's content to the standard output.
  72. - ntfsclone - Efficiently clone, backup, restore or rescue NTFS.
  73. - ntfscluster - Locate the files which use the given sectors or clusters.
  74. - ntfscmp - Compare two NTFS filesystems and tell the differences.
  75. - ntfscp - Copy a file to an NTFS volume.
  76. - ntfssecaudit - Display ownership and permissions, check consistency
  77. - ntfsfix - Check and fix some common errors, clear the LogFile.
  78. - ntfsinfo - Show information about NTFS or one of the files or directories within it.
  79. - ntfslabel - Show, or set, an NTFS filesystem's volume label.
  80. - ntfsls - List information about files in a directory residing on an NTFS.
  81. - ntfsresize - Resize NTFS without losing data.
  82. - ntfsundelete - Recover deleted files from NTFS.
  83. - ntfsusermap - Define mapping of Windows accounts to Linux logins
  84. endef
  85. define Package/ntfs-3g-utils
  86. $(call Package/ntfs-3g/common)
  87. TITLE:=ntfs-3g utilities
  88. DEPENDS+= +ntfs-3g +libgcrypt +libuuid
  89. endef
  90. CONFIGURE_ARGS += \
  91. --enable-shared \
  92. --enable-static \
  93. --with-uuid
  94. # configure/make according selection
  95. ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
  96. CONFIGURE_ARGS += --with-fuse=external
  97. TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
  98. else
  99. CONFIGURE_ARGS += --with-fuse=internal
  100. TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
  101. endif
  102. # enable ntfsprogs and extras
  103. ifneq ($(CONFIG_PACKAGE_ntfs-3g-utils)$(SDK)$(DEVELOPER),)
  104. CONFIGURE_ARGS += --enable-ntfsprogs --enable-extras
  105. else
  106. CONFIGURE_ARGS += --disable-ntfsprogs --disable-extras
  107. endif
  108. # redefine prepare to extract to our build dir
  109. # apply patches
  110. define Build/Prepare
  111. rm -rf $(PKG_BUILD_DIR)/
  112. mkdir -p $(PKG_BUILD_DIR)/
  113. $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
  114. $(Build/Patch)
  115. endef
  116. define Build/InstallDev
  117. $(INSTALL_DIR) $(1)/usr/include
  118. $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
  119. $(INSTALL_DIR) $(1)/usr/lib
  120. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
  121. endef
  122. define Package/ntfs-3g/install
  123. $(INSTALL_DIR) $(1)/usr/bin
  124. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
  125. $(INSTALL_DIR) $(1)/usr/lib
  126. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
  127. $(INSTALL_DIR) $(1)/sbin
  128. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
  129. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/mount.ntfs
  130. endef
  131. define Package/ntfs-3g/postinst
  132. #!/bin/sh
  133. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  134. ID="ntfs-3g"
  135. if ! [ -f '/etc/filesystems' ]; then
  136. echo "Create '$$FILE'."
  137. touch "$$FILE"
  138. fi
  139. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  140. echo "Add '$$ID' to known filesystems."
  141. echo "$$ID" >> "$$FILE"
  142. fi
  143. endef
  144. define Package/ntfs-3g-low/install
  145. $(INSTALL_DIR) $(1)/usr/bin
  146. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
  147. $(INSTALL_DIR) $(1)/sbin
  148. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
  149. endef
  150. define Package/ntfs-3g-low/postinst
  151. #!/bin/sh
  152. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  153. ID="lowntfs-3g"
  154. if ! [ -f '/etc/filesystems' ]; then
  155. echo "Create '$$FILE'."
  156. touch "$$FILE"
  157. fi
  158. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  159. echo "Add '$$ID' to known filesystems."
  160. echo "$$ID" >> "$$FILE"
  161. fi
  162. endef
  163. define Package/ntfs-3g-utils/install
  164. $(INSTALL_DIR) $(1)/sbin
  165. $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
  166. $(INSTALL_DIR) $(1)/usr/bin
  167. $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
  168. $(INSTALL_DIR) $(1)/usr/sbin
  169. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  170. endef
  171. $(eval $(call BuildPackage,ntfs-3g))
  172. $(eval $(call BuildPackage,ntfs-3g-low))
  173. $(eval $(call BuildPackage,ntfs-3g-utils))