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/"
COPYRIGHT="2002-2008 Brain Games"
LICENSE="GNU GPL v2"
REVISION="5"
SOURCE_URI="http://braingames.jorito.net/f1spirit/f1spirit.src_0.rc9-1615.tgz"
CHECKSUM_SHA256="bfde090fdd90546d1b46ed0dbf73cb8e6c8dab3f521c278c403542750dd1b02c"
PATCHES="$portName-$portVersion.patchset"

ARCHITECTURES="?all x86_gcc2"

PROVIDES="
	$portName = $portVersion
	"
REQUIRES="
	haiku
	lib:libcurl
	lib:libGLU
	lib:libnghttp2
	lib:libSDL_1.2
	lib:libSDL_image_1.2
	lib:libSDL_mixer_1.2
	lib:libSDL_net_1.2
	lib:libssl
	lib:libz
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libcurl
	devel:libGLU
	devel:libnghttp2
	devel:libSDL
	devel:libSDL_image
	devel:libSDL_mixer
	devel:libSDL_net
	devel:libssl
	devel:libz
	"
BUILD_PREREQUIRES="
	cmd:g++
	cmd:ld
	cmd:make
	"

BUILD()
{
	make $jobArgs
}

INSTALL()
{
	installDir=$appsDir/"F-1 Spirit"
	mkdir -p "$installDir"
	make install PREFIX="$installDir" GAMEDIR="$installDir"
	rm -rf "$installDir"/share/{applications,pixmaps}

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

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