arch-pkgs/cargo-geiger/PKGBUILD

45 lines
1.1 KiB
Bash

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=cargo-geiger
pkgver=0.11.1
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=('rust')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgname-$pkgver.tar.gz")
b2sums=('01117f80b72de3cf145bb549cd6a5775b99c3ef37aad4972aa842d03decd68a7bd7ed1a32358070fb6836d64da1fe011a232c7ba46c91f0dbf7b0847681ebb97')
prepare() {
# remove redundant pkgname
mv "$pkgname-$pkgname-$pkgver" "$pkgname-$pkgver"
# download dependencies
cd "$pkgname-$pkgver"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$pkgname-$pkgver"
cargo build --release --frozen
}
check() {
cd "$pkgname-$pkgver"
cargo test --frozen
}
package() {
cd "$pkgname-$pkgver"
# 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
}