| 1 | # Contributor: Leo <[email protected]> |
| 2 | # Maintainer: Hugo Osvaldo Barrera <[email protected]> |
| 3 | pkgname=liquidctl |
| 4 | pkgver=1.16.0 |
| 5 | pkgrel=1 |
| 6 | pkgdesc="Liquid Cooler Control" |
| 7 | url="https://github.com/liquidctl/liquidctl" |
| 8 | options="!check" # Requires writable /var/run |
| 9 | arch="noarch" |
| 10 | license="GPL-3.0-or-later" |
| 11 | pkgusers="liquidctl" |
| 12 | pkggroups="liquidctl" |
| 13 | depends=" |
| 14 | py3-colorlog |
| 15 | py3-crcmod |
| 16 | py3-docopt |
| 17 | py3-hidapi |
| 18 | py3-pillow |
| 19 | py3-smbus |
| 20 | py3-usb |
| 21 | " |
| 22 | makedepends=" |
| 23 | py3-gpep517 |
| 24 | py3-installer |
| 25 | py3-setuptools |
| 26 | py3-setuptools_scm |
| 27 | py3-wheel |
| 28 | " |
| 29 | checkdepends="py3-pytest" |
| 30 | install="$pkgname.pre-install $pkgname.pre-upgrade" |
| 31 | subpackages="$pkgname-doc $pkgname-pyc $pkgname-udev $pkgname-openrc" |
| 32 | source="$pkgname-$pkgver.tar.gz::https://github.com/liquidctl/liquidctl/archive/v$pkgver.tar.gz |
| 33 | liquidctl.initd |
| 34 | liquidctl.confd |
| 35 | " |
| 36 | |
| 37 | prepare() { |
| 38 | default_prepare |
| 39 | |
| 40 | # `uaccess` is (e)logind-specific (and too generous for this kind of permission). |
| 41 | sed -i 's/TAG+="uaccess"/GROUP="liquidctl"/' extra/linux/71-liquidctl.rules |
| 42 | } |
| 43 | |
| 44 | build() { |
| 45 | export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver |
| 46 | gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 |
| 47 | } |
| 48 | |
| 49 | check() { |
| 50 | python3 -m venv --clear --without-pip --system-site-packages .testenv |
| 51 | .testenv/bin/python3 -m installer .dist/*.whl |
| 52 | .testenv/bin/python3 -m pytest |
| 53 | } |
| 54 | |
| 55 | package() { |
| 56 | python3 -m installer -d "$pkgdir" .dist/*.whl |
| 57 | install -Dm644 extra/linux/71-liquidctl.rules -t "$pkgdir/usr/lib/udev/rules.d/" |
| 58 | install -Dm644 liquidctl.8 -t "$pkgdir/usr/share/man/man8/" |
| 59 | install -Dm 755 "$srcdir/liquidctl.initd" "$pkgdir/etc/init.d/liquidctl" |
| 60 | install -Dm 644 "$srcdir/liquidctl.confd" "$pkgdir/etc/conf.d/liquidctl" |
| 61 | } |
| 62 | |
| 63 | sha512sums=" |
| 64 | ff9dc7fcac8872b05eeb28e4b28f2e460020a7d3365b5db2281bfbd323b8b5be9c8572d61578aea381698e007a21fc3f5ab32df3e59a63f9dc9e5021b4a75886 liquidctl-1.16.0.tar.gz |
| 65 | a3cc105b3c26581f2eeb9aa920e1d71d93b2b455c687a69dc202c9892e25b0f38168eff08d4286234c050f2287fa2ba5adb69677b045e3c4d8c931cd787e96f7 liquidctl.initd |
| 66 | 6fd62b2b6073146f60c5e87bf9f62fe7dd8036adff0815d5c6a5d4ccd9c09c2077a3d1a777581c2d497eee61c325321bceb92d1b65174582451b0482227b97e0 liquidctl.confd |
| 67 | " |