SUMMARY="Find treasure and escape back to save the Goon Docks from demolition"
DESCRIPTION="The action takes place in the sleepy seaside town of Cauldron \
Point - down in an area known as the Goon Docks. The Goonies are a group of \
local kids - Mikey, Brand, Mouth, Chunk and Data. One day they find an old \
treasure map in Mikey's attic.
Data figures that this must be the fabulous hidden treasure of the \
notorious local pirate, One-Eyed Willy.
The girls, Andy and Stef, join the other Goonies and the adventure begins. But \
the secret underground tunnels they are exploring are actually the hideout of \
the Fratelli Gang, and the Goonies are soon trapped! The Goonies have a \
powerful ally on their side, however, in the form of the huge and amiable Sloth.

When you play this game, you are Sloth! Can you help the Goonies find the \
treasure and escape back to save the Goon Docks from demolition?"
HOMEPAGE="http://www2.braingames.getput.com/goonies/"
COPYRIGHT="2006-2009 Brain Games"
LICENSE="GNU GPL v2"
REVISION="4"
SOURCE_URI="http://braingames.jorito.net/goonies/downloads/goonies.src_1.4.1528.tgz"
CHECKSUM_SHA256="09e4a022ea4c31fe0f01393ba82ffaf44dbfbf0edcc2da9f569d9fe061382ce6"
PATCHES="goonies-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	goonies$secondaryArchSuffix = $portVersion
	app:Goonies
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libGLU$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libSDL_image_1.2$secondaryArchSuffix
	lib:libSDL_mixer_1.2$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libGL$secondaryArchSuffix
	devel:libGLU$secondaryArchSuffix
	devel:libSDL$secondaryArchSuffix
	devel:libSDL_image$secondaryArchSuffix
	devel:libSDL_mixer$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	make $jobArgs
}

INSTALL()
{

	make install PREFIX=$appsDir/Goonies GAMEDIR=$appsDir/Goonies

	rm $appsDir/Goonies/goonies
	mv $appsDir/Goonies/share/games/goonies/* $appsDir/Goonies
	mv $appsDir/Goonies/goonies $appsDir/Goonies/Goonies
	rm -rf $appsDir/Goonies/share

	addAppDeskbarSymlink $appsDir/Goonies/Goonies
}
