SUMMARY="A native file sharing and chat application"
DESCRIPTION="BeShare is a BeOS/Haiku-native file sharing program. \
It operates similarly to other such programs (Napster, Hotline, etc) \
but with a few advantages:

- BeShare allows you to upload or download any type of file, not just mp3.
- When browsing files, you can see their attributes (similar Tracker's \
view)
- Your query is always \"live\", so if new files that match your query become \
available, you will see them added to the results list right away (you won't \
have to click \"refresh\" or anything first)
- BeShare includes a rudimentary chat mechanism for you social types.
- BeShare supports any number of simultaneous uploads and downloads \
in parallel, but will serialize simultaneous file requests to any \
given host for efficiency."
COPYRIGHT="1999-2012 Jeremy Friesner"
LICENSE="
	Public Domain
	libsanta
	"
HOMEPAGE="https://github.com/HaikuArchives/BeShare" 
SOURCE_URI="git+https://github.com/HaikuArchives/BeShare.git#b721fcc"
SOURCE_URI_2="https://public.msli.com/lcs/muscle/muscle6.11.zip"
REVISION="1"
CHECKSUM_SHA256_2="7cf3c92095f46e5a0858852e7d387d11fdf8e1e95a4de26b5e68e8319a373340"

ARCHITECTURES="x86 ?x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	beshare$secondaryArchSuffix = $portVersion
	app:BeShare = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libsanta$secondaryArchSuffix
	lib:libz
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsanta$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	#devel:muscle$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	makefile_engine
	"

PATCHES="beshare-$portVersion.patchset"

BUILD()
{
	ln -sf ../../sources-2/muscle muscle
	cd source
	make $jobArgs
	#LOCAL_INCLUDE_PATHS=$includeDir/muscle
}

INSTALL()
{
	mkdir -p $appsDir/BeShare
	cp -r app/* $appsDir/BeShare
	addAppDeskbarSymlink $appsDir/BeShare/BeShare
}
