~dricottone/huttese-apk

ref: d7bda23bff97b8bea276c90a6cdabaaae67c16ec huttese-apk/prometheus/py-prometheus-client/APKBUILD -rw-r--r-- 1.3 KiB
d7bda23b — Drew DeVault Add py-prometheus-client 6 years ago
                                                                                
d7bda23b Drew DeVault
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
53
54
55
56
57
58
59
# Contributor: Drew DeVault <sir@cmpwn.com>
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py-prometheus-client
_pkgname=client_python
pkgver=0.5.0
pkgrel=0
pkgdesc="Prometheus instrumentation client for Python"
url="https://github.com/prometheus/client_python"
arch="noarch"
license="Apache-2.0"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
makedepends="
	python2-dev python3-dev py-setuptools pytest py-futures py-twisted
"
source="$pkgname-$pkgver.tar.gz::https://github.com/prometheus/client_python/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
    cd "$builddir"
	cp -r "$builddir" "$builddir"-py3
}

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

check() {
	cd "$builddir"
	pytest-2
	cd "$builddir"-py3
	pytest-3
}

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

_py2() {
	cd "$builddir"
	_py python2
}

_py3() {
	cd "$builddir"
	_py python3
}

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

sha512sums="6e6e6c0f859b7b9d593e1059b71fde8eed15ccd95e54c245b4e0e8edb748a4761f0929f2d6c06f1c4656eb81f26959c5cec6a58f4d725a587b433ffbb4582127  py-prometheus-client-0.5.0.tar.gz"