arch-pkgs/rbw/PKGBUILD

51 lines
1.5 KiB
Bash

# Maintainer: Jesse Luehrs <archlinux@tozt.net>
pkgname=rbw
pkgver=1.3.0
pkgrel=2
pkgdesc="Unofficial Bitwarden CLI"
arch=('x86_64')
url="https://git.tozt.net/rbw"
license=('MIT')
depends=('pinentry')
makedepends=('cargo')
optdepends=(
'bash-completion: for tab auto-completions'
'zsh-completions: for tab auto-completions'
'fish: for tab auto-completions'
)
source=("$url/snapshot/${pkgname}-${pkgver}.tar.gz")
b2sums=('556f509e8137f03359ddaa5ca73d06accaca0a9384e6aefb6e1b6cb17683d4ef8c9a6f4678e954ce6806a32db6e8d4eaa60a51254eddd66fe6a124eef88b1bf1')
build() {
cd "$pkgname-$pkgver"
RUSTUP_TOOLCHAIN=stable cargo build --release --locked --all-features --target-dir=target
for completion in bash zsh fish; do
RUSTUP_TOOLCHAIN=stable cargo run --release --locked --bin rbw -- \
gen-completions "$completion" > "$completion-completions"
done
}
check() {
cd "$pkgname-$pkgver"
RUSTUP_TOOLCHAIN=stable cargo test --locked --target-dir=target
}
package() {
cd "$pkgname-$pkgver"
# binaries
install -vDm755 -t "$pkgdir/usr/bin" target/release/rbw{,-agent}
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md CHANGELOG.md
# tab auto-completions
install -Dm 644 bash-completions "${pkgdir}/usr/share/bash-completion/completions/rbw"
install -Dm 644 zsh-completions "${pkgdir}/usr/share/zsh/site-functions/_rbw"
install -Dm 644 fish-completions "${pkgdir}/usr/share/fish/vendor_completions.d/rbw.fish"
}