add prereq check for pkg-config (required by ntfs-3g)
[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
20 PKG_BUILD_DEPENDS:=libfuse
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/ntfs-3g
25 TITLE:=NTFS-3G
26 DEPENDS:=+libfuse +fuse-utils
27 SECTION:=utils
28 CATEGORY:=Utilities
29 DESCRIPTION:=\
30 Third generation Read/Write NTFS driver
31 URL:=http://www.ntfs-3g.org
32 endef
33
34 define Build/Configure
35 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
36 touch configure.in ; \
37 touch aclocal.m4 ; \
38 touch Makefile.in ; \
39 touch include/config.h.in ; \
40 touch configure ; \
41 $(TARGET_CONFIGURE_OPTS) \
42 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
43 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
44 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
45 CFLAGS="$(TARGET_CFLAGS)" \
46 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
47 ./configure \
48 --target=$(GNU_TARGET_NAME) \
49 --host=$(GNU_TARGET_NAME) \
50 --build=$(GNU_HOST_NAME) \
51 --program-prefix="" \
52 --program-suffix="" \
53 --prefix=/usr \
54 --exec-prefix=/usr \
55 --bindir=/usr/bin \
56 --datadir=/usr/share \
57 --includedir=/usr/include \
58 --infodir=/usr/share/info \
59 --libdir=/usr/lib \
60 --libexecdir=/usr/lib \
61 --localstatedir=/var \
62 --mandir=/usr/share/man \
63 --sbindir=/usr/sbin \
64 --sysconfdir=/etc \
65 $(DISABLE_LARGEFILE) \
66 $(DISABLE_NLS) \
67 --enable-shared \
68 --enable-static \
69 --disable-rpath \
70 --enable-kernel-module \
71 --enable-lib \
72 --enable-util \
73 --disable-example \
74 --disable-auto-modprobe \
75 --with-kernel="$(LINUX_DIR)" \
76 --disable-mtab \
77 );
78 endef
79
80 define Build/Compile
81 $(MAKE) -C $(PKG_BUILD_DIR) \
82 ARCH="$(LINUX_KARCH)" \
83 CROSS_COMPILE="$(TARGET_CROSS)" \
84 DESTDIR="$(PKG_INSTALL_DIR)" \
85 all install
86 endef
87
88 define Build/InstallDev
89 mkdir -p $(STAGING_DIR)/usr/include
90 $(CP) $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(STAGING_DIR)/usr/include/
91 mkdir -p $(STAGING_DIR)/usr/lib
92 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{a,so*} $(STAGING_DIR)/usr/lib/
93 endef
94
95 define Build/UninstallDev
96 rm -rf $(STAGING_DIR)/usr/include/ntfs-3g \
97 $(STAGING_DIR)/usr/lib/libntfs-3g.{a,so*}
98 endef
99
100 define Package/ntfs-3g/install
101 $(INSTALL_DIR) $(1)/usr/bin
102 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g $(1)/usr/bin/
103 $(INSTALL_DIR) $(1)/usr/lib
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
105 endef
106
107 $(eval $(call BuildPackage,ntfs-3g))
108 $(eval $(call RequireCommand,pkg-config, \
109 $(PKG_NAME) requires pkg-config. \
110 ))