File PKGBUILD of Package airco2ntrold

# Maintainer: Oleksandr Natalenko <oleksandr@natalenko.name>

pkgname=airco2ntrold
pkgver=0.0.1.r3
pkgrel=3
pkgdesc="Poll AIRCO2NRTOL device and export Prometheus metrics"
url="https://natalenko.name"
license=(GPL)
arch=(any)
makedepends=(cpio)

prepare() {
	ln -sf /usr/src/packages/SOURCES/${pkgname}-src ${pkgname}
}

package() {
	depends+=(python-prometheus_client python-hidapi)

	cd ${pkgname}

	install -Dt "${pkgdir}"/usr/bin -m0755 airco2ntrold
	install -Dt "${pkgdir}"/usr/lib/systemd/system -m0644 airco2ntrold.service
	install -Dt "${pkgdir}"/usr/lib/systemd/system -m0644 airco2ntrold-proxy.socket
	install -Dt "${pkgdir}"/usr/lib/systemd/system -m0644 airco2ntrold-proxy.service
	install -Dm0644 airco2ntrol.sysusers "${pkgdir}"/usr/lib/sysusers.d/airco2ntrol.conf
	install -Dt "${pkgdir}"/usr/lib/udev/rules.d -m0644 98-airco2ntrol.rules
}

openSUSE Build Service is sponsored by