summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorLuis Martinez2023-01-23 12:55:02 -0600
committerLuis Martinez2023-01-23 12:55:44 -0600
commit5e402b89c3022af066e58d817ae060c871815569 (patch)
tree3c0bb6a7ec57e7fb9774446a7d71da6799a773f7 /PKGBUILD
downloadaur-python-statsd-git.tar.gz
initial commit based on pystatsd-git
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD42
1 files changed, 42 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9d25ec369ff6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
+# Contributor: Georg Pichler <georg.pichler@gmail.com>
+
+pkgname=python-statsd-git
+_pkgname="${pkgname%-git}"
+_pkg="${_pkgname#python-}"
+pkgver=4.0.1.r12.g3fa4353
+pkgrel=1
+pkgdesc="Python client for statsd"
+arch=('any')
+url='https://github.com/jsocol/pystatsd'
+license=('MIT')
+depends=('python')
+makedepends=('git' 'python-build' 'python-installer' 'python-setuptools' 'python-wheel')
+checkdepends=('python-nose2')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+replaces=('pystatsd-git')
+source=("$_pkgname::git+$url")
+sha256sums=('SKIP')
+
+pkgver() {
+ git -C "$_pkgname" describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./'
+}
+
+build() {
+ cd "$_pkgname"
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd "$_pkgname"
+ nose2
+}
+
+package() {
+ cd "$_pkgname"
+ python -m installer --destdir="$pkgdir" dist/*.whl
+ local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
+ install -dv "$pkgdir/usr/share/licenses/$pkgname/"
+ ln -sv "$_site/$_pkg-${pkgver%.r*}.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
+}