SUMMARY="A simple foundation for reading DVD video disks"
DESCRIPTION="libdvdread provides the functionality that is required to \
access many DVDs. It parses IFO files, reads NAV-blocks, and performs CSS \
authentication and descrambling (if an external libdvdcss library is \
installed)."
HOMEPAGE="https://www.videolan.org/developers/libdvdnav.html"
COPYRIGHT="1998-1999 Eric Smith
	2000-2002 Björn Englund
	2000-2003 Håkan Hjort, et al."
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://download.videolan.org/pub/videolan/libdvdread/$portVersion/libdvdread-$portVersion.tar.bz2"
CHECKSUM_SHA256="f91401af213b219cdde24b46c50a57f29301feb7f965678f1d7ed4632cc6feb0"
SOURCE_DIR="libdvdread-$portVersion"
PATCHES="libdvdread-$portVersion.patchset"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

libVersion="7.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	libdvdread7$secondaryArchSuffix = $portVersion
	lib:libdvdread$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

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

INSTALL()
{
	make install-strip

	rm $libDir/libdvdread.la

	# prepare develop/lib
	prepareInstalledDevelLibs libdvdread
	fixPkgconfig

	rm -rf \
		"$docDir"/{AUTHORS,ChangeLog,NEWS,TODO} \
		$developDir
}

TEST()
{
	make check
}
