6ad0752d433b69193608a043404520b7e6a373f3
[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:=4
12
13 PKG_VERSION:=2010.5.22
14
15 ## 2010.3.6 needs a recent uclibc 0.9.30.2 or greater
16 ## this has been fixed in 2010.5.16, keeping this in case this happens again
17 #PKG_UCLIBC_VERSION:=$(call qstrip,$(CONFIG_UCLIBC_VERSION))
18 #ifneq (,$(or $(findstring !0.9.29,!$(PKG_UCLIBC_VERSION)),$(findstring !0.9.30.1!,!$(PKG_UCLIBC_VERSION)!) ))
19 # PKG_VERSION:=2010.1.16
20 #endif
21
22 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
23 PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
24
25 PKG_MD5SUM_2010.1.16:=e104c914e8d7d29ee83e63d46afbba25
26 PKG_MD5SUM_2010.3.6:=12ce21aa044c6068a4df6e8cbd3c5cfa
27 PKG_MD5SUM_2010.5.16:=aeff7659a4943c9223d79116f051a863
28 PKG_MD5SUM_2010.5.22:=caa08c73220a7106c76f697b7a7915ec
29 PKG_MD5SUM:=$(PKG_MD5SUM_$(PKG_VERSION))
30
31 PKG_FIXUP:=libtool
32 PKG_INSTALL:=1
33
34 # release contains fuseext/int hint
35 PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
36
37 # define build dir, respect fuseext/int
38 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
39
40 include $(INCLUDE_DIR)/package.mk
41
42 define Package/ntfs-3g/common
43 SECTION:=utils
44 CATEGORY:=Utilities
45 URL:=http://www.tuxera.com
46 SUBMENU:=Filesystem
47 TITLE:=Stable Read/Write NTFS Driver
48 MAINTAINER:=Bud <wrt_buddhay@gmx.net>
49 endef
50
51 define Package/ntfs-3g
52 $(call Package/ntfs-3g/common)
53 DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
54 endef
55
56 define Package/ntfs-3g/description
57 Ntfs-3g is a NTFS driver, which can create, remove, rename,
58 move files, directories, hard links, and streams. It can read
59 and write files, including streams and sparse files. It can
60 handle special files like symbolic links, devices, and FIFOs.
61 Moreover it can also read transparently compressed files.
62
63 Contains:
64 - ntfs-3g
65 - ntfs-3g.probe
66
67 endef
68
69 define Package/ntfs-3g/config
70 config PACKAGE_NTFS-3G_USE_LIBFUSE
71 bool "use external FUSE library, selects package libfuse"
72 depends on PACKAGE_ntfs-3g
73 ---help---
74 Ntfs-3g by default uses a minimalized lite version of FUSE.
75 If libfuse is part of your filesystem anyway (because of sshfs, owfs
76 etc.) it makes sense to activate this option and save some kilobytes
77 of space.
78
79 endef
80
81 define Package/ntfs-3g-utils
82 $(call Package/ntfs-3g/common)
83 TITLE:=ntfs-3g utilities (ntfs-3g.secaudit, ntfs-3g.usermap)
84 DEPENDS+= +ntfs-3g
85 endef
86
87 define Package/ntfs-3g-utils/description
88 Additional ntfs-3g utilities. Not included by default for size
89 considerations. All binaries except ntfs-3g, ntfs-3g.probe.
90
91 Currently:
92 - ntfs-3g.secaudit
93 - ntfs-3g.usermap
94
95 endef
96
97 define Package/mount.ntfs-3g
98 $(call Package/ntfs-3g/common)
99 TITLE:=ntfs-3g mount helper
100 DEPENDS+= +ntfs-3g
101 endef
102
103 define Package/mount.ntfs-3g/description
104 ntfs-3g mount helper. You must enable busybox mount helper too.
105 endef
106
107 CONFIGURE_ARGS += \
108 --enable-shared \
109 --enable-static
110
111 # configure/make according selection
112 ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
113 CONFIGURE_ARGS += --with-fuse=external
114 TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
115 else
116 CONFIGURE_ARGS += --with-fuse=internal
117 TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
118 endif
119
120 # redefine prepare to extract to our build dir
121 define Build/Prepare
122 rm -rf $(PKG_BUILD_DIR)/
123 mkdir -p $(PKG_BUILD_DIR)/
124 $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
125 endef
126
127 define Build/InstallDev
128 $(INSTALL_DIR) $(1)/usr/include
129 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
130 $(INSTALL_DIR) $(1)/usr/lib
131 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
132 endef
133
134 define Package/ntfs-3g/install
135 $(INSTALL_DIR) $(1)/usr/bin
136 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
137 $(INSTALL_DIR) $(1)/usr/lib
138 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
139 endef
140
141 define Package/mount.ntfs-3g/install
142 $(INSTALL_DIR) $(1)/sbin
143 $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
144 endef
145
146 define Package/mount.ntfs-3g/postinst
147 #!/bin/sh
148
149 if [ -z "$$(grep ^\\ntfs-3g: $${IPKG_INSTROOT}/etc/filesystems)" ]; then
150 echo "ntfs-3g" >> $${IPKG_INSTROOT}/etc/filesystems
151 fi
152
153 endef
154
155 define Package/ntfs-3g-utils/install
156 $(INSTALL_DIR) $(1)/usr/bin
157 $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -name ntfs-3g.probe ! -name ntfs-3g -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
158 endef
159
160 $(eval $(call BuildPackage,ntfs-3g))
161 $(eval $(call BuildPackage,ntfs-3g-utils))
162 $(eval $(call BuildPackage,mount.ntfs-3g))
163