aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-attrs
diff options
context:
space:
mode:
authorTBK <tbk@jjtc.dk>2018-05-02 16:40:14 +0200
committerFrancesco Colista <fcolista@alpinelinux.org>2018-05-08 13:42:46 +0000
commit08fb3c070346762cc71103e3ffb6ed9811de9514 (patch)
treed979cb91c08497bd932b45b54f44ae3c90e1d260 /community/py-attrs
parent313ebbf01c1bea6409f059ead53c006fb52d8281 (diff)
downloadaports-08fb3c070346762cc71103e3ffb6ed9811de9514.tar.bz2
aports-08fb3c070346762cc71103e3ffb6ed9811de9514.tar.xz
community/py-attrs: provide py2 package
Diffstat (limited to 'community/py-attrs')
-rw-r--r--community/py-attrs/APKBUILD36
1 files changed, 29 insertions, 7 deletions
diff --git a/community/py-attrs/APKBUILD b/community/py-attrs/APKBUILD
index 9a8070c466..61e2e03d52 100644
--- a/community/py-attrs/APKBUILD
+++ b/community/py-attrs/APKBUILD
@@ -1,29 +1,51 @@
# Contributor: Jean-Louis Fuchs <ganwell@fangorn.ch>
# Maintainer: Jean-Louis Fuchs <ganwell@fangorn.ch>
-pkgname=py3-attrs
+pkgname=py-attrs
pkgver=17.4.0
-pkgrel=0
+pkgrel=1
pkgdesc="Python classes without boilerplate"
url="http://www.attrs.org"
arch="noarch"
license="MIT"
-depends="python3"
-makedepends="python3-dev py3-pytest py3-setuptools"
-source="py3-attrs-$pkgver.tar.gz::https://github.com/python-attrs/attrs/archive/$pkgver.tar.gz"
+makedepends="python3-dev python2-dev pytest py2-setuptools"
+subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
+source="py-attrs-$pkgver.tar.gz::https://github.com/python-attrs/attrs/archive/$pkgver.tar.gz"
builddir="$srcdir/attrs-$pkgver"
build() {
cd "$builddir"
+ python2 setup.py build
python3 setup.py build
}
check() {
+ PYTHONPATH="$builddir/src" python2 check.py
PYTHONPATH="$builddir/src" python3 check.py
}
package() {
cd "$builddir"
- python3 setup.py install --prefix=/usr --root="$pkgdir"
+ mkdir -p "$pkgdir"
}
-sha512sums="14a512009cefbadc66972380f3beeb80e28daebeef467838c3506fd33a65e555666434a2d8f7294291b431e8b787aea370e267045f30a2253463e79d0e6caa3a py3-attrs-17.4.0.tar.gz"
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc ($python)"
+ depends="$depends $python"
+ provides="$pkgname-tools"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_py3() {
+ _py python3
+}
+
+sha512sums="14a512009cefbadc66972380f3beeb80e28daebeef467838c3506fd33a65e555666434a2d8f7294291b431e8b787aea370e267045f30a2253463e79d0e6caa3a py-attrs-17.4.0.tar.gz"