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