# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=libechonest
pkgver=2.3.1
pkgrel=0
pkgdesc="C++ library for interfacing with Echo Nest"
url="https://projects.kde.org/projects/playground/libs/libechonest"
arch="all"
license="GPL"
depends=""
depends_dev="qjson-dev qt-dev"
makedepends="$depends_dev cmake"
install=""
subpackages="$pkgname-dev"
source="http://files.lfranchi.com/libechonest-$pkgver.tar.bz2"

_builddir="$srcdir"/libechonest-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DECHONEST_BUILD_TESTS=off \
		../${pkgname}-${pkgver} || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR=${pkgdir} install
}

md5sums="d8c60545b056145dc66882971a0acf9c  libechonest-2.3.1.tar.bz2"
sha256sums="56756545fd1cb3d9067479f52215b6157c1ced2bc82b895e72fdcd9bebb47889  libechonest-2.3.1.tar.bz2"
sha512sums="6d4c3571680657d01516e1fa5c55478a25931a825801b06b7bdd6d16715fe2a72385bd8e74be95e15b8fd2521f8b9f7bde5c2afe73a7bbc1faeba9fadd80d2f3  libechonest-2.3.1.tar.bz2"
