SUMMARY="An OpenGL virtual pool game"
DESCRIPTION="Ballsmacker is a Free virtual pool game rendered in OpenGL. \
Currently British and American pool are supported; there are plans to \
support many different billiards games. At the moment the game can be played \
with two players taking turns on one computer; in the future networked \
multiplayer will be supported."
HOMEPAGE="http://ballsmacker.sourceforge.net/"
COPYRIGHT="2004 Simon Howard"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://downloads.sourceforge.net/ballsmacker/ballsmacker-$portVersion.tar.gz"
CHECKSUM_SHA256="5eae4bc75fb9248ebba43cde312e5f22f889f600da7def23307be75df3130a94"

ARCHITECTURES="?all"
SECONDARY_ARCHITECTURES="?x86"

# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	ballsmacker$secondaryArchSuffix = $portVersion
	cmd:ballsmacker$commandSuffix = $portVersion
	app:BallSmacker = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgl$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libglu$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	lib:libsdl$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgl$secondaryArchSuffix
	devel:libglib_2.0$secondaryArchSuffix
	devel:libglu$secondaryArchSuffix
	devel:libsdl$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -vfi
	runConfigure --omit-dirs bindir ./configure \
		--bindir=$commandBinDir
	make $jobArgs
}

INSTALL()
{
	make install

	mkdir -p "$appsDir"
	ln -rs "$commandBinDir"/ballsmacker "$appsDir"/BallSmacker

	addAppDeskbarSymlink "$commandBinDir"/ballsmacker BallSmacker
}
