SUMMARY="libmatroska is a C++ libary to parse Matroska files."
DESCRIPTION="libmatroska is a C++ libary to parse Matroska files."
HOMEPAGE="http://www.matroska.org/"
SRC_URI="http://dl.matroska.org/downloads/libmatroska/libmatroska-1.4.1.tar.bz2"
CHECKSUM_SHA256="086f21873e925679babdabf793c3bb85c353d0cd79423543a3355e08e8a4efb7"

REVISION="1"

LICENSE="GNU LGPL v2.1"
COPYRIGHT="2005-2013 CoreCodec, Inc."

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

PROVIDES="
	libmatroska$secondaryArchSuffix = $portVersion
	lib:libmatroska$secondaryArchSuffix = 6
	"
REQUIRES="
	haiku${secondaryArchSuffix} >= $haikuVersion
	lib:libebml$secondaryArchSuffix
	"
BUILD_REQUIRES="
	devel:libebml$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:sed
	"

PATCH()
{
	sed -i 's/^ifeq (BeOS/ifeq (Haiku/g' make/linux/Makefile
	sed -i "s,/boot/home/config,$prefix,g" make/linux/Makefile
	sed -i "s,^\(libdir\)=\(.*\)$,\1=$libDir,g" make/linux/Makefile
	sed -i "s,^\(includedir\)=\(.*\)$,\1=$includeDir/matroska,g" \
		make/linux/Makefile
	sed -i 's/-Wextra//g' make/linux/Makefile
}

BUILD()
{
	cd make/linux
	make $jobArgs \
		LIBEBML_INCLUDE_DIR=`finddir B_SYSTEM_DIRECTORY`/$relativeIncludeDir \
		LIBEBML_LIB_DIR=`finddir B_SYSTEM_DIRECTORY`/$relativeDevelopLibDir
}

INSTALL()
{
	cd make/linux
	make install
	
	prepareInstalledDevelLibs libmatroska
	
	packageEntries devel $developDir
}

PROVIDES_devel="
	libmatroska${secondaryArchSuffix}_devel = $portVersion
	devel:libmatroska$secondaryArchSuffix = 6
	"
REQUIRES_devel="
	libmatroska$secondaryArchSuffix == $portVersion base
	"
