SUMMARY="A ATSC A/52 decoding library used on streams in DVD's"
DESCRIPTION="
A library for decoding ATSC A/52 streams used in DVD's.
"
HOMEPAGE="http://liba52.sourceforge.net/"
SOURCE_URI="http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz"
CHECKSUM_SHA256="a21d724ab3b3933330194353687df82c475b5dfb997513eef4c25de6c865ec33"
REVISION="2"
LICENSE="GNU GPL v2"
COPYRIGHT="1999-2002 Aaron Holtzman & Michel Lespinasse"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PATCHES="a52dec-$portVersion.patch"

PROVIDES="
	a52dec$secondaryArchSuffix = $portVersion
	lib:liba52$secondaryArchSuffix = 0.0.0 compat >= 0
	"
if [ -z "$secondaryArchSuffix" ]; then
	PROVIDES="$PROVIDES
		cmd:a52dec$secondaryArchSuffix
		cmd:extract_a52$secondaryArchSuffix
		"
fi

REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	"

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

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

INSTALL()
{
	make install

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

	# prepare develop/lib
	prepareInstalledDevelLibs liba52
	fixPkgconfig

	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
    a52dec${secondaryArchSuffix}_devel = $portVersion
    devel:liba52$secondaryArchSuffix = 0.0.0 compat >= 0
    "
REQUIRES_devel="
    a52dec$secondaryArchSuffix == $portVersion base
	"
