SUMMARY="A role playing game battling roboters"
DESCRIPTION="
The game tells the story of a world destroyed by a conflict between robots and\
their human masters. Play as Tux in a quest to save the world from the \
murderous rebel bots who know no mercy. You get to choose which path you wish \
to follow, and freedom of choice is everywhere in the game. \
\
FreedroidRPG features a real time combat system with melee and ranged weapons, \
fairly similar to the proprietary game Diablo. There is an innovative system of\
programs that can be run in order to take control of enemy robots, alter their \
behavior, or improve one's characteristics. You can use over 50 different kinds\
of items and fight countless enemies on your way to your destiny. An advanced \
dialog system provides story background and immersive role playing situations.\
\
The game is complete, fully playable, and can provide about 10 hours of fun. \
It is still being actively developed, and help is welcome in many areas. People\
having - or trying to acquire - programming, map editing, or writing skills \
will find FreedroidRPG to be an exciting, fast-moving project in which they can\
fully express their creativity."
HOMEPAGE="http://freedroid.org"
SRC_URI="http://sourceforge.net/projects/freedroid/files/freedroidRPG/freedroidRPG-0.15/freedroidRPG-0.15.1.tar.gz/download"
CHECKSUM_MD5="b95ea6abae46bea6ee3ace9a1902f682"
LICENSE="GNU GPL v2"
COPYRIGHT="2002-2010 The Freedroid team"
REVISION="1"

ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86 x86_64"

PROVIDES="
	freedroidrpg$secondaryArchSuffix = $portVersion
	app:freedroidrpg$secondaryArchSuffix = $portVersion
	cmd:pngtoico$secondaryArchSuffix = $portVersion
	cmd:croppy$secondaryArchSuffix = $portVersion
	cmd:explode_atlas$secondaryArchSuffix = $portVersion
	cmd:explodefont$secondaryArchSuffix = $portVersion
	cmd:gluefont$secondaryArchSuffix = $portVersion
	cmd:make_atlas$secondaryArchSuffix = $portVersion
"
REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	freedroidrpg_data == $portVersion
	lib:libsdl$secondaryArchSuffix
	#lib:libsdl_mixer$secondaryArchSuffix
	lib:libsdl_image$secondaryArchSuffix
	lib:libsdl_gfx$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	lib:libogg$secondaryArchSuffix
	lib:libvorbis$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libpng$secondaryArchSuffix
	lib:libglu$secondaryArchSuffix
	lib:libgl$secondaryArchSuffix
"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	devel:libsdl$secondaryArchSuffix
	#devel:libsdl_mixer$secondaryArchSuffix
	devel:libsdl_image$secondaryArchSuffix
	devel:libsdl_gfx$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	devel:libogg$secondaryArchSuffix
	devel:libvorbis$secondaryArchSuffix
	devel:libjpeg$secondaryArchSuffix
	devel:libpng$secondaryArchSuffix
	devel:libglu$secondaryArchSuffix
	devel:libgl$secondaryArchSuffix
"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:libtoolize
	cmd:autoconf
	cmd:automake
	cmd:pkg_config
	cmd:python
"
SOURCE_DIR="freedroidrpg-0.15.1"

PATCHES="
	configure.ac.patch
	configure.2.ac.patch
"
PATCH()
{
	sed -i 's/lua.h/..\/lua\/lua.h/g' src/*.c
	sed -i 's/lua.h/..\/lua\/lua.h/g' src/*.h
	sed -i 's/lauxlib.h/..\/lua\/lauxlib.h/g' src/*.c
	sed -i 's/lauxlib.h/..\/lua\/lauxlib.h/g' src/*.h
	sed -i 's/lualib.h/..\/lua\/lualib.h/g' src/*.c
	sed -i 's/lualib.h/..\/lua\/lualib.h/g' src/*.h
}
BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	automake
	./configure --disable-sdltest --with-embedded-lua --libdir=$libDir --includedir=$includeDir \
		--bindir=$binDir --datadir=$dataDir --mandir=$manDir
	make
}
INSTALL()
{
	make install
	
	mkdir -p $appsDir
	
	mv $binDir/freedroidRPG $appsDir
	
	packageEntries data $dataDir
	addAppDeskbarSymlink $appsDir/freedroidRPG "FreedroidRPG"
}
PROVIDES_data="
	freedroidrpg_data = $portVersion
"
REQUIRES_data="
	haiku >= $haikuVersion
"
SUMMARY_data="FreedroidRPG data files"
ARCHITECTURES_data="any"
