summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 49d2d04e37911cc31ab1be0d5d30016b34c84d29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Rafael Dominiquini <rafaeldominiquini at gmail dor com>

_pkgauthor=casey
_pkgname=filepack
pkgname=${_pkgname}
pkgver=0.0.6
pkgrel=1
pkgdesc='Command-line file hashing and verification utility written in Rust'
url="https://github.com/${_pkgauthor}/${_pkgname}"
_urlraw="https://raw.githubusercontent.com/${_pkgauthor}/${_pkgname}/${pkgver}"
arch=('x86_64')
license=('custom:CC0')
depends=('glibc')
makedepends=('cargo' 'help2man' 'libgit2' 'libssh2')
conflicts=("${_pkgname}")
provides=("${_pkgname}")

source=("${url}/archive/${pkgver}.tar.gz")
sha256sums=('c4bbaf85629c3a21421668cb7b9c7a009085addc90a7e2a5e88531d359c35d10')

prepare() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable

  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target

  cargo build --release --frozen
}

package() {
  cd "$pkgname-$pkgver"

  # binary
  install -Dm 755 "target/release/${_pkgname}" "$pkgdir/usr/bin/${_pkgname}"

  # license
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"

  # docs
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 DESIGN.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 CHANGELOG.md -t "$pkgdir/usr/share/doc/$pkgname"
}

check() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable

  cargo test --frozen --all
}