havaged: moved to github
[packages.git] / utils / ntfs-3g / Makefile
1 #
2 # Copyright (C) 2007-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ntfs-3g
11 PKG_RELEASE:=1
12
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
17
18 PKG_FIXUP:=autoreconf
19 PKG_INSTALL:=1
20
21 # release contains fuseext/int hint
22 PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
23
24 # define build dir, respect fuseext/int
25 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/ntfs-3g/common
30   SECTION:=utils
31   CATEGORY:=Utilities
32   URL:=http://www.tuxera.com
33   SUBMENU:=Filesystem
34   TITLE:=Stable Read/Write NTFS Driver
35   MAINTAINER:=Bud <wrt_buddhay@gmx.net>
36 endef
37
38 define Package/ntfs-3g
39   $(call Package/ntfs-3g/common)
40   DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
41 endef
42
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.
49
50   Contains:
51    - ntfs-3g
52    - ntfs-3g.probe
53    - mount.ntfs-3g (symlink to ntfs-3g)
54
55 endef
56
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
61         ---help---
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
65         of space.
66
67 endef
68
69 define Package/ntfs-3g-low
70   $(call Package/ntfs-3g/common)
71   TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
72   DEPENDS+= +ntfs-3g
73 endef
74
75 define Package/ntfs-3g-low/description
76   Contains:
77    - lowntfs-3g
78    - mount.lowntfs-3g (symlink to lowntfs-3g)
79
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/
83
84 endef
85
86 define Package/ntfs-3g-utils
87   $(call Package/ntfs-3g/common)
88   TITLE:=ntfs-3g utilities (ntfs-3g.secaudit, ntfs-3g.usermap)
89   DEPENDS+= +ntfs-3g
90 endef
91
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.
95
96   Currently:
97    - ntfs-3g.secaudit
98    - ntfs-3g.usermap
99
100 endef
101
102 # TODO: write a proper description
103 # new in 2001.4.12
104 define Package/ntfsprogs_ntfs-3g
105   $(call Package/ntfs-3g/common)
106   TITLE:=ntfsprogs (ntfs-3g)
107   DEPENDS+= +ntfs-3g +libgcrypt +libuuid
108 endef
109
110 CONFIGURE_ARGS += \
111         --enable-shared \
112         --enable-static \
113         --with-uuid
114
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)
119 else
120         CONFIGURE_ARGS += --with-fuse=internal
121         TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
122 endif
123
124 # enable disable ntfsprogs
125 ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
126         CONFIGURE_ARGS += --enable-ntfsprogs
127 else
128         CONFIGURE_ARGS += --disable-ntfsprogs
129 endif
130
131 # redefine prepare to extract to our build dir
132 # apply patches
133 define Build/Prepare
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
137         $(Build/Patch)
138 endef
139
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/
145 endef
146
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/
154 endef
155
156 define Package/ntfs-3g/postinst
157 #!/bin/sh
158 FILE="$${IPKG_INSTROOT}/etc/filesystems"
159 ID="ntfs-3g"
160
161 if ! [ -f '/etc/filesystems' ]; then
162         echo "Create '$$FILE'."
163         touch "$$FILE"
164 fi
165
166 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
167         echo "Add '$$ID' to known filesystems."
168         echo "$$ID" >> "$$FILE"
169 fi
170
171 endef
172
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/
178 endef
179
180 define Package/ntfs-3g-low/postinst
181 #!/bin/sh
182 FILE="$${IPKG_INSTROOT}/etc/filesystems"
183 ID="lowntfs-3g"
184
185 if ! [ -f '/etc/filesystems' ]; then
186         echo "Create '$$FILE'."
187         touch "$$FILE"
188 fi
189
190 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
191         echo "Add '$$ID' to known filesystems."
192         echo "$$ID" >> "$$FILE"
193 fi
194
195 endef
196
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/ \;
200 endef
201
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/
209 endef
210
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))