[alpine-aports,2/2] main/py-flask: clean up APKBUILD

Message ID 20190207132618.556-2-sir@cmpwn.com
State New
Headers show
Series
  • Untitled series #204
Related show

Commit Message

Drew DeVault Feb. 7, 2019, 1:26 p.m. UTC
---
 main/py-flask/APKBUILD | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

Patch

diff --git a/main/py-flask/APKBUILD b/main/py-flask/APKBUILD
index bbdbc258ef..1ae0cbd425 100644
--- a/main/py-flask/APKBUILD
+++ b/main/py-flask/APKBUILD
@@ -3,36 +3,51 @@ 
 pkgname=py-flask
 _pkgname=Flask
 pkgver=1.0.2
-pkgrel=1
+pkgrel=2
 pkgdesc="A web development microframework"
 url="http://flask.pocoo.org/"
 arch="noarch"
 license="MIT"
 depends="py-click py-itsdangerous py-jinja2 py-werkzeug"
 makedepends="python2-dev python3-dev py-setuptools"
+checkdepends="pytest"
 subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
 builddir="$srcdir/$_pkgname-$pkgver"
 
+prepare() {
+	cp -r "$builddir" "$builddir"-py3
+}
+
 build() {
 	cd "$builddir"
-
 	python2 setup.py build
+	cd "$builddir"-py3
 	python3 setup.py build
 }
 
+check() {
+	cd "$builddir"
+	export PYTHONPATH="$builddir"
+	pytest-2
+	cd "$builddir"-py3
+	export PYTHONPATH="$builddir"-py3
+	pytest-3
+}
+
 package() {
 	mkdir -p "$pkgdir"
 }
 
 _py2() {
-	replaces="$pkgname"
 	depends="${depends//py-/py2-}"
+	cd "$builddir"
 	_py python2
 }
 
 _py3() {
 	depends="${depends//py-/py3-}"
+	cd "$builddir"-py3
 	_py python3
 }
 
@@ -41,8 +56,6 @@  _py() {
 	pkgdesc="$pkgdesc (for $python)"
 	depends="$depends $python"
 	install_if="$pkgname=$pkgver-r$pkgrel $python"
-
-	cd "$builddir"
 	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }