2 # Copyright (C) 2007-2014 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:=2014.2.15
14 PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
16 PKG_MD5SUM:=f11d563816249d730a00498983485f3a
21 # release contains fuseext/int hint
22 PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
24 # define build dir, respect fuseext/int
25 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
27 include $(INCLUDE_DIR)/package.mk
29 define Package/ntfs-3g/common
32 URL:=http://www.tuxera.com
34 TITLE:=Stable Read/Write NTFS Driver
35 MAINTAINER:=Bud <wrt_buddhay@gmx.net>
38 define Package/ntfs-3g
39 $(call Package/ntfs-3g/common)
40 DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
43 define Package/ntfs-3g/description
44 Ntfs-3g is a NTFS driver, which can create, remove, rename,
45 move files, directories, hard links, and streams. It can read
46 and write files, including streams and sparse files. It can
47 handle special files like symbolic links, devices, and FIFOs.
48 Moreover it can also read transparently compressed files.
53 - mount.ntfs-3g (symlink to ntfs-3g)
57 define Package/ntfs-3g/config
58 config PACKAGE_NTFS-3G_USE_LIBFUSE
59 bool "use external FUSE library, selects package libfuse"
60 depends on PACKAGE_ntfs-3g
62 Ntfs-3g by default uses a minimalized lite version of FUSE.
63 If libfuse is part of your filesystem anyway (because of sshfs, owfs
64 etc.) it makes sense to activate this option and save some kilobytes
69 define Package/ntfs-3g-low
70 $(call Package/ntfs-3g/common)
71 TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
75 define Package/ntfs-3g-low/description
78 - mount.lowntfs-3g (symlink to lowntfs-3g)
80 A driver variant using the fuse low-level interface missing some of the
81 enhanced functionality for streams or the like. You might want to check:
82 http://www.tuxera.com/community/ntfs-3g-manual/
86 define Package/ntfs-3g-utils
87 $(call Package/ntfs-3g/common)
88 TITLE:=ntfs-3g utilities (ntfs-3g.secaudit, ntfs-3g.usermap)
92 define Package/ntfs-3g-utils/description
93 Additional ntfs-3g utilities. Not included by default for size
94 considerations. All binaries except ntfs-3g, ntfs-3g.probe.
102 # TODO: write a proper description
104 define Package/ntfsprogs_ntfs-3g
105 $(call Package/ntfs-3g/common)
106 TITLE:=ntfsprogs (ntfs-3g)
107 DEPENDS+= +ntfs-3g +libgcrypt +libuuid
115 # configure/make according selection
116 ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
117 CONFIGURE_ARGS += --with-fuse=external
118 TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
120 CONFIGURE_ARGS += --with-fuse=internal
121 TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
124 # enable disable ntfsprogs
125 ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
126 CONFIGURE_ARGS += --enable-ntfsprogs
128 CONFIGURE_ARGS += --disable-ntfsprogs
131 # redefine prepare to extract to our build dir
134 rm -rf $(PKG_BUILD_DIR)/
135 mkdir -p $(PKG_BUILD_DIR)/
136 $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
140 define Build/InstallDev
141 $(INSTALL_DIR) $(1)/usr/include
142 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
143 $(INSTALL_DIR) $(1)/usr/lib
144 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
147 define Package/ntfs-3g/install
148 $(INSTALL_DIR) $(1)/usr/bin
149 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
150 $(INSTALL_DIR) $(1)/usr/lib
151 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
152 $(INSTALL_DIR) $(1)/sbin
153 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
156 define Package/ntfs-3g/postinst
158 FILE="$${IPKG_INSTROOT}/etc/filesystems"
161 if ! [ -f '/etc/filesystems' ]; then
162 echo "Create '$$FILE'."
166 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
167 echo "Add '$$ID' to known filesystems."
168 echo "$$ID" >> "$$FILE"
173 define Package/ntfs-3g-low/install
174 $(INSTALL_DIR) $(1)/usr/bin
175 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
176 $(INSTALL_DIR) $(1)/sbin
177 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
180 define Package/ntfs-3g-low/postinst
182 FILE="$${IPKG_INSTROOT}/etc/filesystems"
185 if ! [ -f '/etc/filesystems' ]; then
186 echo "Create '$$FILE'."
190 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
191 echo "Add '$$ID' to known filesystems."
192 echo "$$ID" >> "$$FILE"
197 define Package/ntfs-3g-utils/install
198 $(INSTALL_DIR) $(1)/usr/bin
199 $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -name ntfs-3g.probe ! -name ntfs-3g -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
202 define Package/ntfsprogs_ntfs-3g/install
203 $(INSTALL_DIR) $(1)/sbin
204 $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
205 $(INSTALL_DIR) $(1)/usr/bin
206 $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
207 $(INSTALL_DIR) $(1)/usr/sbin
208 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
211 $(eval $(call BuildPackage,ntfs-3g))
212 $(eval $(call BuildPackage,ntfs-3g-low))
213 $(eval $(call BuildPackage,ntfs-3g-utils))
214 $(eval $(call BuildPackage,ntfsprogs_ntfs-3g))