~dricottone/huttese-apk

d7bda23bff97b8bea276c90a6cdabaaae67c16ec — Drew DeVault 6 years ago c8dc5db
Add py-prometheus-client
1 files changed, 59 insertions(+), 0 deletions(-)

A prometheus/py-prometheus-client/APKBUILD
A prometheus/py-prometheus-client/APKBUILD => prometheus/py-prometheus-client/APKBUILD +59 -0
@@ 0,0 1,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"