summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e775398bd548addf798e6b0a65fa9fa9fe7bedeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Maintainer: Samsagax <samsagax at gmail dot com>

_pkgbase=hhfc
pkgname=${_pkgbase}-git
pkgver=0.2.1.r0.g8892467
pkgrel=1
pkgdesc="Hwmon Handheld Fan Controller (hhfc) is a user space driver for fans based on hwmon sysfs"
arch=('any')
url="https://github.com/Samsagax/hhfc"
license=('GPL3')
depends=('python-yaml')
makedepends=('python-build'
             'python-installer'
             'python-wheel'
             'python-setuptools'
             'git')
provides=("hhfc")
conflicts=("hhfc")
source=("${_pkgbase}::git+https://github.com/Samsagax/hhfc.git")
md5sums=('SKIP')

pkgver() {
	cd "$srcdir/${_pkgbase}"
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cd "$srcdir/${_pkgbase}"
	python -m build --wheel --no-isolation
}

package() {
	cd "$srcdir/${_pkgbase}"
	python -m installer --destdir="$pkgdir" dist/*.whl

	mkdir -p ${pkgdir}/etc/hhfc/

	mkdir -p ${pkgdir}/usr/share/hhfc/
	cp -v config/* ${pkgdir}/usr/share/hhfc/

	mkdir -p ${pkgdir}/usr/lib/systemd/system/
	cp -v systemd/hhfc.service ${pkgdir}/usr/lib/systemd/system/hhfc.service
	cp -v systemd/hhfc-resume.service ${pkgdir}/usr/lib/systemd/system/hhfc-resume.service
}