SUMMARY="Easy use of sophisticated DVD navigation features"
DESCRIPTION="
libdvdnav allows easy use of sophisticated DVD navigation features such as \
DVD menus, multiangle playback and even interactive DVD games.
"
HOMEPAGE="http://dvdnav.mplayerhq.hu/"
LICENSE="GNU GPL v2"
COPYRIGHT="2000 Rich Wareham
	2001-2004 the dvdnav project"
SRC_URI="http://dvdnav.mplayerhq.hu/releases/libdvdnav-4.2.0.tar.bz2"
CHECKSUM_MD5="53be8903f9802e101929a3451203bbf6"
REVISION="1"

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

PATCHES="libdvdnav-${portVersion}.patch"

PROVIDES="
	libdvdnav${secondaryArchSuffix} = $portVersion
	lib:libdvdnav
	cmd:dvdnav_config
	"

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

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

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

SOURCE_DIR="libdvdnav-${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 libdvdnav libdvdnavmini
	fixPkgconfig

	packageEntries devel \
		$developDir
}

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

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