9bf4fb05b1f83a325e539223f9f74d6872e45cdd
[openwrt/svn-archive/archive.git] / utils / ntfs-3g / Makefile
1 #
2 # Copyright (C) 2007-2008 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_VERSION:=2009.4.4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=http://www.ntfs-3g.org/
16 PKG_MD5SUM:=e0b5c170f088a8d82968f0a6b34d31da
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/ntfs-3g/common
21 SECTION:=utils
22 CATEGORY:=Utilities
23 URL:=http://www.ntfs-3g.org
24 SUBMENU:=filesystem
25 TITLE:=Stable Read/Write NTFS Driver (build options)
26 endef
27
28 define Package/ntfs-3g/description
29 ntfs-3g is an NTFS driver, which can create, remove, rename,
30 move files, directories, hard links, and streams; it can read
31 and write files, including streams and sparse files; it can
32 handle special files like symbolic links, devices, and FIFOs;
33 moreover it can also read transparently compressed files.
34 endef
35
36 define Package/ntfs-3g
37 $(call Package/ntfs-3g/common)
38 DEPENDS+= +LINUX_2_4:kmod-fuse24 +libpthread +LINUX_2_6:kmod-fuse
39 MENU:=1
40 endef
41
42 define Package/externalFUSE
43 $(call Package/ntfs-3g/common)
44 TITLE:=use external FUSE library (package libfuse)
45 DEFAULT:=n
46 DEPENDS+=ntfs-3g +libfuse
47 endef
48
49 define Package/externalFUSE/description
50 Ntfs-3g by default uses a lite version of FUSE for the ease
51 of use and some special features. If you'd rather like to use
52 the systemwide standard FUSE library activate this option [M|*].
53 endef
54
55 CONFIGURE_ARGS += \
56 --enable-shared \
57 --enable-static \
58
59 # insert config with external libfuse
60 ifdef CONFIG_PACKAGE_externalFUSE
61 CONFIGURE_ARGS += --with-fuse=external \
62 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
63 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib"
64 PKG_RELEASE:=$(PKG_RELEASE)-fuseext
65 else
66 CONFIGURE_ARGS += --with-fuse=internal
67 PKG_RELEASE:=$(PKG_RELEASE)-fuseint
68 endif
69
70 CONFIGURE_VARS+= \
71 CFLAGS="$(TARGET_CFLAGS)" \
72 $(TARGET_CONFIGURE_OPTS) CPPFLAGS='' LDFLAGS=''
73
74
75 define Build/Configure
76 (cd $(PKG_BUILD_DIR) ; \
77 $(TARGET_CONFIGURE_OPTS) \
78 CFLAGS="$(TARGET_CFLAGS)" \
79 ./configure \
80 $(CONFIGURE_ARGS) \
81 )
82 endef
83
84 define Build/Compile
85 $(MAKE) -C $(PKG_BUILD_DIR) \
86 ARCH="$(LINUX_KARCH)" \
87 CROSS_COMPILE="$(TARGET_CROSS)" \
88 DESTDIR="$(PKG_INSTALL_DIR)" \
89 all install
90 endef
91
92 define Build/InstallDev
93 mkdir -p $(1)/usr/include
94 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
95 mkdir -p $(1)/usr/lib
96 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{a,so*} $(1)/usr/lib/
97 endef
98
99 define Package/ntfs-3g/install
100 $(INSTALL_DIR) $(1)/usr/bin
101 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g $(1)/usr/bin/
102 $(INSTALL_DIR) $(1)/usr/lib
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
104 endef
105
106 # order matters!!! else a probably missing fuse lib might not be build beforehand
107 $(eval $(call BuildPackage,externalFUSE))
108 $(eval $(call BuildPackage,ntfs-3g))
109