# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mutagen
pkgver=1.39
pkgrel=0
pkgdesc="An audio metadata tag reader and writer implemented in pure python"
url="https://github.com/quodlibet/mutagen"
arch="noarch"
license="GPL-2.0"
depends="python2 py-mutagen"
makedepends="python2-dev"
checkdepends="py2-pytest py-setuptools py2-hypothesis"
subpackages="$pkgname-doc py-$pkgname:py"
source="$pkgname-$pkgver.tar.gz::https://github.com/quodlibet/$pkgname/archive/release-$pkgver.tar.gz"

# we dont have all the needed deps for running the test suite yet
options="!check"

builddir="$srcdir/$pkgname-release-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
}

package() {
	cd "$builddir"
	python2 setup.py install --root="$pkgdir"
}

check() {
	cd "$builddir"
	python2 setup.py test
}

py() {
	pkgdesc="Python library for mutagen"
	depends="python2"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

sha512sums="9201fde734ea1a480d26815e788226437486cc6ef06a6f8e705f19d60a7c213e3d0a9bcba7c95fde806834e05b3c66afbc658cd29c84b784cbb69ac011cda882  mutagen-1.39.tar.gz"
