# Contributor: Leonardo Arena # Maintainer: pkgname=py-django-cors-headers pkgver=2.4.0 pkgrel=0 pkgdesc="Django app for handling the server headers required for Cross-Origin Resource Sharing (CORS)" url="https://github.com/OttoYiu/django-cors-headers" arch="noarch" license="Custom" depends="py-django" makedepends="python2-dev python3-dev py-setuptools" checkdepends="py-django py-tz py-mock pytest" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" options="!check" # FIXME: fail source="$pkgname-$pkgver.tar.gz::https://github.com/ottoyiu/django-cors-headers/archive/$pkgver.tar.gz" builddir="$srcdir"/django-cors-headers-$pkgver build() { cd "$builddir" python2 setup.py --quiet build python3 setup.py --quiet build } package() { cd "$builddir" mkdir -p "$pkgdir"/usr/bin } check() { cd "$builddir" python2 runtests.py ./tests python3 runtests.py ./tests } _py2() { depends="${depends//py-/py2-}" _py python2 } _py3() { depends="${depends//py-/py3-}" _py python3 } _py() { local python="$1" local pyver="${1:6:1}" pkgdesc="$pkgdesc (for $python)" depends="$depends $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py --quiet install --prefix=/usr --root="$subpkgdir" } sha512sums="97f12655b0f499e62fbee6b506703fe9a43988f5d5ab275eb16ce8429c221fab6f8c50670357b33f218686490ae1a54527743a32d3a796c333dcb6328db4b94e py-django-cors-headers-2.4.0.tar.gz"