SUMMARY="Library to handle the BD+ protection scheme on Blu-ray disks"
DESCRIPTION="This library is written for the purpose of playing Blu-ray \
movies. It is intended for software that want to support Blu-ray playback \
(such as VLC and MPlayer)."
HOMEPAGE="http://www.videolan.org/developers/libbdplus.html"
SOURCE_URI="http://ftp.videolan.org/pub/videolan/libbdplus/$portVersion/libbdplus-$portVersion.tar.bz2"
CHECKSUM_SHA256="deb5e64984e625e40e1e0e1b6b1f9c041e7c77101b4b39df0d76ab8a4ec426cf"
COPYRIGHT="2011-2013 VideoLAN"
LICENSE="GNU LGPL v2.1"
REVISION="1"

ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
    # x86_gcc2 is fine as primary target architecture as long as we're building
    # for a different secondary architecture.
    ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libbdplus$secondaryArchSuffix = $portVersion compat >= 0
	lib:libbdplus$secondaryArchSuffix = 0.0.1 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgcrypt$secondaryArchSuffix
	lib:libgpg_error$secondaryArchSuffix
	"
PROVIDES_devel="
	libbdplus${secondaryArchSuffix}_devel = $portVersion compat >= 0
	devel:libbdplus$secondaryArchSuffix = 0.0.1 compat >= 0
	"
REQUIRES_devel="
	libbdplus$secondaryArchSuffix == $portVersion base
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgcrypt$secondaryArchSuffix
	devel:libgpg_error$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

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

INSTALL()
{
	make install

	prepareInstalledDevelLibs libbdplus
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
