add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt/svn-archive/archive.git] / package / ntfs-3g / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=ntfs-3g
13 PKG_VERSION:=1.0
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
17 PKG_SOURCE_URL:=http://www.ntfs-3g.org/
18 PKG_MD5SUM:=873a8de662849d129fc7c475ad3f5447
19 PKG_CAT:=zcat
20
21 PKG_BUILD_DEPENDS:=libfuse
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/ntfs-3g
26 TITLE:=NTFS-3G
27 DEPENDS:=+libfuse +fuse-utils
28 SECTION:=utils
29 CATEGORY:=Utilities
30 DESCRIPTION:=\
31 Third generation Read/Write NTFS driver
32 URL:=http://www.ntfs-3g.org
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
37 touch configure.in ; \
38 touch aclocal.m4 ; \
39 touch Makefile.in ; \
40 touch include/config.h.in ; \
41 touch configure ; \
42 $(TARGET_CONFIGURE_OPTS) \
43 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
44 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
45 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
46 CFLAGS="$(TARGET_CFLAGS)" \
47 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
48 ./configure \
49 --target=$(GNU_TARGET_NAME) \
50 --host=$(GNU_TARGET_NAME) \
51 --build=$(GNU_HOST_NAME) \
52 --program-prefix="" \
53 --program-suffix="" \
54 --prefix=/usr \
55 --exec-prefix=/usr \
56 --bindir=/usr/bin \
57 --datadir=/usr/share \
58 --includedir=/usr/include \
59 --infodir=/usr/share/info \
60 --libdir=/usr/lib \
61 --libexecdir=/usr/lib \
62 --localstatedir=/var \
63 --mandir=/usr/share/man \
64 --sbindir=/usr/sbin \
65 --sysconfdir=/etc \
66 $(DISABLE_LARGEFILE) \
67 $(DISABLE_NLS) \
68 --enable-shared \
69 --enable-static \
70 --disable-rpath \
71 --enable-kernel-module \
72 --enable-lib \
73 --enable-util \
74 --disable-example \
75 --disable-auto-modprobe \
76 --with-kernel="$(LINUX_DIR)" \
77 --disable-mtab \
78 );
79 endef
80
81 define Build/Compile
82 $(MAKE) -C $(PKG_BUILD_DIR) \
83 ARCH="$(LINUX_KARCH)" \
84 CROSS_COMPILE="$(TARGET_CROSS)" \
85 DESTDIR="$(PKG_INSTALL_DIR)" \
86 all install
87 endef
88
89 define Build/InstallDev
90 mkdir -p $(STAGING_DIR)/usr/include
91 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(STAGING_DIR)/usr/include/
92 mkdir -p $(STAGING_DIR)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{a,so*} $(STAGING_DIR)/usr/lib/
94 endef
95
96 define Build/UninstallDev
97 rm -rf $(STAGING_DIR)/usr/include/ntfs-3g \
98 $(STAGING_DIR)/usr/lib/libntfs-3g.{a,so*}
99 endef
100
101 define Package/ntfs-3g/install
102 $(INSTALL_DIR) $(1)/usr/bin
103 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g $(1)/usr/bin/
104 $(INSTALL_DIR) $(1)/usr/lib
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
106 endef
107
108 $(eval $(call BuildPackage,ntfs-3g))