# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Kwpolska <kwpolska@kwpolska.tk>

pkgbase=python-unidecode
pkgname=(
  python-unidecode
  python2-unidecode
)
pkgver=1.1.1
pkgrel=1
pkgdesc='ASCII transliterations of Unicode text'
arch=(any)
url=https://github.com/avian2/unidecode
license=(GPL)
makedepends=(
  git
  python-setuptools
  python2-setuptools
)
source=(git+https://github.com/avian2/unidecode.git#tag=unidecode-${pkgver})
sha256sums=(SKIP)

prepare() {
  cp -r {,python-}unidecode
   mv {,python2-}unidecode
}

build() {
  for py in python{,2}; do
    pushd ${py}-unidecode
    ${py} setup.py build
    popd
  done
}

package_python-unidecode() {
  depends=(python)

  cd python-unidecode

  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
}

package_python2-unidecode() {
  depends=(python2)

  cd python2-unidecode

  python2 setup.py install --root="${pkgdir}" --optimize=1 --skip-build
  mv "${pkgdir}"/usr/bin/unidecode{,2}
}

# vim: ts=2 sw=2 et:
