SUMMARY="Fast console MPEG Audio Player and decoder library"
DESCRIPTION="
mpg123 is the fast and Free console based real time MPEG Audio Player for \
Layer 1, 2 and 3.
"
HOMEPAGE="http://www.mpg123.org/" 
SOURCE_URI="http://sourceforge.net/projects/mpg123/files/mpg123/$portVersion/mpg123-$portVersion.tar.bz2"
CHECKSUM_SHA256="25244c07dcb1df0a94092d94126c4172918739fe0e78faaaf97cf0b0fcc1a800"
REVISION="1"
LICENSE="GNU LGPL v2.1"
COPYRIGHT="1995-2009 Michael Hipp and others"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86 x86_gcc2"

PATCHES="mpg123-$portVersion.patchset"

PROVIDES="
	mpg123$secondaryArchSuffix = $portVersion
	lib:libmpg123$secondaryArchSuffix = 0.41.0 compat >= 0
	cmd:mpg123$secondaryArchSuffix
	cmd:mpg123_id3dump$secondaryArchSuffix
	cmd:mpg123_strip$secondaryArchSuffix
	cmd:out123$secondaryArchSuffix
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libltdl$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:awk
	cmd:find
	cmd:autoconf
	cmd:libtool
	cmd:aclocal
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	sed -i "s,AM_CONFIG_HEADER,AC_CONFIG_HEADERS," configure.ac
	autoreconf -fi
	LDFLAGS="-lnetwork" runConfigure ./configure --disable-aligncheck
	make $jobArgs
}

INSTALL()
{
	make install
	prepareInstalledDevelLib libmpg123
	fixPkgconfig
	packageEntries devel $developDir
}

PROVIDES_devel="
	mpg123${secondaryArchSuffix}_devel = $portVersion
	devel:libmpg123$secondaryArchSuffix = 0.41.0 compat >= 0
	"

REQUIRES_devel="
	haiku$secondaryArchSuffix
	mpg123$secondaryArchSuffix == $portVersion base
	"
