# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-mimeparse
pkgver=2.0.0
pkgrel=2
pkgdesc='Module of basic functions for parsing mime-type names and matching them against a list of media-ranges'
arch=(any)
url="https://github.com/dbtsai/python-mimeparse"
license=('MIT')
depends=('python')
makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel' 'git')
source=("git+https://github.com/dbtsai/python-mimeparse#tag=$pkgver")
sha512sums=('8eb2faf9c6ee1ef940a44224792dabffa4b830cce170c6d4dc41162ece3150be2a5710d4183d8a28c69b9aa7c40a525a9d41e4c891a68058c68eeb627b317fde')

build() {
  cd "$srcdir"/python-mimeparse
  python -m build --wheel --no-isolation
}

check() {
  cd "$srcdir"/python-mimeparse
  python mimeparse_test.py
}

package() {
  cd python-mimeparse
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
