From d7bda23bff97b8bea276c90a6cdabaaae67c16ec Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 9 Dec 2018 14:14:25 -0500 Subject: [PATCH] Add py-prometheus-client --- prometheus/py-prometheus-client/APKBUILD | 59 ++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 prometheus/py-prometheus-client/APKBUILD diff --git a/prometheus/py-prometheus-client/APKBUILD b/prometheus/py-prometheus-client/APKBUILD new file mode 100644 index 0000000..782e908 --- /dev/null +++ b/prometheus/py-prometheus-client/APKBUILD @@ -0,0 +1,59 @@ +# Contributor: Drew DeVault +# Maintainer: Drew DeVault +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" -- 2.45.2