SUMMARY="A C++ libary to parse Matroska files"
DESCRIPTION="libmatroska is a C++ libary to parse Matroska files."
HOMEPAGE="http://www.matroska.org/"
LICENSE="GNU LGPL v2.1"
REVISION="1"

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

SOURCE_URI="http://dl.matroska.org/downloads/libmatroska/libmatroska-$portVersion.tar.bz2"
CHECKSUM_SHA256="bea10320f1f1fd121bbd7db9ffc77b2518e8269f00903549c5425478bbf8393f"
COPYRIGHT="2005-2013 CoreCodec, Inc."

PROVIDES="
	libmatroska$secondaryArchSuffix = $portVersion
	lib:libmatroska$secondaryArchSuffix = 6.0.0 compat >= 6
	"
REQUIRES="
	haiku${secondaryArchSuffix}
	lib:libebml$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	"
if [ $effectiveTargetArchitecture = x86_gcc2 ]; then
	PATCHES="
		libmatroska-$portVersion.patchset
	"
else
	REQUIRES+="
		lib:libgcc_s${secondaryArchSuffix}
	"
fi

PROVIDES_devel="
	libmatroska${secondaryArchSuffix}_devel = $portVersion
	devel:libmatroska$secondaryArchSuffix = 6.0.0 compat >= 6
	"
REQUIRES_devel="
	libmatroska$secondaryArchSuffix == $portVersion base
	"
BUILD_REQUIRES="
	devel:libebml$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:pkg_config$secondaryArchSuffix
	cmd:libtool
	cmd:make
	"

BUILD()
{
	autoreconf -f -i
	runConfigure ./configure
	make $jobArgs

}

INSTALL()
{
	make install
	
	prepareInstalledDevelLibs libmatroska
	fixPkgconfig
	
	packageEntries devel $developDir
}
