SUMMARY="Lookup capabilities for music files"
DESCRIPTION="The MusicBrainz Client Library (libmusicbrainz), also known as \
mb_client, is a development library geared towards developers who wish to \
add MusicBrainz lookup capabilities to their applications."

REVISION="1"
HOMEPAGE="http://musicbrainz.org/doc/libmusicbrainz"
SOURCE_URI="https://github.com/metabrainz/libmusicbrainz/releases/download/release-5.1.0/libmusicbrainz-5.1.0.tar.gz"
CHECKSUM_SHA256="6749259e89bbb273f3f5ad7acdffb7c47a2cf8fcaeab4c4695484cef5f4c6b46"

COPYRIGHT="2012 Andrew Hawkins"
LICENSE="GNU LGPL v2.1"

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

PROVIDES="
	musicbrainz$secondaryArchSuffix = $portVersion
	lib:libmusicbrainz5$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libneon$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	"
BUILD_REQUIRES="
	devel:libneon$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:gcc$secondaryArchSuffix
	cmd:cmake
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

PATCHES="musicbrainz-5.1.0.patchset"

SOURCE_DIR="libmusicbrainz-$portVersion"

BUILD() {
	cmake . -DCMAKE_INSTALL_PREFIX=$prefix
	make
}

INSTALL() {
	make install

	prepareInstalledDevelLibs libmusicbrainz5
	fixPkgconfig

	packageEntries devel \
		$developDir
}

PROVIDES_devel="
	musicbrainz${secondaryArchSuffix}_devel = $portVersion
	devel:libmusicbrainz5$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	musicbrainz$secondaryArchSuffix == $portVersion base
	"
