summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f59df8e41d9bda93173ecabe6996d8b2616a92d2 (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
# Maintainer: mochaaP <aur@mochaa.ws>

_pkgname=paperback
pkgname=${_pkgname}-git
_pkgver=0.0.0
pkgver=0.0.0.709375a
pkgrel=1
pkgdesc="Paper backup generator suitable for long-term storage."
url="https://github.com/cyphar/${_pkgname}"
arch=(${CARCH})
license=('GPL')
makedepends=('cargo' 'git')
_commit=709375aad3e1a03da7fc9313a3c50f450786e0d6
source=("git+${url}#commit=${_commit}")
sha512sums=('SKIP')

pkgver() {
  cd ${_pkgname}
  printf ${_pkgver}.$(git describe --always | sed 's/^v//;s/-/+/g')
}

prepare() {
  cd ${_pkgname}
  cargo update
  cargo fetch --locked --target "${CARCH}-unknown-linux-gnu"
}

build() {
  cd ${_pkgname}
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --release --all-features
}

check() {
  cd ${_pkgname}
  export RUSTUP_TOOLCHAIN=stable
  cargo test --all-features
}

package() {
  cd ${_pkgname}
  install -Dt "${pkgdir}/usr/bin" target/release/${_pkgname}
  install -Dt "${pkgdir}/usr/share/doc/${_pkgname}" -m644 README.md
}