# upstream git revision: a6efc98e6cda125be25a45410c45f87a8769ca76

# Maintainer: Erich Eckner <deep42thought at archlinux32 dot org>
# Contributor: Felix Yan <felixonmars@archlinux.org>

# heavily borrowed from python-packagings PKGBUILD

pkgbase=python-packaging-bootstrap
_pkgbase="${pkgbase%-*}"
pkgname=(python-packaging-bootstrap python2-packaging-bootstrap)
pkgver=20.4
pkgrel=1
pkgdesc="Core utilities for Python packages - bootstrap version"
arch=('any')
url="https://github.com/pypa/packaging"
license=('Apache')
makedepends=('python-dephell' 'python-setuptools' 'python2-setuptools' 'python-pyparsing'
             'python2-pyparsing')
source=("https://github.com/pypa/packaging/archive/$pkgver/$_pkgbase-$pkgver.tar.gz")
sha512sums=('507eccfc75682e888ad694e5932f7f699e99a35fdfb55c641cdd1f2162171678fd25c69cc1269a712023d1a8c57c31d2fc6ce46bbe674af66892d29740793013')

build() {
  cd packaging-$pkgver
  python setup.py build
  python2 setup.py build
}

package_python-packaging-bootstrap() {
  depends=('python-pyparsing' 'python-six')
  provides=("python-packaging=$pkgver")
  conflicts=('python-packaging')

  cd packaging-$pkgver
  python setup.py install --root "$pkgdir"
}

package_python2-packaging-bootstrap() {
  depends=('python2-pyparsing' 'python2-six')
  provides=("python2-packaging=$pkgver")
  conflicts=('python2-packaging')

  cd packaging-$pkgver
  python2 setup.py install --root "$pkgdir"
}