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
5.7 KiB

  1. #
  2. # Copyright (C) 2007-2014 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:=2014.2.15
  11. PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
  12. PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
  13. PKG_MD5SUM:=f11d563816249d730a00498983485f3a
  14. PKG_LICENSE:=GPL-2.0 LGPL-2.0
  15. PKG_LICENSE_FILE:=COPYING COPYING.LIB
  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. MAINTAINER:=Bud <wrt_buddhay@gmx.net>
  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 (ntfs-3g.secaudit, ntfs-3g.usermap)
  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. All binaries except ntfs-3g, ntfs-3g.probe.
  77. Currently:
  78. - ntfs-3g.secaudit
  79. - ntfs-3g.usermap
  80. endef
  81. # TODO: write a proper description
  82. # new in 2001.4.12
  83. define Package/ntfsprogs_ntfs-3g
  84. $(call Package/ntfs-3g/common)
  85. TITLE:=ntfsprogs (ntfs-3g)
  86. DEPENDS+= +ntfs-3g +libgcrypt +libuuid
  87. endef
  88. CONFIGURE_ARGS += \
  89. --enable-shared \
  90. --enable-static \
  91. --with-uuid
  92. # configure/make according selection
  93. ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
  94. CONFIGURE_ARGS += --with-fuse=external
  95. TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
  96. else
  97. CONFIGURE_ARGS += --with-fuse=internal
  98. TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
  99. endif
  100. # enable disable ntfsprogs
  101. ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
  102. CONFIGURE_ARGS += --enable-ntfsprogs
  103. else
  104. CONFIGURE_ARGS += --disable-ntfsprogs
  105. endif
  106. # redefine prepare to extract to our build dir
  107. # apply patches
  108. define Build/Prepare
  109. rm -rf $(PKG_BUILD_DIR)/
  110. mkdir -p $(PKG_BUILD_DIR)/
  111. $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
  112. $(Build/Patch)
  113. endef
  114. define Build/InstallDev
  115. $(INSTALL_DIR) $(1)/usr/include
  116. $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
  117. $(INSTALL_DIR) $(1)/usr/lib
  118. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
  119. endef
  120. define Package/ntfs-3g/install
  121. $(INSTALL_DIR) $(1)/usr/bin
  122. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
  123. $(INSTALL_DIR) $(1)/usr/lib
  124. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
  125. $(INSTALL_DIR) $(1)/sbin
  126. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
  127. endef
  128. define Package/ntfs-3g/postinst
  129. #!/bin/sh
  130. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  131. ID="ntfs-3g"
  132. if ! [ -f '/etc/filesystems' ]; then
  133. echo "Create '$$FILE'."
  134. touch "$$FILE"
  135. fi
  136. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  137. echo "Add '$$ID' to known filesystems."
  138. echo "$$ID" >> "$$FILE"
  139. fi
  140. endef
  141. define Package/ntfs-3g-low/install
  142. $(INSTALL_DIR) $(1)/usr/bin
  143. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
  144. $(INSTALL_DIR) $(1)/sbin
  145. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
  146. endef
  147. define Package/ntfs-3g-low/postinst
  148. #!/bin/sh
  149. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  150. ID="lowntfs-3g"
  151. if ! [ -f '/etc/filesystems' ]; then
  152. echo "Create '$$FILE'."
  153. touch "$$FILE"
  154. fi
  155. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  156. echo "Add '$$ID' to known filesystems."
  157. echo "$$ID" >> "$$FILE"
  158. fi
  159. endef
  160. define Package/ntfs-3g-utils/install
  161. $(INSTALL_DIR) $(1)/usr/bin
  162. $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -name ntfs-3g.probe ! -name ntfs-3g -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
  163. endef
  164. define Package/ntfsprogs_ntfs-3g/install
  165. $(INSTALL_DIR) $(1)/sbin
  166. $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
  167. $(INSTALL_DIR) $(1)/usr/bin
  168. $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
  169. $(INSTALL_DIR) $(1)/usr/sbin
  170. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  171. endef
  172. $(eval $(call BuildPackage,ntfs-3g))
  173. $(eval $(call BuildPackage,ntfs-3g-low))
  174. $(eval $(call BuildPackage,ntfs-3g-utils))
  175. $(eval $(call BuildPackage,ntfsprogs_ntfs-3g))