_name=django-statici18n
pkgname=python-django-statici18n
pkgver=2.7.1
pkgrel=1
pkgdesc="A Django app that compiles i18n JavaScript catalogs to static files."
arch=(any)
url="http://django-statici18n.readthedocs.org/"
license=('BSD')
depends=('python-django-appconf')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/django_statici18n-2.7.1.tar.gz")
sha256sums=('2b875b350a0e4df20836a3661152610676179d59af84dfaeba2478f74d41f955')

build() {
  cd "$srcdir/django_statici18n-2.7.1"
  python3 setup.py build
}

package() {
  cd "$srcdir/django_statici18n-2.7.1"
  python3 setup.py install --root=$pkgdir --optimize=1 --skip-build

  # make sure we don't install any world-writable or root-readable-only files
  # we shouldn't need to fix ownership as we extract tarballs as a non-root user
  # https://github.com/pypa/setuptools/issues/1328
  # https://github.com/LonamiWebs/Telethon/issues/1605
  chmod u=rwX,go=rX -R "$pkgdir"
  # make sure we don't install annoying files
  local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  rm -rf "$pkgdir/$_site_packages/tests/"
}

