SUMMARY="An audio codec to connect Bluetooth audio devices"
DESCRIPTION="
SBC is an audio subband codec specified by the Bluetooth Special Interest Group
for the A2DP profile. SBC is a digital audio encoder and decoder used to
transfer date to Bluetooth audio output devcies likes headphones or
loudspeakers. It can be also used on the Internet. It was designed to obtain
a reasonably good audio quality at medium bit rates while keeping low
computational complexity, having Bluetooth bandwidth limitations and processing
power in mind.
"
HOMEPAGE="http://www.bluez.org"
COPYRIGHT="
	2004-2010 Marcel Holtmann
	2008-2010 Nokia Corporation
	2012-2013 Intel Corporation
	2007-2008 Frederic Dalleau
	"
LICENSE="GNU GPL v2
	GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="http://www.kernel.org/pub/linux/bluetooth/sbc-$portVersion.tar.gz"
CHECKSUM_SHA256="050058cfc5a2709d324868ddbb82f9b796ba6c4f5e00cb6a715b3841ee13dfe9"
PATCHES="sbc-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"

PROVIDES="
	sbc$secondaryArchSuffix = $portVersion compat >= 1
	lib:libsbc$secondaryArchSuffix = 1.2.2 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libsndfile$secondaryArchSuffix
	"

PROVIDES_devel="
	sbc${secondaryArchSuffix}_devel = $portVersion compat >= 1
	devel:libsbc$secondaryArchSuffix = 1.2.2 compat >= 1
	"
REQUIRES_devel="
	sbc$secondaryArchSuffix == $portVersion base
	"

SUMMARY_tools="The SBC tools"
PROVIDES_tools="
	sbc_tools$secondaryArchSuffix = $portVersion compat >= 1
	cmd:sbcdec = $portVersion compat >= 1
	cmd:sbcenc = $portVersion compat >= 1
	cmd:sbcinfo = $portVersion compat >= 1
	"
REQUIRES_tools="
	haiku$secondaryArchSuffix
	sbc$secondaryArchSuffix == $portVersion base
	"

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

BUILD()
{
	autoreconf -fi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/libsbc.a $libDir/libsbc.la

	prepareInstalledDevelLibs libsbc
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir

	# tools package
	packageEntries tools \
		$binDir
}
