SUMMARY="TwoLAME MPEG Audio Layer 2 encoder" 
DESCRIPTION="
	TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on tooLAME \
	by Mike Cheng, which in turn is based upon the ISO dist10 code and \
	portions of LAME.
"
HOMEPAGE="http://www.twolame.org" 
SOURCE_URI="http://downloads.sourceforge.net/twolame/twolame-0.3.13.tar.gz"
LICENSE="GNU LGPL v2.1"
COPYRIGHT="2004-2006 The TwoLAME Project"
CHECKSUM_SHA256="98f332f48951f47f23f70fd0379463aff7d7fb26f07e1e24e42ddef22cc6112a"
REVISION="2"
ARCHITECTURES="x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PATCHES="twolame-$portVersion.patchset"

PROVIDES="
	twolame$secondaryArchSuffix = $portVersion compat >= 0
	cmd:twolame$secondaryArchSuffix
	lib:libtwolame$secondaryArchSuffix = 0.0.0 compat >= 0
"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libsndfile$secondaryArchSuffix
	lib:libFLAC$secondaryArchSuffix
	lib:libogg$secondaryArchSuffix
	lib:libvorbis$secondaryArchSuffix
"

BUILD_REQUIRES="
	devel:libsndfile$secondaryArchSuffix
	devel:libflac$secondaryArchSuffix
	devel:libogg$secondaryArchSuffix
	devel:libvorbis$secondaryArchSuffix
"

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

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	autoheader
	automake --add-missing
	runConfigure ./configure
	make $jobArgs
}

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

PROVIDES_devel="
	twolame${secondaryArchSuffix}_devel = $portVersion compat >= 0
	devel:libtwolame$secondaryArchSuffix = $portVersion compat >= 0
"

REQUIRES_devel="
	twolame$secondaryArchSuffix == $portVersion base
"
