Mail archive
alpine-aports

[alpine-aports] [PATCH 1/3] testing/py-pypeg2: fix python 3 package

From: Drew DeVault <sir_at_cmpwn.com>
Date: Sun, 5 Aug 2018 13:37:28 -0400

---
 testing/py-pypeg2/APKBUILD | 40 ++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/testing/py-pypeg2/APKBUILD b/testing/py-pypeg2/APKBUILD
index 61e88e502f..54554e4a35 100644
--- a/testing/py-pypeg2/APKBUILD
+++ b/testing/py-pypeg2/APKBUILD
_at_@ -1,58 +1,60 @@
+# Contributor: Drew DeVault <sir_at_cmpwn.com>
 # Contributor: Orson Teodoro <orsonteodoro_at_hotmail.com>
 # Maintainer: Orson Teodoro <orsonteodoro_at_hotmail.com>
 pkgname=py-pypeg2
 _pkgname=pypeg2
 __pkgname=pypeg
 pkgver=2.15.2
-pkgrel=0
+pkgrel=2
 pkgdesc="An intrinsic PEG Parser-Interpreter for Python"
 url="https://fdik.org/pyPEG2/"
 arch="noarch"
 license="GPL-2.0-only"
 _gitrev="43b84d987ec1"
-depends="py-lxml"
 makedepends="py-setuptools py3-setuptools"
 subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3 $pkgname-doc"
 source="$pkgname-$pkgver.tar.gz::https://bitbucket.org/fdik/$__pkgname/get/$pkgver.tar.gz"
-builddir="$srcdir"/$_pkgname-$pkgver
+builddir="$srcdir"/fdik-$__pkgname-$_gitrev
 
 prepare() {
-	mv "$srcdir"/fdik-$__pkgname-* "$builddir"
+	sed -i -e "s|PYTHON=python3.3||g" "$builddir"/Makefile
+	cp -r "$builddir" "$builddir"-py3
 	default_prepare
 }
 
 check() {
 	cd "$builddir"
 	python2 setup.py check
-	python3 setup.py check
-	sed -i -e "s|PYTHON=python3.3||g" Makefile
 	PYTHON="/usr/bin/python2" make test
+	cd "$builddir"-py3
+	python3 setup.py check
 	PYTHON="/usr/bin/python3" make test
 }
 
+package() {
+	cd "$builddir"
+	mkdir -p "$pkgdir"
+	install -d "$pkgdir"/usr/share/doc/$pkgname
+	install -t "$pkgdir"/usr/share/doc/$pkgname CHANGES.txt README.txt
+}
+
 _py() {
-	local python="$1"
+	local pyver="${subpkgname:2:1}"
+	local python="python$pyver"
 	pkgdesc="$pkgdesc (for $python)"
-	depends="depends $python"
+	depends="$python ${depends//py-/py$pyver-}"
 	install_if="$pkgname=$pkgver-r$pkgrel $python"
-	cd "$builddir"
 	$python setup.py install --prefix=/usr --root="$subpkgdir"
 }
 
 _py2() {
-	depends="${depends//py-//py2-}"
-	_py python2
+	cd "$builddir"
+	_py
 }
 
 _py3() {
-	depends="${depends//py-//py3-}"
-	_py python3
-}
-
-package() {
-	cd "$builddir"
-	install -d "$pkgdir"/usr/share/doc/$pkgname
-	install -t "$pkgdir"/usr/share/doc/$pkgname CHANGES.txt README.txt
+	cd "$builddir"-py3
+	_py
 }
 
 sha512sums="425e9f56c2353687ab0a77789c209359fd0cf50a949f39fea88c2e153737fbd4e7b0c9716895606a912fa4b98ced3380361739ebddeb13f60c6aad9e41a018d7  py-pypeg2-2.15.2.tar.gz"
-- 
2.18.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sun Aug 05 2018 - 13:37:28 GMT