summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 94450c62316df15f88f53253ed7b604f2da301d0 (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
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=bita
pkgver=0.12.0
pkgrel=1
pkgdesc="Differential file synchronization over http"
arch=(x86_64)
url="https://github.com/oll3/bita"
license=(MIT)
depends=(
  gcc-libs
  glibc
  openssl
  xz
)
makedepends=(
  cargo
  protobuf
)
options=(!lto)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('ccaf3987e6a2d0489f53ff92833835b288d6acc64b3fc36884234c5d9e061c84')

_archive="$pkgname-$pkgver"

prepare() {
  cd "$_archive"

  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$_archive"

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features
}

check() {
  cd "$_archive"

  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --all-features
}

package() {
  cd "$_archive"

  install -Dm755 -t "$pkgdir/usr/bin" "target/release/$pkgname"
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}