SUMMARY="A simple foundation for reading DVD video disks"
DESCRIPTION="
libdvdread provides a simple foundation for reading DVD video disks. It \
provides the functionality that is required to access many DVDs. libdvdread \
parses IFO files, reads NAV-blocks, and performs CSS authentication and \
descrambling (if an external libdvdcss library is installed).
"
HOMEPAGE="http://dvdnav.mplayerhq.hu"
LICENSE="GNU GPL v2"
COPYRIGHT="1998-1999 Eric Smith
	2000-2002 Björn Englund
	2000-2003 Håkan Hjort, et al."
SRC_URI="http://dvdnav.mplayerhq.hu/releases/libdvdread-$portVersion.tar.xz"
CHECKSUM_SHA256="af9b98f049580a6521d56c978b736d3d609562dd12955e11d50e26d97542dcd4"
REVISION="1"

ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 ?x86"

PATCHES="libdvdread-4.2.0.patch"

PROVIDES="
	libdvdread${secondaryArchSuffix} = $portVersion
	lib:libdvdread
	cmd:dvdread_config
	"

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="libdvdread-${portVersion}"

BUILD()
{
	./autogen.sh
	runConfigure ./configure --enable-shared --enable-static
	make $jobArgs
}

INSTALL()
{
	make install

	# move headers to the correct location
	mkdir -p $(dirname $includeDir)
	mv $prefix/include $includeDir/

	# prepare develop/lib
	prepareInstalledDevelLibs libdvdread
	fixPkgconfig

	packageEntries devel \
		$developDir
}

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

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