[packages] flashrom: update source url, use PKG_INSTALL & MAKE_FLAGS, refresh patches
[openwrt/svn-archive/archive.git] / utils / ntfs-3g / Makefile
1 #
2 # Copyright (C) 2007-2010 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 # 2011.4.12 integrates ntfsprogs and changed srcfile name
14 PKG_VERSION:=2011.4.12
15 # disable next line and do _not_ select ntfsprogs_ntfs-3g to build an older version
16 PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
17
18 ## 2010.3.6 needs a recent uclibc 0.9.30.2 or greater
19 ## this has been fixed in 2010.5.16, keeping this in case this happens again
20 #PKG_UCLIBC_VERSION:=$(call qstrip,$(CONFIG_UCLIBC_VERSION))
21 #ifneq (,$(or $(findstring !0.9.29,!$(PKG_UCLIBC_VERSION)),$(findstring !0.9.30.1!,!$(PKG_UCLIBC_VERSION)!) ))
22 # PKG_VERSION:=2010.1.16
23 #endif
24
25 PATCH_DIR:=./patches-$(PKG_VERSION)
26
27 PKG_SOURCE?=$(PKG_NAME)-$(PKG_VERSION).tgz
28 PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
29
30 PKG_MD5SUM_2010.1.16:=e104c914e8d7d29ee83e63d46afbba25
31 PKG_MD5SUM_2010.3.6:=12ce21aa044c6068a4df6e8cbd3c5cfa
32 PKG_MD5SUM_2010.5.16:=aeff7659a4943c9223d79116f051a863
33 PKG_MD5SUM_2010.5.22:=caa08c73220a7106c76f697b7a7915ec
34 PKG_MD5SUM_2010.8.8:=6c109746c2708f679725a2ea441c61c6
35 PKG_MD5SUM_2010.10.2:=91405690f25822142cdcb43d03e62d3f
36 PKG_MD5SUM_2011.1.15:=15a5cf5752012269fa168c24191f00e2
37 PKG_MD5SUM_2011.4.12:=9c4ce318373b15332239a77a9d2a39fe
38 PKG_MD5SUM:=$(PKG_MD5SUM_$(PKG_VERSION))
39
40 PKG_FIXUP:=libtool
41 PKG_INSTALL:=1
42
43 # release contains fuseext/int hint
44 PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
45
46 # define build dir, respect fuseext/int
47 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
48
49 include $(INCLUDE_DIR)/package.mk
50
51 define Package/ntfs-3g/common
52 SECTION:=utils
53 CATEGORY:=Utilities
54 URL:=http://www.tuxera.com
55 SUBMENU:=Filesystem
56 TITLE:=Stable Read/Write NTFS Driver
57 MAINTAINER:=Bud <wrt_buddhay@gmx.net>
58 endef
59
60 define Package/ntfs-3g
61 $(call Package/ntfs-3g/common)
62 DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
63 endef
64
65 define Package/ntfs-3g/description
66 Ntfs-3g is a NTFS driver, which can create, remove, rename,
67 move files, directories, hard links, and streams. It can read
68 and write files, including streams and sparse files. It can
69 handle special files like symbolic links, devices, and FIFOs.
70 Moreover it can also read transparently compressed files.
71
72 Contains:
73 - ntfs-3g
74 - ntfs-3g.probe
75 - mount.ntfs-3g (symlink to ntfs-3g)
76
77 endef
78
79 define Package/ntfs-3g/config
80 config PACKAGE_NTFS-3G_USE_LIBFUSE
81 bool "use external FUSE library, selects package libfuse"
82 depends on PACKAGE_ntfs-3g
83 ---help---
84 Ntfs-3g by default uses a minimalized lite version of FUSE.
85 If libfuse is part of your filesystem anyway (because of sshfs, owfs
86 etc.) it makes sense to activate this option and save some kilobytes
87 of space.
88
89 endef
90
91 define Package/ntfs-3g-low
92 $(call Package/ntfs-3g/common)
93 TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
94 DEPENDS+= +ntfs-3g
95 endef
96
97 define Package/ntfs-3g-low/description
98 Contains:
99 - lowntfs-3g
100 - mount.lowntfs-3g (symlink to lowntfs-3g)
101
102 A driver variant using the fuse low-level interface missing some of the
103 enhanced functionality for streams or the like. You might want to check:
104 http://www.tuxera.com/community/ntfs-3g-manual/
105
106 endef
107
108 define Package/ntfs-3g-utils
109 $(call Package/ntfs-3g/common)
110 TITLE:=ntfs-3g utilities (ntfs-3g.secaudit, ntfs-3g.usermap)
111 DEPENDS+= +ntfs-3g
112 endef
113
114 define Package/ntfs-3g-utils/description
115 Additional ntfs-3g utilities. Not included by default for size
116 considerations. All binaries except ntfs-3g, ntfs-3g.probe.
117
118 Currently:
119 - ntfs-3g.secaudit
120 - ntfs-3g.usermap
121
122 endef
123
124 # TODO: write a proper description
125 # new in 2001.4.12
126 define Package/ntfsprogs_ntfs-3g
127 $(call Package/ntfs-3g/common)
128 TITLE:=ntfsprogs (ntfs-3g)
129 DEPENDS+= +ntfs-3g +libgcrypt
130 endef
131
132 CONFIGURE_ARGS += \
133 --enable-shared \
134 --enable-static
135
136 # configure/make according selection
137 ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
138 CONFIGURE_ARGS += --with-fuse=external
139 TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
140 else
141 CONFIGURE_ARGS += --with-fuse=internal
142 TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
143 endif
144
145 # enable disable ntfsprogs
146 ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
147 CONFIGURE_ARGS += --enable-ntfsprogs
148 else
149 CONFIGURE_ARGS += --disable-ntfsprogs
150 endif
151
152 # redefine prepare to extract to our build dir
153 # apply patches
154 define Build/Prepare
155 rm -rf $(PKG_BUILD_DIR)/
156 mkdir -p $(PKG_BUILD_DIR)/
157 $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
158 $(Build/Patch)
159 endef
160
161 define Build/InstallDev
162 $(INSTALL_DIR) $(1)/usr/include
163 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
164 $(INSTALL_DIR) $(1)/usr/lib
165 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
166 endef
167
168 define Package/ntfs-3g/install
169 $(INSTALL_DIR) $(1)/usr/bin
170 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
171 $(INSTALL_DIR) $(1)/usr/lib
172 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
173 $(INSTALL_DIR) $(1)/sbin
174 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
175 endef
176
177 define Package/ntfs-3g/postinst
178 #!/bin/sh
179 FILE="$${IPKG_INSTROOT}/etc/filesystems"
180 ID="ntfs-3g"
181
182 if ! [ -f '/etc/filesystems' ]; then
183 echo "Create '$$FILE'."
184 touch "$$FILE"
185 fi
186
187 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
188 echo "Add '$$ID' to known filesystems."
189 echo "$$ID" >> "$$FILE"
190 fi
191
192 endef
193
194 define Package/ntfs-3g-low/install
195 $(INSTALL_DIR) $(1)/usr/bin
196 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
197 $(INSTALL_DIR) $(1)/sbin
198 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
199 endef
200
201 define Package/ntfs-3g-low/postinst
202 #!/bin/sh
203 FILE="$${IPKG_INSTROOT}/etc/filesystems"
204 ID="lowntfs-3g"
205
206 if ! [ -f '/etc/filesystems' ]; then
207 echo "Create '$$FILE'."
208 touch "$$FILE"
209 fi
210
211 if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
212 echo "Add '$$ID' to known filesystems."
213 echo "$$ID" >> "$$FILE"
214 fi
215
216 endef
217
218 define Package/ntfs-3g-utils/install
219 $(INSTALL_DIR) $(1)/usr/bin
220 $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -name ntfs-3g.probe ! -name ntfs-3g -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
221 endef
222
223 define Package/ntfsprogs_ntfs-3g/install
224 $(INSTALL_DIR) $(1)/sbin
225 $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
226 $(INSTALL_DIR) $(1)/usr/bin
227 $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
228 $(INSTALL_DIR) $(1)/usr/sbin
229 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
230 endef
231
232 $(eval $(call BuildPackage,ntfs-3g))
233 $(eval $(call BuildPackage,ntfs-3g-low))
234 $(eval $(call BuildPackage,ntfs-3g-utils))
235 $(eval $(call BuildPackage,ntfsprogs_ntfs-3g))