init: pkgbuild with service file
This commit is contained in:
commit
fb9fd24467
4 changed files with 77 additions and 0 deletions
42
PKGBUILD
Normal file
42
PKGBUILD
Normal file
|
@ -0,0 +1,42 @@
|
|||
# Maintainer: Virt <virtinstance@gmail.com>
|
||||
|
||||
pkgname=watt
|
||||
pkgver=0.3.1
|
||||
pkgrel=1
|
||||
pkgdesc='Modern CPU frequency and power management utility for Linux'
|
||||
url='https://github.com/NotAShelf/watt'
|
||||
|
||||
license=('MPL-2.0')
|
||||
makedepends=('cargo')
|
||||
depends=()
|
||||
arch=('x86_64' 'armv7h')
|
||||
|
||||
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz" "$pkgname.service")
|
||||
sha256sums=('406834dae5e4734987d5777e207b62cb4e89f7acc992a423215ee38e99d88191' 'SKIP')
|
||||
|
||||
prepare() {
|
||||
cd "$pkgname-$pkgver"
|
||||
|
||||
export RUSTUP_TOOLCHAIN=stable
|
||||
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$pkgname-$pkgver"
|
||||
|
||||
export RUSTUP_TOOLCHAIN=stable
|
||||
export CARGO_TARGET_DIR=target
|
||||
cargo build --frozen --release --all-features
|
||||
}
|
||||
|
||||
package() {
|
||||
# install custom systemd service adapted from the nix module
|
||||
install -Dm644 "$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
|
||||
|
||||
cd "$pkgname-$pkgver"
|
||||
|
||||
# TODO: revert this
|
||||
install -Dm0755 "target/release/superfreq" "$pkgdir/usr/bin/$pkgname"
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue