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