SUMMARY="Allegro wrapper for the mpglib MP3 decoder"
DESCRIPTION="AllegroMP3 (or \"almp3\" for short) is a wrapper for the MP3 \
decoder in mpg123 that allows using it in Allegro. It uses an internal copy of \
mpg123 that is optimized for the x86 platform in SIMD assembly."
HOMEPAGE="http://icculus.org/~eviltypeguy/pkg/almp3/"
COPYRIGHT="2001-2005 Javier Gonzalez"
LICENSE="GNU LGPL v2.1"
REVISION="3"
SOURCE_URI="http://icculus.org/~eviltypeguy/pkg/almp3/almp3-$portVersion.tar.bz2"
CHECKSUM_SHA256="149af1a5ee06b5d7d5a52152db0e35ad6de8dfdd9d281fdac52728ef5d438d70"
SOURCE_DIR="almp3"
PATCHES="almp3-$portVersion.patchset"

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

PROVIDES="
	almp3$secondaryArchSuffix = $portVersion
	lib:libalmp3$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku${secondaryArchSuffix}
	lib:liballeg${secondaryArchSuffix} >= 4.4
	"

PROVIDES_devel="
	almp3${secondaryArchSuffix}_devel = $portVersion
	devel:libalmp3$secondaryArchSuffix = $portVersion
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:liballeg${secondaryArchSuffix} >= 4.4
	"
BUILD_PREREQUIRES="
	cmd:gcc${secondaryArchSuffix}
	cmd:install
	cmd:ld${secondaryArchSuffix}
	cmd:make
	"

BUILD()
{
	make $jobArgs TARGET=HAIKU_STATIC
	make $jobArgs TARGET=HAIKU_DYNAMIC
}

INSTALL()
{
	make install TARGET=HAIKU_STATIC \
		includedir="$includeDir" \
                docdir="$docDir" \
                libdir="$libDir" \
                INSTALL="install -c"
	make install TARGET=HAIKU_DYNAMIC \
		includedir="$includeDir" \
                docdir="$docDir" \
                libdir="$libDir" \
                INSTALL="install -c"

	prepareInstalledDevelLib libalmp3
	packageEntries devel \
		"$developDir"
}
