# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
setvar pkgname = 'liblastfm'
setvar pkgver = '1.0.9'
setvar pkgrel = '1'
setvar pkgdesc = ""A Qt C++ library for the Last.fm webservices""
setvar url = ""https://github.com/lastfm/liblastfm""
setvar arch = ""all""
setvar license = ""GPL3""
setvar depends = """"
setvar depends_dev = ""qt-dev libsamplerate-dev fftw-dev""
setvar makedepends = ""$depends_dev cmake""
setvar install = """"
setvar subpackages = ""$pkgname-dev""
setvar source = ""$pkgname-$pkgver.tar.gz::https://github.com/lastfm/liblastfm/archive/$pkgver.tar.gz""

setvar _builddir = ""$srcdir/$pkgname-$pkgver""

proc prepare {
	local i
	cd $_builddir
	for i in $source {
		case (i) {
		*.patch { msg $i; patch -p1 -i "$srcdir"/$i || return 1}
		}
	}
}

proc build {
	mkdir "$_builddir"/build
	cd "$_builddir"/build
	cmake $_builddir \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=/usr/lib \
		-DBUILD_TESTS=OFF \
		|| return 1
}

proc package {
	cd "$_builddir"/build
	make DESTDIR="${pkgdir}" install
}

setvar md5sums = ""8748f423f66f2fbc38c39f9153d01a71  liblastfm-1.0.9.tar.gz""
setvar sha256sums = ""5276b5fe00932479ce6fe370ba3213f3ab842d70a7d55e4bead6e26738425f7b  liblastfm-1.0.9.tar.gz""
setvar sha512sums = ""9d2bcf71b26d8a95920a07649c97b3faa071c49a8269268bb08fab01537392774873233d03cada09d3ce3fe2c45b0affdb74cd27c41f69342b973896effe1018  liblastfm-1.0.9.tar.gz""