_name=django-ranged-response
pkgname=python-django-ranged-response
pkgver=0.2.0
pkgrel=10
pkgdesc="Modified Django FileResponse that adds Content-Range headers."
arch=(any)
url="https://github.com/wearespindle/django-ranged-fileresponse"
license=('MIT')
depends=('python' 'python-setuptools')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/django-ranged-response-0.2.0.tar.gz")
sha256sums=('f71fff352a37316b9bead717fc76e4ddd6c9b99c4680cdf4783b9755af1cf985')

build() {
  cd "$srcdir/django-ranged-response-0.2.0"
  python3 setup.py build
}

package() {
  cd "$srcdir/django-ranged-response-0.2.0"
  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/"
}

