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"
SOURCE_URI="http://downloads.videolan.org/pub/videolan/libdvdnav/$portVersion/libdvdnav-$portVersion.tar.bz2"
CHECKSUM_SHA256="5097023e3d2b36944c763f1df707ee06b19dc639b2b68fb30113a5f2cbf60b6d"
REVISION="3"

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

PATCHES="libdvdnav-$portVersion.patchset"

PROVIDES="
	libdvdnav$secondaryArchSuffix = $portVersion
	lib:libdvdnav$secondaryArchSuffix = 4.2.0 compat >= 4
	"

REQUIRES="
	haiku$secondaryArchSuffix
	libdvdread$secondaryArchSuffix
	"

BUILD_REQUIRES="
	libdvdread${secondaryArchSuffix}_devel
	# required by libdvdread
	libdvdcss${secondaryArchSuffix}_devel
	"

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

BUILD()
{
	autoreconf -fi
	runConfigure ./configure --enable-shared --enable-static \
		--disable-maintainer-mode
	make $jobArgs
}

INSTALL()
{
	make install
	
	rm $libDir/libdvdnav.la

	# prepare develop/lib
	prepareInstalledDevelLibs libdvdnav
	fixPkgconfig

	packageEntries devel \
		$docDir \
		$developDir
}

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

PROVIDES_devel="
	libdvdnav${secondaryArchSuffix}_devel = $portVersion
	devel:libdvdnav$secondaryArchSuffix = 4.2.0 compat >= 4
	"
REQUIRES_devel="
	libdvdnav$secondaryArchSuffix == $portVersion base
	"
