SUMMARY="libebml is a C++ library to parse EBML content (read/write)."
DESCRIPTION="libebml is a C++ library to parse EBML content (read/write)."
HOMEPAGE="http://www.matroska.org/"
SRC_URI="http://dl.matroska.org/downloads/libebml/libebml-1.3.0.tar.bz2"
CHECKSUM_SHA256="83b074d6b62715aa0080406ea84d33df2e44b5d874096640233a4db49b8096de"

REVISION="1"

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

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

PROVIDES="
	libebml$secondaryArchSuffix = $portVersion
	lib:libebml$secondaryArchSuffix = 4
	"
REQUIRES="
	haiku${secondaryArchSuffix} >= $haikuVersion
	"
BUILD_REQUIRES="
	"
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/ebml,g" make/linux/Makefile
	sed -i 's/-Wextra//g' make/linux/Makefile
	sed -i 's/\(#elif defined(__BEOS__)\)/\1 || defined(__HAIKU__)/g' \
		ebml/c/libebml_t.h
}

BUILD()
{
	cd make/linux
	make $jobArgs
}

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

PROVIDES_devel="
	libebml${secondaryArchSuffix}_devel = $portVersion
	devel:libebml$secondaryArchSuffix = 4
	"
REQUIRES_devel="
	libebml$secondaryArchSuffix == $portVersion base
	"
