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/" 
SRC_URI="http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz"
CHECKSUM_SHA256="a21d724ab3b3933330194353687df82c475b5dfb997513eef4c25de6c865ec33"
REVISION="1"
LICENSE="GNU GPL v2"
COPYRIGHT="Copyright (C) 1999-2002 Aaron Holtzman and Michel Lespinasse"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 ?x86"

PATCHES="a52dec-$portVersion.patch"

PROVIDES="
	a52dec${secondaryArchSuffix} = $portVersion
	lib:liba52
	cmd:a52dec
	cmd:extract_a52
	"

REQUIRES="
	haiku${secondaryArchSuffix} >= $haikuVersion
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix} >= $haikuVersion
	"

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

SOURCE_DIR="a52dec-0.7.4"
	
BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	automake --add-missing

	runConfigure ./configure --enable-shared
	make $jobArgs
}

INSTALL()
{
	make install

	# prepare develop/lib
	prepareInstalledDevelLibs liba52
	fixPkgconfig

	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
    a52dec${secondaryArchSuffix}_devel = $portVersion
    devel:liba52$secondaryArchSuffix = $portVersion
    "
REQUIRES_devel="
    a52dec$secondaryArchSuffix == $portVersion base
	"
