2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/kernel.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@SF
/$(PKG_NAME
)
17 PKG_MD5SUM
:=517c8384f915e40647bda9f71579fd97
23 FUSE24_SOURCE
:=$(PKG_NAME
)-$(FUSE24_VERSION
).
tar.gz
24 FUSE24_MD5SUM
:=9c7e8b6606b9f158ae20b8521ba2867c
25 FUSE24_BUILD_DIR
:=$(KERNEL_BUILD_DIR
)/$(PKG_NAME
)-$(FUSE24_VERSION
)
26 FUSE24_INSTALL_DIR
:=$(FUSE24_BUILD_DIR
)/ipkg-install
27 FUSE24_PATCH_DIR
:=.
/patches-kernel24
29 include $(INCLUDE_DIR
)/package.mk
31 define Package
/fuse
/Default
33 URL
:=http
://fuse.sourceforge.net
/
36 define Package
/fuse
/Default
/description
37 FUSE
(Filesystem in UserSpacE
)
40 define Package
/fuse-utils
41 $(call Package
/fuse
/Default
)
49 define Package
/fuse-utils
/description
50 $(call Package
/fuse
/Default
/description
)
51 This package contains the FUSE utilities.
56 define KernelPackage
/fuse
57 $(call Package
/fuse
/Default
)
59 TITLE
+= (kernel module
)
61 FILES
:=$(FUSE24_INSTALL_DIR
)/lib
/modules
/$(LINUX_VERSION
)/kernel
/fs
/fuse
/fuse.
$(LINUX_KMOD_SUFFIX
)
62 VERSION
:=$(LINUX_VERSION
)+$(FUSE24_VERSION
)-$(PKG_RELEASE
)
64 KCONFIG
:= CONFIG_FUSE_FS
65 FILES
:=$(LINUX_DIR
)/fs
/fuse
/fuse.
$(LINUX_KMOD_SUFFIX
)
66 VERSION
:=$(LINUX_VERSION
)-$(LINUX_RELEASE
)
68 AUTOLOAD
:=$(call AutoLoad
,80,fuse
)
71 define KernelPackage
/fuse
/description
72 $(call Package
/fuse
/Default
/description
)
73 This package contains the FUSE kernel module.
76 define Package
/libfuse
77 $(call Package
/fuse
/Default
)
85 define Package
/libfuse
/description
86 $(call Package
/fuse
/Default
/description
)
87 This package contains the FUSE shared libraries
, needed by other programs.
101 FUSE24_CONFIGURE_ARGS
:= $(CONFIGURE_ARGS
) \
102 --disable-lib
--disable-util \
103 --enable-kernel-module
--disable-auto-modprobe \
104 --with-kernel
="$(LINUX_DIR)"
106 # generic package uses lib & utils
107 CONFIGURE_ARGS
+= --enable-lib
--enable-util
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
114 define Download
/fuse24
115 FILE
:=$(FUSE24_SOURCE
)
116 URL
:=$(PKG_SOURCE_URL
)
117 MD5SUM
:=$(FUSE24_MD5SUM
)
119 $(eval
$(call Download
,fuse24
))
121 define 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
)/..
127 define Build
/Patch
/fuse24
128 $(call PatchDir
,$(FUSE24_BUILD_DIR
),$(FUSE24_PATCH_DIR
),)
131 define Build
/Configure
/fuse24
132 (cd
$(FUSE24_BUILD_DIR
); \
133 rm -rf config.
{cache
,status
} ; \
136 $(FUSE24_CONFIGURE_ARGS
) \
140 define Build
/Compile
/fuse24
141 $(MAKE
) -C
$(FUSE24_BUILD_DIR
)/$(MAKE_PATH
) \
142 ARCH
="$(LINUX_KARCH)" \
143 CROSS_COMPILE
="$(TARGET_CROSS)" \
147 define 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)" \
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"
165 define Build
/Configure
166 @echo
"--> Build/Configure enter"
167 $(call Build
/Configure
/fuse24
)
168 $(call Build
/Configure
/Default
)
169 @echo
"--> Build/Configure leave"
173 @echo
"--> Build/Compile enter"
174 $(call Build
/Compile
/fuse24
)
175 $(call Build
/Compile
/Default
)
176 @echo
"--> Build/Compile leave"
180 @echo
"--> Build/Install enter"
181 $(call Build
/Install
/fuse24
)
182 $(call Build
/Install
/Default
)
183 @echo
"--> Build/Install leave"
187 ####### FUSE24 - END ######
189 define 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"
202 define 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"
210 define 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"
217 define Package
/kmod-fuse
/install
218 @echo
"--> Package/kmod-fuse/install enter/leave"
221 $(eval
$(call BuildPackage
,fuse-utils
))
222 $(eval
$(call BuildPackage
,libfuse
))
223 $(eval
$(call KernelPackage
,fuse
))