SUMMARY="Fuse-filesystem utilizing the sftp service"
DESCRIPTION="A filesystem client based on the SSH File Transfer Protocol \

Mount with mount -t userlandfs -p sshfs .... You can pass arguments to the \
client FS by adding them to the argument of the -p option  after the client \
FS name (as one string, like: -p foofs arg1 arg2). To get debug output run \
the userlandfs server manually in a terminal before mounting \
(userlandfs_server sshfs). You'll also have to do that, if the client FS \
requires input like the password for sshfs.\

Usage:
echo password | /system/servers/userlandfs_server sshfs
mount -t userlandfs -o 'sshfs user@server:./ -o password_stdin' /mnt
"
HOMEPAGE="http://fuse.sourceforge.net/sshfs.html"
SOURCE_URI="http://cznic.dl.sourceforge.net/project/fuse/sshfs-fuse/$portVersion/sshfs-fuse-$portVersion.tar.gz"
CHECKSUM_SHA256="e9171452e5d0150b9c6a2158fd2e2dcefb5d5d03ba4d208949e00a3a46c6e63e"
COPYRIGHT="2004-2012 Miklos Seredi"
LICENSE="GNU GPL v2"
REVISION="1"

ARCHITECTURES="x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	sshfs_fuse = $portVersion
	"
REQUIRES="
	userland_fs
	lib:libglib_2.0$secondaryArchSuffix >= 0.38
	cmd:ssh
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:ssh
	userland_fs
	"
BUILD_REQUIRES="
	userland_fs
	devel:libglib_2.0$secondaryArchSuffix >= 0.38
	"

SOURCE_DIR="sshfs-fuse-$portVersion"

PATCHES="sshfs-$portVersion.patch"

BUILD()
{
	SSHFS_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -I/system/develop/headers/userlandfs/fuse -I/system/develop/headers/glib-2.0 -I/system/develop/lib/glib-2.0/include -D_FILE_OFFSET_BITS=64" \
	SSHFS_LIBS="-lposix_error_mapper -lnetwork -luserlandfs_fuse -lglib-2.0 -lgthread-2.0" runConfigure configure

	make $jobArgs
}

INSTALL()
{
	mkdir -p $prefix/add-ons/userlandfs
	cp sshfs $prefix/add-ons/userlandfs
}
