arch-pkgs/cargo-geiger/PKGBUILD
George Rawlinson 04b8801e42
upgpkg: cargo-geiger 0.11.2-1
* New upstream release.
* Switch source to git from github tarball.
2022-01-06 06:37:13 +00:00

50 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=cargo-geiger
pkgver=0.11.2
pkgrel=1
pkgdesc="Detects usage of unsafe Rust in a Rust crate and its dependencies"
arch=('x86_64')
url="https://github.com/rust-secure-code/cargo-geiger"
license=('Apache' 'MIT')
depends=('curl')
makedepends=('git' 'rust')
options=('!lto')
_commit='33f939738299c8da9247e60adab8a008da145b88'
source=("$pkgname::git+$url.git#commit=$_commit")
md5sums=('SKIP')
pkgver() {
cd "$pkgname"
git describe --tags | sed "s/(cargo-geiger-serde\|cargo-geiger\|geiger)//;s/-//"
}
prepare() {
cd "$pkgname"
# download dependencies
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$pkgname"
cargo build --release --frozen
}
check() {
cd "$pkgname"
cargo test --frozen
}
package() {
cd "$pkgname"
# binary
install -vDm755 -t "$pkgdir/usr/bin" "target/release/$pkgname"
# licenses
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" cargo-geiger/LICENSE*
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" *.md
}