SUMMARY="A free DTS Coherent Acoustics decoder"
DESCRIPTION="libdca is a free library for decoding DTS Coherent Acoustics \
streams. The code is written by Gildas Bazin and was based on the a52dec \
project."
HOMEPAGE="https://www.videolan.org/developers/libdca.html"
COPYRIGHT="2004 Gildas Bazin
	2000-2003 Michel Lespinasse
	1999-2000 Aaron Holtzman"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://download.videolan.org/pub/videolan/libdca/$portVersion/libdca-$portVersion.tar.bz2"
CHECKSUM_SHA256="3a0b13815f582c661d2388ffcabc2f1ea82f471783c400f765f2ec6c81065f6a"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libdca$secondaryArchSuffix = $portVersion
	lib:libdca$secondaryArchSuffix = 0.0.0 compat >= 0
	"
if [ -z "$secondaryArchSuffix" ]; then
	PROVIDES="$PROVIDES
		cmd:dcadec
		cmd:dtsdec
		cmd:extract_dca
		cmd:extract_dts
		"
fi
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libdca_devel = $portVersion
	devel:libdca$secondaryArchSuffix
	devel:libdts$secondaryArchSuffix
	"
REQUIRES_devel="
	libdca$secondaryArchSuffix == $portVersion base
	"

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

BUILD()
{
	./bootstrap
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm -f $libDir/libdca.a $libDir/libdca.la

	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $binDir $documentationDir
	fi

	prepareInstalledDevelLibs libdca libdts
	fixPkgconfig

	packageEntries devel $developDir
}

TEST()
{
	make check
}
