SUMMARY="A fun breakout-style arcade game"
DESCRIPTION="The successor to LBreakout offers you a new challenge in more \
than 50 levels with loads of new bonuses (goldshower, joker, explosive balls, \
bonus magnet), maluses (chaos, darkness, weak balls, malus magnet) \
and special bricks (growing bricks, explosive bricks, regenerative bricks).
If you are hungry for more you can create your own levelsets with the \
integrated level editor.
There is also an experimental two player mode (via LAN) available.

Additional, user-created levels and themes are available as separate packages."
HOMEPAGE="http://lgames.sourceforge.net/"
COPYRIGHT="2001-2015 Michael Speck"
LICENSE="GNU GPL v2"
REVISION="6"
SOURCE_URI="https://sourceforge.net/projects/lgames/files/lbreakout2/2.6/lbreakout2-$portVersion.tar.gz"
CHECKSUM_SHA256="9104d6175553da3442dc6a5fc407a669e2f5aff3eedc5d30409eb003b7a78d6f"
PATCHES="lbreakout2-$portVersion.patchset"
ADDITIONAL_FILES="lbreakout2.rdef"

ARCHITECTURES="all ?x86"

PROVIDES="
	lbreakout2 = $portVersion
	cmd:lbreakout2 = $portVersion
	cmd:lbreakout2server = $portVersion
	"
REQUIRES="
	haiku
	lib:libiconv
	lib:libintl
	lib:libpng16
	lib:libSDL_1.2
	lib:libSDL_mixer_1.2
	lib:libSDL_net_1.2
	lib:libz
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libiconv
	devel:libintl
	devel:libpng16
	devel:libSDL
	devel:libSDL_mixer
	devel:libSDL_net
	devel:libz
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:awk
	cmd:gcc
	cmd:ld
	cmd:make
	"

BUILD()
{
	autoreconf -vfi
	LDFLAGS="-lintl -lnetwork" \
		runConfigure ./configure --with-docdir=$documentationDir
	make $jobArgs
}

INSTALL()
{
	make install

	addResourcesToBinaries $portDir/additional-files/lbreakout2.rdef \
		$binDir/lbreakout2

	rm -rf $localStateDir
	rm -rf $dataDir/{applications,icons}

	addAppDeskbarSymlink $binDir/lbreakout2 LBreakout2
}
