# Maintainer: Andreas Grapentin <oaken-source@parabola.nu>

_pkgname=pyparser
pkgname=(python{,2}-$_pkgname)
pkgver=1.0
pkgrel=3
pkgdesc="pyparser is a collection of classes to make it easier to parse text data in a pythonic way."
arch=(any)
url="https://pypi.python.org/pypi/$_pkgname"
license=('GPLv3')

_depends=(parse)
makedepends=(python{,2}-setuptools)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/${_pkgname}/${_pkgname}-${pkgver}.tar.gz")
md5sums=('2a564841a03ca6279f50fef81952bdaa')

prepare() {
  cd "$srcdir"/$_pkgname-$pkgver
  sed -i 's/==/>=/' requirements.txt
}

_package() {
  depends=("$1" "${_depends[@]/#/$1-}")
  cd "$srcdir"/$_pkgname-$pkgver
  $1 setup.py install --root="$pkgdir"
}

for _pkg in "${pkgname[@]}"; do
  eval "package_$_pkg () { _package ${_pkg%%-*}; }"
done
