summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ca542855a572f4ba555983dadf90c38ea6dcee4e (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
# Maintainer: Florian Wetzel <aur@commanderred.xyz>
pkgname=prometheus-tasmota-power-exporter
reponame=${pkgname#prometheus-}

pkgver=1.0.3
pkgrel=2
pkgdesc="Prometheus Tasmota Power Exporter"

arch=('any')
url="https://github.com/CommanderRedYT/tasmota-power-exporter"
license=('GPLv3')

depends=('python' 'python-prometheus_client' 'python-requests')
makedepends=('python-build' 'python-installer' 'python-setuptools')

source=(
  "https://github.com/CommanderRedYT/tasmota-power-exporter/archive/refs/tags/${pkgver}.tar.gz"
)
sha256sums=('3933f9149fe49383d2217d29492f2584539691aaa2015527a6725e292b90d7e5')

build() {
  cd "$reponame-$pkgver"

  python -m build
}

# check() {
#   cd $_name-$pkgver
# 
#   python setup.py pytest
# }

package() {
  cd "$reponame-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -D -m 644 "prometheus-tasmota-power-exporter.service" "${pkgdir}/usr/lib/systemd/system/prometheus-tasmota-power-exporter.service"
  install -D -m 644 "prometheus-tasmota-power-exporter.conf" "${pkgdir}/etc/conf.d/prometheus-tasmota-power-exporter"
  install -D -m 644 "prometheus-tasmota-power-exporter.sysusers" "${pkgdir}/usr/lib/sysusers.d/prometheus-tasmota-power-exporter.conf"
}