SUMMARY="Allegro game programming library"
DESCRIPTION="
Allegro game programming library.
"
HOMEPAGE="http://alleg.sourceforge.net/" 
SRC_URI="http://sourceforge.net/projects/alleg/files/allegro/4.4.1.1/allegro-4.4.1.1.tar.gz/download"
CHECKSUM_MD5="0f1cfff8f2cf88e5c91a667d9fd386ec"
LICENSE="Allegro"
COPYRIGHT="1998-2010 Shawn Hargreaves et al."

REVISION="1"

ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64"

PROVIDES="
	allegro$secondaryArchSuffix = $portVersion
	lib:liballeg$secondaryArchSuffix = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:libpng
	lib:libz
	lib:libogg
	lib:libvorbis
	"

BUILD_REQUIRES="
	devel:libpng$secondaryArchSuffix
	devel:libz
	devel:libogg
	devel:libvorbis
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:cmake
	cmd:make
	cmd:pkg_config
	"

PATCHES="allegro-4.4.1.1.patchset"

BUILD()
{
	cmake . -DCMAKE_INSTALL_PREFIX=$prefix -DDOCDIR=$docDir -DMANDIR=$manDir
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs liballeg libjpgalleg libloadpng liblogg

	packageEntries devel $developDir $binDir
}

PROVIDES_devel="
	allegro${secondaryArchSuffix}_devel = $portVersion compat >= 4.4
	devel:liballeg$secondaryArchSuffix = $portVersion compat >= 4.4
	cmd:allegro_config = $portVersion compat >= 4.4
	cmd:colormap = $portVersion compat >= 4.4
	cmd:dat = $portVersion compat >= 4.4
	cmd:dat2c = $portVersion compat >= 4.4
	cmd:dat2s = $portVersion compat >= 4.4
	cmd:exedat = $portVersion compat >= 4.4
	cmd:grabber = $portVersion compat >= 4.4
	cmd:pack = $portVersion compat >= 4.4
	cmd:pat2dat = $portVersion compat >= 4.4
	cmd:rgbmap = $portVersion compat >= 4.4
	cmd:textconv = $portVersion compat >= 4.4
	devel:libjpgalleg = $portVersion compat >= 4.4
	devel:liblogg = $portVersion compat >= 4.4
	devel:libloadpng = $portVersion compat >= 4.4
	"

REQUIRES_devel="
	haiku$secondaryArchSuffix >= $haikuVersion
	allegro$secondaryArchSuffix == $portVersion base
	"

