
pkgname=throttled
pkgver=0.7
pkgrel=4
pkgdesc="Workaround for Intel throttling issues in Linux."
arch=('any')
url="https://github.com/erpalma/throttled"
license=('MIT')
depends=('python-dbus' 'python-psutil' 'python-gobject')
conflicts=('lenovo-throttling-fix-git' 'lenovo-throttling-fix')
replaces=('lenovo-throttling-fix')
backup=('etc/throttled.conf')
source=("git+https://github.com/Hyper-KVM/throttled.git#branch=openrc")
sha256sums=('SKIP')


build() {
  cd "${srcdir}/throttled/"
  python -m compileall *.py
}

package() {
  cd "${srcdir}/throttled/"
  install -Dm644 etc/throttled.conf "$pkgdir"/etc/throttled.conf
  install -Dm644 systemd/throttled.service "$pkgdir"/usr/lib/systemd/system/throttled.service
  install -Dm755 throttled.py "$pkgdir"/usr/lib/$pkgname/throttled.py
  install -Dm755 openrc/throttled "$pkgdir/etc/init.d/throttled"
  install -Dm755 mmio.py "$pkgdir"/usr/lib/$pkgname/mmio.py
  cp -a __pycache__ "$pkgdir"/usr/lib/$pkgname/
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
