aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-django-cors-headers
diff options
context:
space:
mode:
authorLeonardo Arena <rnalrd@alpinelinux.org>2017-12-20 08:41:34 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-12-21 11:03:18 +0000
commit803633857908cce7681a73d86856a71d18ce9dec (patch)
tree9e9b4b595fd29de0bdb3bc7435a1df00b3e749e2 /testing/py-django-cors-headers
parent725fe04b242d8b89cdc825bc9cdd14cea9189030 (diff)
downloadaports-803633857908cce7681a73d86856a71d18ce9dec.tar.bz2
aports-803633857908cce7681a73d86856a71d18ce9dec.tar.xz
testing/py-django-cors-headers: new aport
Diffstat (limited to 'testing/py-django-cors-headers')
-rw-r--r--testing/py-django-cors-headers/APKBUILD55
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/py-django-cors-headers/APKBUILD b/testing/py-django-cors-headers/APKBUILD
new file mode 100644
index 0000000000..912bf9b832
--- /dev/null
+++ b/testing/py-django-cors-headers/APKBUILD
@@ -0,0 +1,55 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer:
+pkgname=py-django-cors-headers
+pkgver=1.2.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"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+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 tests.py
+ python3 tests.py
+}
+
+_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="0f6bfef73cc007a4a322e266433d7053e4d897212183be82e0e201786ba0e5dfe802771879c83c61b8a2044ac4003b0aec3080c358033a2c8f24d341641acadf py-django-cors-headers-1.2.0.tar.gz"