aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-yaml/APKBUILD
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-30 21:41:07 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-30 23:35:53 +0200
commit112d5af5913b2e2233e0a5530d8bd23fe39df3d0 (patch)
treedfae94310e7c87dcbadf48ba72b03634e83b0102 /main/py-yaml/APKBUILD
parentb32328f501642593608987ea8ee16ff1eb381877 (diff)
downloadaports-112d5af5913b2e2233e0a5530d8bd23fe39df3d0.tar.bz2
aports-112d5af5913b2e2233e0a5530d8bd23fe39df3d0.tar.xz
main/py-yaml: add py2/py3 subpackages
Diffstat (limited to 'main/py-yaml/APKBUILD')
-rw-r--r--main/py-yaml/APKBUILD39
1 files changed, 29 insertions, 10 deletions
diff --git a/main/py-yaml/APKBUILD b/main/py-yaml/APKBUILD
index 6fdad7aa9a..ec9b2d891d 100644
--- a/main/py-yaml/APKBUILD
+++ b/main/py-yaml/APKBUILD
@@ -1,4 +1,5 @@
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-yaml
_pkgname=PyYAML
@@ -6,24 +7,42 @@ pkgver=3.11
pkgrel=0
pkgdesc="Python bindings for YAML"
url="http://pyyaml.org"
-arch="all"
+arch="noarch"
license="MIT"
depends=""
-depends_dev=""
-makedepends="yaml-dev python-dev"
-install=""
-subpackages=""
+makedepends="python2-dev python3-dev yaml-dev"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="http://pyyaml.org/download/pyyaml/$_pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$_pkgname-$pkgver"
-_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
}
package() {
- cd "$_builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_py3() {
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ arch="all"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
}
md5sums="f50e08ef0fe55178479d3a618efe21db PyYAML-3.11.tar.gz"