SUMMARY="Open implementation of AACS"
DESCRIPTION="libaacs is an open implementation of the Advanced Access Content \
System (AACS) specification."
HOMEPAGE="https://www.videolan.org/developers/libaacs.html"
COPYRIGHT="
	2009-2013  npzacs
	2010  gates
	2009-2010  hpi1
	2009-2010  Obliter0n
	2011-2013  VideoLAN
	2012   Konstantin Pavlov
	2013  Petri Hintukainen
	"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="https://download.videolan.org/pub/videolan/libaacs/$portVersion/libaacs-$portVersion.tar.bz2"
CHECKSUM_SHA256="6d884381fbb659e2a565eba91e72499778635975e4b3d6fd94ab364a25965387"

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

PROVIDES="
	libaacs$secondaryArchSuffix = $portVersion compat >= 0
	cmd:aacs_info${secondaryArchSuffix}
	lib:libaacs$secondaryArchSuffix = 0.7.1 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgcrypt$secondaryArchSuffix
	lib:libgpg_error$secondaryArchSuffix
	"

PROVIDES_devel="
	libaacs${secondaryArchSuffix}_devel = $portVersion compat >= 0
	devel:libaacs$secondaryArchSuffix = 0.7.1 compat >= 0
	"
REQUIRES_devel="
	libaacs$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgcrypt$secondaryArchSuffix
	devel:libgpg_error$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:bison
	cmd:flex
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:sed
	"

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

INSTALL()
{
	make install

	rm $libDir/libaacs.la

	prepareInstalledDevelLibs libaacs
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
