aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-django-rest-framework/APKBUILD
blob: f146d92f7a2faea4f14a8d2f7e1470aa481aa19c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:
pkgname=py-django-rest-framework
pkgver=3.8.2
pkgrel=0
pkgdesc="Web APIs for Django"
url="https://github.com/encode/django-rest-framework"
arch="noarch"
license="Custom"
depends="py-django"
makedepends="python2-dev python3-dev py2-setuptools"
checkdepends="pytest py-tz py-core-api py-jinja2 py-uritemplate"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
options="!check" # fails with "OperationalError: no such table: tests_blog"
source="$pkgname-$pkgver.tar.gz::https://github.com/encode/django-rest-framework/archive/$pkgver.tar.gz"
builddir="$srcdir"/django-rest-framework-$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
	python3 runtests.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="603c86a4741a37a22a2be273136eb4d1eaa0a07aa24ba97b67f9f8d4e7fa254fe9ca7d1fdd44ee9237e86ef4cfe6bdbc8f48954a92f91873c9ef0761813a43d2  py-django-rest-framework-3.8.2.tar.gz"