SUMMARY="A YAML parser and emitter in C++"
DESCRIPTION="yaml-cpp is a YAML parser and emitter in C++ matching the YAML \
1.2 spec."
HOMEPAGE="http://github.com/jbeder/yaml-cpp/"
SOURCE_URI="http://yaml-cpp.googlecode.com/files/yaml-cpp-$portVersion.tar.gz"
CHECKSUM_SHA256="3e7c9052b43d987d41819a203d97fc45de4eed3ec67e0fdb14265c3d11046f06"
SOURCE_DIR="yaml-cpp-$portVersion"
REVISION="1"
LICENSE="MIT"
COPYRIGHT="2008 Jesse Beder"
 
ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	yaml_cpp$secondaryArchSuffix = $portVersion compat >= 0.5
	lib:libyaml_cpp$secondaryArchSuffix = $portVersion compat >= 0.5
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	lib:libgcc_s$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	boost${secondaryArchSuffix}_devel
	"

BUILD_PREREQUIRES="
	cmd:cmake
	cmd:make
	cmd:gcc${secondaryArchSuffix}
	cmd:ld${secondaryArchSuffix}
"

BUILD()
{	
	cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX:PATH=$prefix .
	make $jobArgs
}
 
INSTALL()
{
	make install
	
	mkdir -p `dirname $includeDir` $libDir
	mv $prefix/include $includeDir

	if [ -n "$secondaryArchSuffix" ]; then
		mv $prefix/lib/libyaml-cpp* $prefix/lib/pkgconfig $libDir/
	fi

	prepareInstalledDevelLibs \
		libyaml-cpp
	fixPkgconfig

	packageEntries devel \
		$developDir
}

PROVIDES_devel="
	yaml_cpp${secondaryArchSuffix}_devel = $portVersion compat >= 0.5
	devel:libyaml_cpp$secondaryArchSuffix = 0.5.1 compat >= 0.5
	"

REQUIRES_devel="
	yaml_cpp$secondaryArchSuffix == $portVersion
	boost${secondaryArchSuffix}_devel
	"
