2 # Copyright (C) 2007-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
13 PKG_VERSION:=2016.2.22
14 PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
16 PKG_MD5SUM:=ccbe8672d0f757bd0c975b50aa4c512e
18 PKG_LICENSE:=GPL-2.0 LGPL-2.0
19 PKG_LICENSE_FILES:=COPYING COPYING.LIB
21 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
26 # release contains fuseext/int hint
27 PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
29 # define build dir, respect fuseext/int
30 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
32 include $(INCLUDE_DIR)/package.mk
34 define Package/ntfs-3g/common
37 URL:=http://www.tuxera.com
39 TITLE:=Stable Read/Write NTFS Driver
42 define Package/ntfs-3g
43 $(call Package/ntfs-3g/common)
44 DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
47 define Package/ntfs-3g/description
48 Ntfs-3g is a NTFS driver, which can create, remove, rename,
49 move files, directories, hard links, and streams. It can read
50 and write files, including streams and sparse files. It can
51 handle special files like symbolic links, devices, and FIFOs.
52 Moreover it can also read transparently compressed files.
57 - mount.ntfs-3g (symlink to ntfs-3g)
61 define Package/ntfs-3g/config
62 config PACKAGE_NTFS-3G_USE_LIBFUSE
63 bool "use external FUSE library, selects package libfuse"
64 depends on PACKAGE_ntfs-3g
66 Ntfs-3g by default uses a minimalized lite version of FUSE.
67 If libfuse is part of your filesystem anyway (because of sshfs, owfs
68 etc.) it makes sense to activate this option and save some kilobytes
73 define Package/ntfs-3g-low
74 $(call Package/ntfs-3g/common)
75 TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
79 define Package/ntfs-3g-low/description
82 - mount.lowntfs-3g (symlink to lowntfs-3g)
84 A driver variant using the fuse low-level interface missing some of the
85 enhanced functionality for streams or the like. You might want to check:
86 http://www.tuxera.com/community/ntfs-3g-manual/
90 define Package/ntfs-3g-utils
91 $(call Package/ntfs-3g/common)
92 TITLE:=ntfs-3g utilities (extra)
96 define Package/ntfs-3g-utils/description
97 Additional ntfs-3g utilities. Not included by default for size
105 define Package/ntfsprogs_ntfs-3g/description
106 Suite of NTFS utilities for doing neat things with NTFS.
108 - mkntfs - Create an NTFS filesystem.
109 - ntfscat - Dump a file's content to the standard output.
110 - ntfsclone - Efficiently clone, backup, restore or rescue NTFS.
111 - ntfscluster - Locate the files which use the given sectors or clusters.
112 - ntfscmp - Compare two NTFS filesystems and tell the differences.
113 - ntfscp - Copy a file to an NTFS volume.
114 - ntfsfix - Check and fix some common errors, clear the LogFile.
115 - ntfsinfo - Show information about NTFS or one of the files or directories within it.
116 - ntfslabel - Show, or set, an NTFS filesystem's volume label.
117 - ntfsls - List information about files in a directory residing on an NTFS.
118 - ntfsresize - Resize NTFS without losing data.
119 - ntfsundelete - Recover deleted files from NTFS.
122 define Package/ntfsprogs_ntfs-3g
123 $(call Package/ntfs-3g/common)
124 TITLE:=ntfsprogs (ntfs-3g)
125 DEPENDS+= +ntfs-3g +libgcrypt +libuuid
133 # configure/make according selection
134 ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
135 CONFIGURE_ARGS += --with-fuse=external
136 TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
138 CONFIGURE_ARGS += --with-fuse=internal
139 TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
142 # enable disable ntfsprogs
143 ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
144 CONFIGURE_ARGS += --enable-ntfsprogs
146 CONFIGURE_ARGS += --disable-ntfsprogs
149 # redefine prepare to extract to our build dir
152 rm -rf $(PKG_BUILD_DIR)/
153 mkdir -p $(PKG_BUILD_DIR)/
154 $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
158 define Build/InstallDev
159 $(INSTALL_DIR) $(1)/usr/include
160 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
161 $(INSTALL_DIR) $(1)/usr/lib
162 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
165 define Package/ntfs-3g/install
166 $(INSTALL_DIR) $(1)/usr/bin
167 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
168 $(INSTALL_DIR) $(1)/usr/lib
169 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
170 $(INSTALL_DIR) $(1)/sbin
171 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
172 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/mount.ntfs
175 define Package/ntfs-3g/postinst
177 FILE="$${IPKG_INSTROOT}/etc/filesystems"
180 if ! [ -f '/etc/filesystems' ]; then
181 echo "Create '$$FILE'."
185 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
186 echo "Add '$$ID' to known filesystems."
187 echo "$$ID" >> "$$FILE"
192 define Package/ntfs-3g-low/install
193 $(INSTALL_DIR) $(1)/usr/bin
194 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
195 $(INSTALL_DIR) $(1)/sbin
196 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
199 define Package/ntfs-3g-low/postinst
201 FILE="$${IPKG_INSTROOT}/etc/filesystems"
204 if ! [ -f '/etc/filesystems' ]; then
205 echo "Create '$$FILE'."
209 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
210 echo "Add '$$ID' to known filesystems."
211 echo "$$ID" >> "$$FILE"
216 define Package/ntfs-3g-utils/install
217 $(INSTALL_DIR) $(1)/usr/bin
218 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.secaudit $(1)/usr/bin
219 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g.usermap $(1)/usr/bin
222 define Package/ntfsprogs_ntfs-3g/install
223 $(INSTALL_DIR) $(1)/sbin
224 $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
225 $(INSTALL_DIR) $(1)/usr/bin
226 $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
227 $(INSTALL_DIR) $(1)/usr/sbin
228 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
231 $(eval $(call BuildPackage,ntfs-3g))
232 $(eval $(call BuildPackage,ntfs-3g-low))
233 $(eval $(call BuildPackage,ntfs-3g-utils))
234 $(eval $(call BuildPackage,ntfsprogs_ntfs-3g))