aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-backports_abc/APKBUILD
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-04 01:05:00 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-04 01:05:19 +0200
commitc0daefe8cf76569ad9b1b6bdaabcfc71b0d9a64c (patch)
treea545516e71c5d20e641fa412a0333e86e4752fd6 /main/py-backports_abc/APKBUILD
parent1858d3db1af42850fdcd31c462acdb7e9c92e818 (diff)
downloadaports-c0daefe8cf76569ad9b1b6bdaabcfc71b0d9a64c.tar.bz2
aports-c0daefe8cf76569ad9b1b6bdaabcfc71b0d9a64c.tar.xz
main/py-backports_abc: add py2/py3 subpackages
Diffstat (limited to 'main/py-backports_abc/APKBUILD')
-rw-r--r--main/py-backports_abc/APKBUILD49
1 files changed, 28 insertions, 21 deletions
diff --git a/main/py-backports_abc/APKBUILD b/main/py-backports_abc/APKBUILD
index cebdc41334..ff76fabbb7 100644
--- a/main/py-backports_abc/APKBUILD
+++ b/main/py-backports_abc/APKBUILD
@@ -2,37 +2,44 @@
pkgname=py-backports_abc
_pkgname=backports_abc
pkgver=0.4
-pkgrel=0
+pkgrel=1
pkgdesc="A backport of recent additions to the collections.abc Python module"
url="https://github.com/cython/backports_abc"
arch="noarch"
license="custom"
-depends="python"
-depends_dev="py-setuptools"
-makedepends="python-dev $depends_dev"
-install=""
-subpackages=""
+depends=""
+makedepends="python2-dev python3-dev py-setuptools"
+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() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
-}
+builddir="$srcdir/$_pkgname-$pkgver"
build() {
- cd "$_builddir"
- python setup.py build || return 1
+ cd "$builddir"
+ python2 setup.py build || return 1
+ python3 setup.py build || return 1
}
package() {
- cd "$_builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 || return 1
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_py3() {
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ depends="$depends $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
}
md5sums="0b65a216ce9dc9c1a7e20a729dd7c05b backports_abc-0.4.tar.gz"