summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a12548795a91d0fccac1136b294c44f60d23949c (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: f4iey <f4iey@f4iey.fr>	

pkgname=unipager-git
pkgver=r267.c5c579e
pkgrel=1
pkgdesc="Universal POCSAG pager transmitter"
arch=('any')
license=('GPL3')
url="https://github.com/rwth-afu/UniPager"
makedepends=(cargo-nightly)
depends=(hidapi)
source=($pkgname::"git+$url.git")
sha256sums=('SKIP')

prepare(){
    git -C "$srcdir/$pkgname" clean -dfx
    cd $srcdir/$pkgname
    export RUSTUP_TOOLCHAIN=nightly
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

 pkgver() {
    cd "$srcdir/$pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd $srcdir/$pkgname
    export RUSTUP_TOOLCHAIN=nightly
    export CARGO_TARGET_DIR=target
    rm Cargo.lock
    cargo build --release --all-features
}

check(){
    cd $srcdir/$pkgname
    export RUSTUP_TOOLCHAIN=nightly
    cargo test --all-features
}

package() {
  cd $srcdir/$pkgname
  install -Dm755 -t "$pkgdir/usr/bin" "target/release/${pkgname%-git}"
  install -Dm755 debian/${pkgname%-git}.service $pkgdir/usr/lib/systemd/system/${pkgname%-git}.service
}