aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-yaml/APKBUILD
blob: 91e7dd19cd8e1a9b191c6009e69e7306c9a7c439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 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
pkgver=4.1
pkgrel=0
pkgdesc="Python bindings for YAML"
url="http://pyyaml.org"
arch="all"
license="MIT"
depends=""
makedepends="python2-dev python3-dev yaml-dev"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="$_pkgname-$pkgver.tar.gz::https://github.com/yaml/pyyaml/archive/$pkgver.tar.gz"
builddir="$srcdir/pyyaml-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	python2 setup.py test
	python3 setup.py test
}

package() {
	mkdir -p "$pkgdir"
}

_py2() {
	replaces="$pkgname"
	_py python2
}

_py3() {
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

sha512sums="3eb30d0d2f7e300dda98ad8378fa2ec4488071d165a7649d21ac32e1b3efeee14ee00ba86a32ba2db0c491866480f18480dec3e552ab7df82115bd9669833119  PyYAML-4.1.tar.gz"