Makefile 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #
  2. # Copyright (C) 2007-2016 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:=2016.2.22
  11. PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
  12. PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
  13. PKG_MD5SUM:=ccbe8672d0f757bd0c975b50aa4c512e
  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. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/mount.ntfs
  142. endef
  143. define Package/ntfs-3g/postinst
  144. #!/bin/sh
  145. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  146. ID="ntfs-3g"
  147. if ! [ -f '/etc/filesystems' ]; then
  148. echo "Create '$$FILE'."
  149. touch "$$FILE"
  150. fi
  151. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  152. echo "Add '$$ID' to known filesystems."
  153. echo "$$ID" >> "$$FILE"
  154. fi
  155. endef
  156. define Package/ntfs-3g-low/install
  157. $(INSTALL_DIR) $(1)/usr/bin
  158. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
  159. $(INSTALL_DIR) $(1)/sbin
  160. $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
  161. endef
  162. define Package/ntfs-3g-low/postinst
  163. #!/bin/sh
  164. FILE="$${IPKG_INSTROOT}/etc/filesystems"
  165. ID="lowntfs-3g"
  166. if ! [ -f '/etc/filesystems' ]; then
  167. echo "Create '$$FILE'."
  168. touch "$$FILE"
  169. fi
  170. if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
  171. echo "Add '$$ID' to known filesystems."
  172. echo "$$ID" >> "$$FILE"
  173. fi
  174. endef
  175. define Package/ntfs-3g-utils/install
  176. $(INSTALL_DIR) $(1)/usr/bin
  177. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.secaudit $(1)/usr/bin
  178. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.usermap $(1)/usr/bin
  179. endef
  180. define Package/ntfsprogs_ntfs-3g/install
  181. $(INSTALL_DIR) $(1)/sbin
  182. $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
  183. $(INSTALL_DIR) $(1)/usr/bin
  184. $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
  185. $(INSTALL_DIR) $(1)/usr/sbin
  186. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
  187. endef
  188. $(eval $(call BuildPackage,ntfs-3g))
  189. $(eval $(call BuildPackage,ntfs-3g-low))
  190. $(eval $(call BuildPackage,ntfs-3g-utils))
  191. $(eval $(call BuildPackage,ntfsprogs_ntfs-3g))