summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorLuis Martinez2022-07-03 11:05:57 -0500
committerLuis Martinez2022-07-03 11:05:57 -0500
commit61e754625feae1693f0d1f08233d8996253784da (patch)
treeddad1383cf5ef267c959f93655dc9b879ceff144 /PKGBUILD
parent01d01ff5fe78b656f9be518bd3b8aa4b70611d73 (diff)
downloadaur-python-phue.tar.gz
package cleanup
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD35
1 files changed, 22 insertions, 13 deletions
diff --git a/PKGBUILD b/PKGBUILD
index fa6556f1a86f..233169abd108 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,27 +1,36 @@
-# Maintainer: Felix Golatofski <contact@xdfr.de>
+# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
+# Contributor: Felix Golatofski <contact@xdfr.de>
# Contributor: David Baum <david.baum@naraesk.eu>
pkgname=python-phue
-_module='phue'
+_pkg="${pkgname#python-}"
pkgver=1.1
-pkgrel=1
-pkgdesc="A Python library for the Philips Hue system"
+pkgrel=2
+pkgdesc="Python library for the Philips Hue system"
arch=('any')
url="https://github.com/studioimaginaire/phue"
license=('MIT')
depends=('python')
-makedepends=('python' 'python-setuptools')
-source=("https://github.com/studioimaginaire/phue/archive/${pkgver}.tar.gz")
-md5sums=('2c3303552b4f762d780deda26aedc507')
+makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
+checkdepends=('python-pytest' 'python-mock' 'python-testtools')
+changelog=CHANGELOG.md
+source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
+sha256sums=('245bc176176a1ceb8d2065a6f07f53754fbe03f2a000dbeb01ab922e50e55d0a')
build() {
- cd "${srcdir}/${_module}-${pkgver}"
- python setup.py build
+ cd "$_pkg-$pkgver"
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd "$_pkg-$pkgver"
+ PYTHONPATH="$PWD" pytest -x
}
package() {
- depends+=()
- cd "${srcdir}/${_module}-${pkgver}"
- install -Dm644 $srcdir/${_module}-${pkgver}/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+ cd "$_pkg-$pkgver"
+ PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir" dist/*.whl
+ local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
+ install -d "$pkgdir/usr/share/licenses/$pkgname/"
+ ln -s "$_site/$_pkg-$pkgver.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}