Root/package/fuse/Makefile

1#
2# Copyright (C) 2006-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
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=fuse
12PKG_VERSION:=2.8.3
13PKG_RELEASE:=1
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16PKG_SOURCE_URL:=@SF/$(PKG_NAME)
17PKG_MD5SUM:=517c8384f915e40647bda9f71579fd97
18
19PKG_INSTALL:=1
20
21# Kernel 2.4 Module
22FUSE24_VERSION=2.5.3
23FUSE24_SOURCE:=$(PKG_NAME)-$(FUSE24_VERSION).tar.gz
24FUSE24_MD5SUM:=9c7e8b6606b9f158ae20b8521ba2867c
25FUSE24_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(FUSE24_VERSION)
26FUSE24_INSTALL_DIR:=$(FUSE24_BUILD_DIR)/ipkg-install
27FUSE24_PATCH_DIR:=./patches-kernel24
28
29include $(INCLUDE_DIR)/package.mk
30
31define Package/fuse/Default
32  TITLE:=FUSE
33  URL:=http://fuse.sourceforge.net/
34endef
35
36define Package/fuse/Default/description
37 FUSE (Filesystem in UserSpacE)
38endef
39
40define Package/fuse-utils
41$(call Package/fuse/Default)
42  SECTION:=utils
43  CATEGORY:=Utilities
44  DEPENDS:=+libfuse
45  TITLE+= (utilities)
46  SUBMENU:=Filesystem
47endef
48
49define Package/fuse-utils/description
50$(call Package/fuse/Default/description)
51 This package contains the FUSE utilities.
52 - fusermount
53 - ulockmgr_server
54endef
55
56define KernelPackage/fuse
57    $(call Package/fuse/Default)
58    SUBMENU:=Filesystems
59    TITLE+= (kernel module)
60    ifeq ($(KERNEL),2.4)
61        FILES:=$(FUSE24_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/kernel/fs/fuse/fuse.$(LINUX_KMOD_SUFFIX)
62        VERSION:=$(LINUX_VERSION)+$(FUSE24_VERSION)-$(PKG_RELEASE)
63    else
64        KCONFIG:= CONFIG_FUSE_FS
65        FILES:=$(LINUX_DIR)/fs/fuse/fuse.$(LINUX_KMOD_SUFFIX)
66        VERSION:=$(LINUX_VERSION)-$(LINUX_RELEASE)
67    endif
68    AUTOLOAD:=$(call AutoLoad,80,fuse)
69endef
70
71define KernelPackage/fuse/description
72$(call Package/fuse/Default/description)
73 This package contains the FUSE kernel module.
74endef
75
76define Package/libfuse
77$(call Package/fuse/Default)
78  SECTION:=libs
79  CATEGORY:=Libraries
80  TITLE+= (library)
81  DEPENDS:=kmod-fuse
82  SUBMENU:=Filesystem
83endef
84
85define Package/libfuse/description
86$(call Package/fuse/Default/description)
87 This package contains the FUSE shared libraries, needed by other programs.
88 - libfuse
89 - libulockmgr
90endef
91
92# generic args
93CONFIGURE_ARGS += \
94    --enable-shared \
95    --enable-static \
96    --disable-rpath \
97    --disable-example \
98    --disable-mtab
99
100# kmod 2.4 args
101FUSE24_CONFIGURE_ARGS := $(CONFIGURE_ARGS) \
102    --disable-lib --disable-util \
103    --enable-kernel-module --disable-auto-modprobe \
104    --with-kernel="$(LINUX_DIR)"
105
106# generic package uses lib & utils
107CONFIGURE_ARGS += --enable-lib --enable-util
108
109####### FUSE24 - START ######
110### if we're on kernel 2.4 build a kernel 2.4 compatible fuse module from older version, see also
111### http://sourceforge.net/apps/mediawiki/fuse/index.php?title=FAQ#What_version_of_FUSE_do_I_need_to_use_FUSE_with_Linux_2.4.3F
112ifeq ($(KERNEL),2.4)
113
114define Download/fuse24
115    FILE:=$(FUSE24_SOURCE)
116    URL:=$(PKG_SOURCE_URL)
117    MD5SUM:=$(FUSE24_MD5SUM)
118endef
119$(eval $(call Download,fuse24))
120
121define Build/Prepare/fuse24
122    rm -rf $(FUSE24_BUILD_DIR)/
123    mkdir -p $(FUSE24_BUILD_DIR)/
124    $(TAR) -xzf $(DL_DIR)/$(FUSE24_SOURCE) -C $(FUSE24_BUILD_DIR)/..
125endef
126
127define Build/Patch/fuse24
128    $(call PatchDir,$(FUSE24_BUILD_DIR),$(FUSE24_PATCH_DIR),)
129endef
130
131define Build/Configure/fuse24
132    (cd $(FUSE24_BUILD_DIR); \
133        rm -rf config.{cache,status} ; \
134        $(CONFIGURE_VARS) \
135        ./configure \
136            $(FUSE24_CONFIGURE_ARGS) \
137    );
138endef
139
140define Build/Compile/fuse24
141    $(MAKE) -C $(FUSE24_BUILD_DIR)/$(MAKE_PATH) \
142        ARCH="$(LINUX_KARCH)" \
143        CROSS_COMPILE="$(TARGET_CROSS)" \
144        all;
145endef
146
147define Build/Install/fuse24
148    rm -rf $(FUSE24_INSTALL_DIR)
149    mkdir -p $(FUSE24_INSTALL_DIR)
150    $(MAKE) -C $(FUSE24_BUILD_DIR) \
151        ARCH="$(LINUX_KARCH)" \
152        CROSS_COMPILE="$(TARGET_CROSS)" \
153        DESTDIR="$(FUSE24_INSTALL_DIR)" \
154        install
155endef
156
157define Build/Prepare
158    @echo "--> Build/Prepare enter"
159    $(call Build/Prepare/fuse24)
160    $(call Build/Patch/fuse24)
161    $(call Build/Prepare/Default)
162    @echo "--> Build/Prepare leave"
163endef
164
165define Build/Configure
166    @echo "--> Build/Configure enter"
167    $(call Build/Configure/fuse24)
168    $(call Build/Configure/Default)
169    @echo "--> Build/Configure leave"
170endef
171
172define Build/Compile
173    @echo "--> Build/Compile enter"
174    $(call Build/Compile/fuse24)
175    $(call Build/Compile/Default)
176    @echo "--> Build/Compile leave"
177endef
178
179define Build/Install
180    @echo "--> Build/Install enter"
181    $(call Build/Install/fuse24)
182    $(call Build/Install/Default)
183    @echo "--> Build/Install leave"
184endef
185
186endif
187####### FUSE24 - END ######
188
189define Build/InstallDev
190    @echo "--> Build/InstallDev enter"
191    mkdir -p $(1)/usr/include
192    $(CP) $(PKG_INSTALL_DIR)/usr/include/{fuse,*.h} $(1)/usr/include/
193    mkdir -p $(1)/usr/lib
194    $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*} $(1)/usr/lib/
195    mkdir -p $(1)/usr/lib/pkgconfig
196    $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fuse.pc $(1)/usr/lib/pkgconfig/
197    $(SED) 's,-I$$$${includedir}/fuse,,g' $(1)/usr/lib/pkgconfig/fuse.pc
198    $(SED) 's,-L$$$${libdir},,g' $(1)/usr/lib/pkgconfig/fuse.pc
199    @echo "--> Build/InstallDev leave"
200endef
201
202define Package/fuse-utils/install
203    @echo "--> Package/fuse-utils/install enter"
204    $(INSTALL_DIR) $(1)/usr/bin
205    # use cp and keep fusermount sticky bit
206    $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f -exec $(CP) -a {} $(1)/usr/bin/ \;
207    @echo "--> Package/fuse-utils/install leave"
208endef
209
210define Package/libfuse/install
211    @echo "--> Package/libfuse/install enter"
212    $(INSTALL_DIR) $(1)/usr/lib
213    $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/
214    @echo "--> Package/libfuse/install leave"
215endef
216
217define Package/kmod-fuse/install
218    @echo "--> Package/kmod-fuse/install enter/leave"
219endef
220
221$(eval $(call BuildPackage,fuse-utils))
222$(eval $(call BuildPackage,libfuse))
223$(eval $(call KernelPackage,fuse))
224

Archive Download this file



interactive