SUMMARY="Mpeg Audio Decoder library"
DESCRIPTION="
MAD is a high-quality MPEG audio decoder. It currently supports MPEG-1 and the \
MPEG-2 extension to lower sampling frequencies, as well as the de facto MPEG \
2.5 format. All three audio layers -- Layer I, Layer II, and Layer III (i.e. \
MP3) -- are fully implemented.
"
HOMEPAGE="http://mad.sourceforge.net/" 
SRC_URI="ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz"
CHECKSUM_MD5="1be543bc30c56fb6bea1d7bf6a64e66c"
LICENSE="GNU GPL v2"
COPYRIGHT="2000-2004 Underbit Technologies, Inc."
REVISION="1"

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

PROVIDES="
	libmad$secondaryArchSuffix = $portVersion
	lib:libmad$secondaryArchSuffix = 0.2.1 compat >= 0
	"

REQUIRES="
	haiku$secondaryArchSuffix
	"
	
BUILD_REQUIRES="
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	"

BUILD()
{
	sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac
	libtoolize --force --copy --install
	aclocal
	sed -i 's/$optimize -fforce-mem/$optimize/g' configure.ac
	autoconf
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
	
	prepareInstalledDevelLibs libmad
	fixPkgconfig
	
	#devel Package
	packageEntries devel \
			$developDir
}

# ----- devel package ------------------------------------

PROVIDES_devel="
		libmad$secondaryArchSuffix_devel = $portVersion
		devel:libmad$secondaryArchSuffix = 0.2.1 compat >= 0
		"
REQUIRES_devel="
		libmad$secondaryArchSuffix == $portVersion
		"
