# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>

_pkgname=django-countries
pkgname=(python-$_pkgname python2-$_pkgname)
pkgver=3.3
pkgdesc="Provides a country field for Django models"
url="https://github.com/SmileyChris/django-countries"
license=('custom:MIT')

conflicts=($_pkgname)

pkgrel=4
arch=(any)
makedepends=(python{,2}-{django,setuptools})
source=(https://files.pythonhosted.org/packages/a4/86/7948d078aa5220479c89480b83dfca449d627cdefcf1d70adcfbe9a21dc0/django-countries-3.3.tar.gz)
sha256sums=('11827070ebcf201d22ea531aa90e18146ca89580bd1897a132eb8afbc6b35b7d')

package_python-django-countries() {
  depends=('python-django')

  cd "$srcdir/$_pkgname-$pkgver"
  LC_ALL=en_US.UTF-8 python setup.py install --root="$pkgdir/" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

package_python2-django-countries() {
  depends=('python2-django')
  replaces=($_pkgname)

  cd "$srcdir/$_pkgname-$pkgver"
  python2 setup.py install --root="$pkgdir/" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
