aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-distro/APKBUILD
blob: fc725faf851f8533bbe8f07b423afde7710c8ffb (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
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py-distro
_pkgname=distro
pkgver=1.4.0
pkgrel=1
pkgdesc="A Linux OS platform information API"
options="!check" # Some tests fail
url="https://github.com/nir0s/distro"
arch="noarch"
license="Apache-2.0"
makedepends="py-setuptools py3-setuptools"
checkdepends="py3-pytest py3-pytest-cov"
subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	python2 setup.py build
	python3 setup.py build
}

check() {
	python3 -m pytest
}

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

_py() {
	local python=$1
	pkgdesc="$pkgdesc - $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

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

_py3() {
	_py python3
}

sha512sums="eac7d32ea77c2074e57c6828a8b2e4d4d01e9c46cb0f7adbd99998630b0af4924bf18d05d5f5b42fef5603b024ef835dbb4c05fc88310f5e64d193514b2fc10f  distro-1.4.0.tar.gz"