SUMMARY="A BSON utility library"
DESCRIPTION="libbson is a library providing useful routines related to \
building, parsing, and iterating BSON documents. It is a useful base for \
those wanting to write high-performance C extensions to higher level \
languages such as python, ruby, or perl."
HOMEPAGE="https://github.com/mongodb/libbson"
COPYRIGHT="2013-2015 Christian Hergert, MongoDB and others"
LICENSE="Apache v2"
REVISION="3"
SOURCE_URI="https://github.com/mongodb/libbson/releases/download/1.1.10/libbson-1.1.10.tar.gz"
CHECKSUM_SHA256="211a62a7a6f93ba21b85afc1522c3a367a264be09626ea15f7be3a0fbe084a70"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	libbson$secondaryArchSuffix = $portVersion compat >= 1.0
	lib:libbson$secondaryArchSuffix = $portVersion compat >= 1.0
	lib:libbson_1.0$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libbson${secondaryArchSuffix}_devel = $portVersion compat >= 1.0
	devel:libbson$secondaryArchSuffix = $portVersion compat >= 1.0
	devel:libbson_1.0$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	libbson$secondaryArchSuffix == $portVersion
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	pkgconfig$secondaryArchSuffix
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtool
	cmd:make
	"

BUILD()
{
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
	mkdir -p $includeDir
	mv $prefix/include/* $includeDir/
	rmdir $prefix/include
	prepareInstalledDevelLibs libbson-1.0
	fixPkgconfig
	packageEntries devel $developDir
}

TEST()
{
	make test
}
