Mail archive
alpine-aports

[alpine-aports] [PATCH 4/8] main/py-django: upgrade to 1.11.1 and add support for python3

From: Ivan Tham <pickfire_at_riseup.net>
Date: Mon, 8 May 2017 00:59:11 +0800

---
 main/py-django/APKBUILD | 40 +++++++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 9 deletions(-)
diff --git a/main/py-django/APKBUILD b/main/py-django/APKBUILD
index 91b94eb5c6..8eb8ec66e2 100644
--- a/main/py-django/APKBUILD
+++ b/main/py-django/APKBUILD
_at_@ -2,19 +2,16 @@
 # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
 pkgname=py-django
 _pkgname=Django
-pkgver=1.11
+pkgver=1.11.1
 pkgrel=0
 pkgdesc="A high-level Python Web framework"
 url="http://djangoproject.com/"
 arch="noarch"
 license="BSD"
-depends="python2"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
+depends=""
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="${pkgname/py-/py2-}:_py2 ${pkgname/py-/py3-}:_py3"
 source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
-
 builddir="$srcdir"/$_pkgname-$pkgver
 
 # secfixes:
_at_@ -28,11 +25,36 @@ builddir="$srcdir"/$_pkgname-$pkgver
 build() {
 	cd "$builddir"
 	python2 setup.py build || return 1
+	python3 setup.py build || return 1
+}
+
+check() {
+	cd "$builddir"
+	python2 setup.py check || return 1
+	python3 setup.py check || return 1
 }
 
 package() {
+	mkdir -p "$pkgdir"
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+	install_if="pkgname=$pkgver-r$pkgrel $python"
+
 	cd "$builddir"
-	python2 setup.py install --root "$pkgdir" --skip-build || return 1
+	$python setup.py install --root="$subpkgdir" --skip-build || return 1
+}
+
+_py2() {
+       replaces="$pkgname"
+       _py python2
+}
+
+_py3() {
+       _py python3
 }
 
-sha512sums="31e14ec186d1b0dade0b7c0132c38177c4d5a3f5e8f755b81b556b6884912674bd1a3f8488194f4d7647804426a06663f0a19e2d56502a84c75553a459a64c55  Django-1.11.tar.gz"
+sha512sums="d0e7e272835a453d010fa449d7affdf3b1572ed009871c6cd156e7f093f15737d8c5f8c80ba6e879d467b278b27c095a3d95d8720d64cc1f891629c0254a7291  Django-1.11.1.tar.gz"
-- 
2.12.2
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon May 08 2017 - 00:59:11 UTC