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.

233 lines
6.5 KiB

  1. #
  2. # Copyright (C) 2007-2015 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:=ntfs-3g
  9. PKG_RELEASE:=1
  10. PKG_VERSION:=2015.3.14
  11. PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
  12. PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
  13. PKG_MD5SUM:=8cd57768310e3b2be39b3191d808e241
  14. PKG_LICENSE:=GPL-2.0 LGPL-2.0
  15. PKG_LICENSE_FILES:=COPYING COPYING.LIB
  16. PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=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:=http://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. endef
  56. define Package/ntfs-3g-low
  57. $(call Package/ntfs-3g/common)
  58. TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
  59. DEPENDS+= +ntfs-3g
  60. endef
  61. define Package/ntfs-3g-low/description
  62. Contains:
  63. - lowntfs-3g
  64. - mount.lowntfs-3g (symlink to lowntfs-3g)
  65. A driver variant using the fuse low-level interface missing some of the
  66. enhanced functionality for streams or the like. You might want to check:
  67. http://www.tuxera.com/community/ntfs-3g-manual/
  68. endef
  69. define Package/ntfs-3g-utils
  70. $(call Package/ntfs-3g/common)
  71. TITLE:=ntfs-3g utilities (extra)
  72. DEPENDS+= +ntfs-3g
  73. endef
  74. define Package/ntfs-3g-utils/description
  75. Additional ntfs-3g utilities. Not included by default for size
  76. considerations.
  77. Currently:
  78. - ntfs-3g.secaudit
  79. - ntfs-3g.usermap
  80. endef
  81. define Package/ntfsprogs_ntfs-3g/description
  82. Suite of NTFS utilities for doing neat things with NTFS.
  83. Contains:
  84. - mkntfs - Create an NTFS filesystem.
  85. - ntfscat - Dump a file's content to the standard output.
  86. - ntfsclone - Efficiently clone, backup, restore or rescue NTFS.
  87. - ntfscluster - Locate the files which use the given sectors or clusters.
  88. - ntfscmp - Compare two NTFS filesystems and tell the differences.
  89. - ntfscp - Copy a file to an NTFS volume.
  90. - ntfsfix - Check and fix some common errors, clear the LogFile.
  91. - ntfsinfo - Show information about NTFS or one of the files or directories within it.
  92. - ntfslabel - Show, or set, an NTFS filesystem's volume label.
  93. - ntfsls - List information about files in a directory residing on an NTFS.
  94. - ntfsresize - Resize NTFS without losing data.
  95. - ntfsundelete - Recover deleted files from NTFS.
  96. endef
  97. define Package/ntfsprogs_ntfs-3g
  98. $(call Package/ntfs-3g/common)
  99. TITLE:=ntfsprogs (ntfs-3g)
  100. DEPENDS+= +ntfs-3g +libgcrypt +libuuid
  101. endef
  102. CONFIGURE_ARGS += \
  103. --enable-shared \
  104. --enable-static \
  105. --with-uuid
  106. # configure/make according selection
  107. ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
  108. CONFIGURE_ARGS += --with-fuse=external
  109. TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
  110. else
  111. CONFIGURE_ARGS += --with-fuse=internal
  112. TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
  113. endif
  114. # enable disable ntfsprogs
  115. ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
  116. CONFIGURE_ARGS += --enable-ntfsprogs
  117. else
  118. CONFIGURE_ARGS += --disable-ntfsprogs
  119. endif
  120. # redefine prepare to extract to our build dir
  121. # apply patches
  122. define Build/Prepare
  123. rm -rf $(PKG_BUILD_DIR)/
  124. mkdir -p $(PKG_BUILD_DIR)/
  125. $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
  126. $(Build/Patch)
  127. endef
  128. define Build/InstallDev
  129. $(INSTALL_DIR) $(1)/usr/include
  130. $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
  131. $(INSTALL_DIR) $(1)/usr/lib
  132. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
  133. endef
  134. define Package/ntfs-3g/install
  135. $(INSTALL_DIR) $(1)/usr/bin
  136. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
  137. $(INSTALL_DIR) $(1)/usr/lib
  138. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
  139. $(INSTALL_DIR) $(1)/sbin
  140. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
  141. endef
  142. define Package/ntfs-3g/postinst
  143. #!/bin/sh
  144. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  145. ID="ntfs-3g"
  146. if ! [ -f '/etc/filesystems' ]; then
  147. echo "Create '$$FILE'."
  148. touch "$$FILE"
  149. fi
  150. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  151. echo "Add '$$ID' to known filesystems."
  152. echo "$$ID" >> "$$FILE"
  153. fi
  154. endef
  155. define Package/ntfs-3g-low/install
  156. $(INSTALL_DIR) $(1)/usr/bin
  157. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
  158. $(INSTALL_DIR) $(1)/sbin
  159. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
  160. endef
  161. define Package/ntfs-3g-low/postinst
  162. #!/bin/sh
  163. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  164. ID="lowntfs-3g"
  165. if ! [ -f '/etc/filesystems' ]; then
  166. echo "Create '$$FILE'."
  167. touch "$$FILE"
  168. fi
  169. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  170. echo "Add '$$ID' to known filesystems."
  171. echo "$$ID" >> "$$FILE"
  172. fi
  173. endef
  174. define Package/ntfs-3g-utils/install
  175. $(INSTALL_DIR) $(1)/usr/bin
  176. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.secaudit $(1)/usr/bin
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.usermap $(1)/usr/bin
  178. endef
  179. define Package/ntfsprogs_ntfs-3g/install
  180. $(INSTALL_DIR) $(1)/sbin
  181. $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
  182. $(INSTALL_DIR) $(1)/usr/bin
  183. $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
  184. $(INSTALL_DIR) $(1)/usr/sbin
  185. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  186. endef
  187. $(eval $(call BuildPackage,ntfs-3g))
  188. $(eval $(call BuildPackage,ntfs-3g-low))
  189. $(eval $(call BuildPackage,ntfs-3g-utils))
  190. $(eval $(call BuildPackage,ntfsprogs_ntfs-3g))