SUMMARY="A graphical rogue-like adventure game"
DESCRIPTION="S.C.O.U.R.G.E. is a roguelike game with a 3D user interface. \
The game allows a group of four characters to search for treasure, kill \
enemies, gain levels, etc. The code is C++ using SDL, OpenGL and freetype. \
The game uses Squirrel for scripting."
HOMEPAGE="http://sourceforge.net/projects/scourge/"
COPYRIGHT="2003-2008 The Scourge Team"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="http://sourceforge.net/projects/scourge/files/scourge/$portVersion/scourge-$portVersion.src.tar.gz"
CHECKSUM_SHA256="e5d3dc784bc117a3fe2f4449c74cb896310760ae5a82a50f8c1045705416cef3"
SOURCE_DIR="scourge"
PATCHES="scourge-$portVersion.patchset"

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

PROVIDES="
	scourge$secondaryArchSuffix = $portVersion
	app:scourge
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libGLU$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libSDL_image_1.2$secondaryArchSuffix
	lib:libSDL_mixer_1.2$secondaryArchSuffix
	lib:libSDL_net_1.2$secondaryArchSuffix
	lib:libSDL_ttf_2.0$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libfreetype$secondaryArchSuffix
	devel:libGL$secondaryArchSuffix
	devel:libGLU$secondaryArchSuffix
	devel:libintl$secondaryArchSuffix
	devel:libSDL$secondaryArchSuffix
	devel:libSDL_image$secondaryArchSuffix
	devel:libSDL_mixer$secondaryArchSuffix
	devel:libSDL_net$secondaryArchSuffix
	devel:libSDL_ttf$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:awk
	cmd:bison
	cmd:find
	cmd:g++$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -vfi
	runConfigure --omit-dirs "bindir" ./configure --bindir=$appsDir \
		--with-data-dir="`finddir B_SYSTEM_DATA_DIRECTORY`/scourge"
	make $jobArgs
}

INSTALL()
{
	make install
	addAppDeskbarSymlink $appsDir/scourge "S.C.O.U.R.G.E."
}
