SUMMARY="A top down Formula One racing game"
DESCRIPTION="
Race against your opponents on 21 tracks. Features online high scores, \
realtime rain effect, split-screen multiplayer, and more!
"
HOMEPAGE="http://www2.braingames.getput.com/f1spirit/"
LICENSE="GNU GPL v2"
COPYRIGHT="2002-2008 Brain Games"
SOURCE_URI="http://braingames.jorito.net/f1spirit/f1spirit.src_0.rc9-1615.tgz"
CHECKSUM_SHA256="fc1778dcec68ccd31b9da893abee67e64a7931a34c75a63f8563355b810acbd7"
REVISION="1"
ARCHITECTURES="x86_gcc2"

PROVIDES="
	$portName = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libcurl$secondaryArchSuffix
	lib:libglu$secondaryArchSuffix
	lib:libsdl$secondaryArchSuffix
	lib:libSDL_image$secondaryArchSuffix
	lib:libSDL_mixer$secondaryArchSuffix
	lib:libSDL_net_1.2$secondaryArchSuffix
	lib:libssl$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	devel:libcurl$secondaryArchSuffix
	devel:libglu$secondaryArchSuffix
	devel:libsdl$secondaryArchSuffix
	devel:libSDL_image$secondaryArchSuffix
	devel:libSDL_mixer$secondaryArchSuffix
	devel:libSDL_net_1.2$secondaryArchSuffix
	lib:libSDL_net_1.2$secondaryArchSuffix
# Why is that required?
	devel:libssl$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	haiku_devel
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

PATCHES="$portName-$portVersion.patchset"
BUILD()
{
	make $jobArgs
}

INSTALL()
{
	installDir=$appsDir/"F-1 Spirit"
	mkdir -p "$installDir"
	make install PREFIX="$installDir" GAMEDIR="$installDir"

	cd "$installDir"
	echo -e "#!/bin/sh\ncd \"$installDir\"/share/games/f1spirit && ./f1spirit" > f1spirit

	addAppDeskbarSymlink "$installDir/$portName" "F-1 Spirit"
}
