Re-enable fuse for 2.4 kernels as well (#1346)
[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 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/fuse/Default
27 TITLE:=FUSE
28 DESCRIPTION:=\
29 FUSE (Filesystem in UserSpacE)
30 URL:=http://fuse.sourceforge.net/
31 endef
32
33 define Package/fuse-utils
34 $(call Package/fuse/Default)
35 SECTION:=utils
36 CATEGORY:=Utilities
37 DEPENDS:=+libfuse +kmod-fuse
38 TITLE+= (utilities)
39 DESCRIPTION+=\\\
40 \\\
41 This package contains the FUSE utilities.
42 endef
43
44 define KernelPackage/fuse
45 SUBMENU:=Filesystems
46 $(call Package/fuse/Default)
47 TITLE+= (kernel module)
48 DESCRIPTION+=\\\
49 \\\
50 This package contains the FUSE kernel module.
51 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
52 AUTOLOAD:=$(call AutoLoad,80,fuse)
53 endef
54
55 define KernelPackage/fuse/2.4
56 FILES:=$(PKG_BUILD_DIR)/lib/fuse.$(LINUX_KMOD_SUFFIX)
57 endef
58
59 define KernelPackage/fuse/2.6
60 FILES:=$(PKG_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.$(LINUX_KMOD_SUFFIX)
61 endef
62
63 define Package/libfuse
64 $(call Package/fuse/Default)
65 SECTION:=libs
66 CATEGORY:=Libraries
67 DEPENDS:=@LINUX_2_6
68 TITLE+= (library)
69 DESCRIPTION+=\\\
70 \\\
71 This package contains the FUSE shared library, needed by other programs.
72 endef
73
74 CONFIGURE_ARGS += \
75 --enable-shared \
76 --enable-static \
77 --disable-rpath \
78 --enable-kernel-module \
79 --enable-lib \
80 --enable-util \
81 --disable-example \
82 --disable-auto-modprobe \
83 --with-kernel="$(LINUX_DIR)" \
84 --disable-mtab
85
86 define Build/Configure
87 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
88 touch configure.in ; \
89 touch aclocal.m4 ; \
90 touch Makefile.in ; \
91 touch include/config.h.in ; \
92 touch configure ; \
93 )
94 $(call Build/Configure/Default)
95 endef
96
97 define Build/Compile
98 $(MAKE) -C $(PKG_BUILD_DIR) \
99 ARCH="$(LINUX_KARCH)" \
100 CROSS_COMPILE="$(TARGET_CROSS)" \
101 DESTDIR="$(PKG_INSTALL_DIR)" \
102 AM_CFLAGS="$(TARGET_CFLAGS) -DDISABLE_COMPAT=1" \
103 EXTRA_DIST="" \
104 all install
105 endef
106
107 define Build/InstallDev
108 mkdir -p $(STAGING_DIR)/usr/include
109 $(CP) $(PKG_INSTALL_DIR)/usr/include/fuse{,.h} $(STAGING_DIR)/usr/include/
110 mkdir -p $(STAGING_DIR)/usr/lib
111 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.{a,so*} $(STAGING_DIR)/usr/lib/
112 mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
113 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(STAGING_DIR)/usr/lib/pkgconfig/
114 $(SED) 's,-I$$$${includedir}/fuse,,g' $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
115 $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
116 endef
117
118 define Build/UninstallDev
119 rm -rf $(STAGING_DIR)/usr/include/fuse{,.h} \
120 $(STAGING_DIR)/usr/lib/libfuse.{a,so*} \
121 $(STAGING_DIR)/usr/lib/pkgconfig/fuse.pc
122 endef
123
124 define Package/fuse-utils/install
125 $(INSTALL_DIR) $(1)/usr/bin
126 $(CP) $(PKG_INSTALL_DIR)/usr/bin/fusermount $(1)/usr/bin/
127 endef
128
129 define Package/libfuse/install
130 $(INSTALL_DIR) $(1)/usr/lib
131 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfuse.so.* $(1)/usr/lib/
132 endef
133
134 $(eval $(call BuildPackage,fuse-utils))
135 $(eval $(call BuildPackage,libfuse))
136 $(eval $(call KernelPackage,fuse))