ntfs-3g: Update to 2017.3.23 version, provide single utilites package, refresh patches
[feed/packages.git] / utils / ntfs-3g / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=ntfs-3g
9 PKG_RELEASE:=1
10
11 PKG_VERSION:=2017.3.23
12 PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
13 PKG_SOURCE_URL:=https://www.tuxera.com/opensource/
14 PKG_HASH:=3e5a021d7b761261836dcb305370af299793eedbded731df3d6943802e1262d5
15
16 PKG_LICENSE:=GPL-2.0 LGPL-2.0
17 PKG_LICENSE_FILES:=COPYING COPYING.LIB
18
19 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
20
21 PKG_FIXUP:=autoreconf
22 PKG_INSTALL:=1
23
24 # release contains fuseext/int hint
25 PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
26
27 # define build dir, respect fuseext/int
28 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/ntfs-3g/common
33 SECTION:=utils
34 CATEGORY:=Utilities
35 URL:=http://www.tuxera.com
36 SUBMENU:=Filesystem
37 TITLE:=Stable Read/Write NTFS Driver
38 endef
39
40 define Package/ntfs-3g
41 $(call Package/ntfs-3g/common)
42 DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
43 endef
44
45 define Package/ntfs-3g/description
46 Ntfs-3g is a NTFS driver, which can create, remove, rename,
47 move files, directories, hard links, and streams. It can read
48 and write files, including streams and sparse files. It can
49 handle special files like symbolic links, devices, and FIFOs.
50 Moreover it can also read transparently compressed files.
51
52 Contains:
53 - ntfs-3g
54 - ntfs-3g.probe
55 - mount.ntfs-3g (symlink to ntfs-3g)
56
57 endef
58
59 define Package/ntfs-3g/config
60 config PACKAGE_NTFS-3G_USE_LIBFUSE
61 bool "use external FUSE library, selects package libfuse"
62 depends on PACKAGE_ntfs-3g
63 ---help---
64 Ntfs-3g by default uses a minimalized lite version of FUSE.
65 If libfuse is part of your filesystem anyway (because of sshfs, owfs
66 etc.) it makes sense to activate this option and save some kilobytes
67 of space.
68
69 endef
70
71 define Package/ntfs-3g-low
72 $(call Package/ntfs-3g/common)
73 TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
74 DEPENDS+= +ntfs-3g
75 endef
76
77 define Package/ntfs-3g-low/description
78 Contains:
79 - lowntfs-3g
80 - mount.lowntfs-3g (symlink to lowntfs-3g)
81
82 A driver variant using the fuse low-level interface missing some of the
83 enhanced functionality for streams or the like. You might want to check:
84 http://www.tuxera.com/community/ntfs-3g-manual/
85
86 endef
87
88
89 define Package/ntfs-3g-utils/description
90 Suite of NTFS utilities for doing neat things with NTFS.
91 Contains:
92 - mkntfs - Create an NTFS filesystem.
93 - ntfscat - Dump a file's content to the standard output.
94 - ntfsclone - Efficiently clone, backup, restore or rescue NTFS.
95 - ntfscluster - Locate the files which use the given sectors or clusters.
96 - ntfscmp - Compare two NTFS filesystems and tell the differences.
97 - ntfscp - Copy a file to an NTFS volume.
98 - ntfssecaudit - Display ownership and permissions, check consistency
99 - ntfsfix - Check and fix some common errors, clear the LogFile.
100 - ntfsinfo - Show information about NTFS or one of the files or directories within it.
101 - ntfslabel - Show, or set, an NTFS filesystem's volume label.
102 - ntfsls - List information about files in a directory residing on an NTFS.
103 - ntfsresize - Resize NTFS without losing data.
104 - ntfsundelete - Recover deleted files from NTFS.
105 - ntfsusermap - Define mapping of Windows accounts to Linux logins
106 endef
107
108 define Package/ntfs-3g-utils
109 $(call Package/ntfs-3g/common)
110 TITLE:=ntfs-3g utilities
111 DEPENDS+= +ntfs-3g +libgcrypt +libuuid
112 endef
113
114 CONFIGURE_ARGS += \
115 --enable-shared \
116 --enable-static \
117 --with-uuid
118
119 # configure/make according selection
120 ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
121 CONFIGURE_ARGS += --with-fuse=external
122 TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
123 else
124 CONFIGURE_ARGS += --with-fuse=internal
125 TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
126 endif
127
128 # enable ntfsprogs and extras
129 ifneq ($(CONFIG_PACKAGE_ntfs-3g-utils)$(SDK)$(DEVELOPER),)
130 CONFIGURE_ARGS += --enable-ntfsprogs --enable-extras
131 else
132 CONFIGURE_ARGS += --disable-ntfsprogs --disable-extras
133 endif
134
135 # redefine prepare to extract to our build dir
136 # apply patches
137 define Build/Prepare
138 rm -rf $(PKG_BUILD_DIR)/
139 mkdir -p $(PKG_BUILD_DIR)/
140 $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
141 $(Build/Patch)
142 endef
143
144 define Build/InstallDev
145 $(INSTALL_DIR) $(1)/usr/include
146 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
147 $(INSTALL_DIR) $(1)/usr/lib
148 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
149 endef
150
151 define Package/ntfs-3g/install
152 $(INSTALL_DIR) $(1)/usr/bin
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
154 $(INSTALL_DIR) $(1)/usr/lib
155 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
156 $(INSTALL_DIR) $(1)/sbin
157 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
158 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/mount.ntfs
159 endef
160
161 define Package/ntfs-3g/postinst
162 #!/bin/sh
163 FILE="$${IPKG_INSTROOT}/etc/filesystems"
164 ID="ntfs-3g"
165
166 if ! [ -f '/etc/filesystems' ]; then
167 echo "Create '$$FILE'."
168 touch "$$FILE"
169 fi
170
171 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
172 echo "Add '$$ID' to known filesystems."
173 echo "$$ID" >> "$$FILE"
174 fi
175
176 endef
177
178 define Package/ntfs-3g-low/install
179 $(INSTALL_DIR) $(1)/usr/bin
180 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
181 $(INSTALL_DIR) $(1)/sbin
182 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
183 endef
184
185 define Package/ntfs-3g-low/postinst
186 #!/bin/sh
187 FILE="$${IPKG_INSTROOT}/etc/filesystems"
188 ID="lowntfs-3g"
189
190 if ! [ -f '/etc/filesystems' ]; then
191 echo "Create '$$FILE'."
192 touch "$$FILE"
193 fi
194
195 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
196 echo "Add '$$ID' to known filesystems."
197 echo "$$ID" >> "$$FILE"
198 fi
199
200 endef
201
202 define Package/ntfs-3g-utils/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/
209 endef
210
211 $(eval $(call BuildPackage,ntfs-3g))
212 $(eval $(call BuildPackage,ntfs-3g-low))
213 $(eval $(call BuildPackage,ntfs-3g-utils))