add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt/svn-archive/archive.git] / package / fuse / Makefile
1 #
2 # Copyright (C) 2006 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:=fuse
13 PKG_VERSION:=2.6.3
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
18 PKG_MD5SUM:=3f4f5d07d12dedc0a3fd23472171fe94
19 PKG_CAT:=zcat
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/fuse/Default
24 TITLE:=FUSE
25 DEPENDS:=@LINUX_2_6
26 DESCRIPTION:=\
27 FUSE (Filesystem in UserSpacE)
28 URL:=http://fuse.sourceforge.net/
29 endef
30
31 define Package/fuse-utils
32 $(call Package/fuse/Default)
33 SECTION:=utils
34 CATEGORY:=Utilities
35 DEPENDS:=+libfuse +kmod-fuse @LINUX_2_6
36 TITLE+= (utilities)
37 DESCRIPTION+=\\\
38 \\\
39 This package contains the FUSE utilities.
40 endef
41
42 define KernelPackage/fuse
43 SUBMENU:=Filesystems
44 $(call Package/fuse/Default)
45 DEPENDS:=@LINUX_2_6
46 TITLE+= (kernel module)
47 DESCRIPTION+=\\\
48 \\\
49 This package contains the FUSE kernel module.
50 FILES:=$(PKG_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.$(LINUX_KMOD_SUFFIX)
51 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
52 AUTOLOAD:=$(call AutoLoad,80,fuse)
53 endef
54
55 define Package/libfuse
56 $(call Package/fuse/Default)
57 SECTION:=libs
58 CATEGORY:=Libraries
59 DEPENDS:=@LINUX_2_6
60 TITLE+= (library)
61 DESCRIPTION+=\\\
62 \\\
63 This package contains the FUSE shared library, needed by other programs.
64 endef
65
66 CONFIGURE_ARGS += \
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 define Build/Configure
79 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
80 touch configure.in ; \
81 touch aclocal.m4 ; \
82 touch Makefile.in ; \
83 touch include/config.h.in ; \
84 touch configure ; \
85 )
86 $(call Build/Configure/Default)
87 endef
88
89 define Build/Compile
90 $(MAKE) -C $(PKG_BUILD_DIR) \
91 ARCH="$(LINUX_KARCH)" \
92 CROSS_COMPILE="$(TARGET_CROSS)" \
93 DESTDIR="$(PKG_INSTALL_DIR)" \
94 AM_CFLAGS="$(TARGET_CFLAGS) -DDISABLE_COMPAT=1" \
95 EXTRA_DIST="" \
96 all install
97 endef
98
99 define Build/InstallDev
100 mkdir -p $(STAGING_DIR)/usr/include
101 $(CP) $(PKG_INSTALL_DIR)/usr/include/fuse{,.h} $(STAGING_DIR)/usr/include/
102 mkdir -p $(STAGING_DIR)/usr/lib
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.{a,so*} $(STAGING_DIR)/usr/lib/
104 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(STAGING_DIR)/usr/lib/pkgconfig/
106 $(SED) 's,-I$$$${includedir}/fuse,,g' $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
107 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
108 endef
109
110 define Build/UninstallDev
111 rm -rf $(STAGING_DIR)/usr/include/fuse{,.h} \
112 $(STAGING_DIR)/usr/lib/libfuse.{a,so*} \
113 $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
114 endef
115
116 define Package/fuse-utils/install
117 $(INSTALL_DIR) $(1)/usr/bin
118 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fusermount $(1)/usr/bin/
119 endef
120
121 define Package/libfuse/install
122 $(INSTALL_DIR) $(1)/usr/lib
123 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.so.* $(1)/usr/lib/
124 endef
125
126 $(eval $(call BuildPackage,fuse-utils))
127 $(eval $(call BuildPackage,libfuse))
128 $(eval $(call KernelPackage,fuse))