summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: afa359f27da1625c8e0180ba87784727a5aaec67 (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: gesh <gesh AT gesh DOT uni DOT cx>

pkgname=pizauth-git
_pkgname="${pkgname%-git}"
pkgver=1.0.3.r0.g973523f
pkgrel=1
pkgdesc="OAuth2 token requester daemon"
arch=('i686' 'x86_64')
url="https://github.com/ltratt/${_pkgname}"
license=('custom')
provides=("$_pkgname")
makedepends=(cargo)
source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "$pkgname"
    git describe --long --tags \
        | sed "s/^$_pkgname-//;"'s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "$pkgname"
    export RUSTUP_TOOLCHAIN=stable
    cargo update
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

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

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

package() {
    cd "$pkgname"
    PREFIX="$pkgdir/usr" MAN_PREFIX="$pkgdir/usr/share/man" make install
}