# ArchLinux:
# Maintainer: Alexander Duscheleit <jinks@archlinux.us>
# MSYS2:
# Maintainer: Ray Donnelly <mingw.android@gmail.com>

_pyname=colorama
pkgbase="python-${_pyname}"
pkgname=("python-${_pyname}")
pkgver=0.4.4
pkgrel=2
pkgdesc="Python API for cross-platform colored terminal text."
arch=('any')
url="https://pypi.python.org/pypi/colorama"
license=('BSD')
provides=("python3-${_pyname}")
conflicts=("python3-${_pyname}")
replaces=("python3-${_pyname}")
depends=('python')
checkdepends=('python-mock')
source=(colorama-${pkgver}.tar.gz::https://github.com/tartley/colorama/archive/${pkgver}.tar.gz)
sha256sums=('78215866046cdc2cc00bf283e3dbff18b09840604534137f300a402afedf28e2')

build() {
  cd "$srcdir/${_pyname}-${pkgver}"

  /usr/bin/python setup.py build
}

check() {
  cd "$srcdir/${_pyname}-${pkgver}"

  /usr/bin/python -m unittest discover -p *_test.py || warning "test failed"
}

package() {
  cd "$srcdir/${_pyname}-${pkgver}"

  /usr/bin/python setup.py install --root="${pkgdir}" --optimize=1
  install -D -m644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}
