SUMMARY="A library to access DVDs"
DESCRIPTION="libdvdcss is a simple library designed for accessing DVDs like a \
block device without having to bother about the decryption."
HOMEPAGE="https://www.videolan.org/developers/libdvdcss.html"
COPYRIGHT="1998-2013 VideoLAN"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://download.videolan.org/pub/libdvdcss/$portVersion/libdvdcss-$portVersion.tar.bz2"
CHECKSUM_SHA256="84f1bba6cfef1df87f774fceaefc8e73c4cda32e8f6700b224ad0acb5511ba2c"
SOURCE_DIR="libdvdcss-$portVersion"
PATCHES="libdvdcss-$portVersion.patch"

ARCHITECTURES="all ?arm ?ppc"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libdvdcss$secondaryArchSuffix = $portVersion
	lib:libdvdcss$secondaryArchSuffix = 2.1.0 compat >= 2
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libdvdcss${secondaryArchSuffix}_devel = $portVersion
	devel:libdvdcss$secondaryArchSuffix = 2.1.0 compat >= 2
	"
REQUIRES_devel="
	libdvdcss$secondaryArchSuffix == $portVersion base
	"

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

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	autoconf
	automake --add-missing
	runConfigure ./configure
	make
}

INSTALL()
{
	make install

	# remove libtool file
	rm $libDir/libdvdcss.la

	# prepare develop/lib
	prepareInstalledDevelLib libdvdcss
	fixPkgconfig

	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}
