summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 467268f160619558b24d7689ed58c4e00748ed6d (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
# Maintainer: Walter C <bitlord {at} disroot {dot} org>
# Maintainer: Vasia Novikov <n1dr+cmarchlinux@yaaandex.com> (replace "aaa" with "a")
pkgname="rua-git"
_pkgname="rua"
pkgver=0.15.2.351.g9900bc2
pkgrel=1
pkgdesc="Build tool for Arch Linux providing control, review and jailed build options"
arch=("i686" "x86_64")
url="https://github.com/vn971/rua"
license=("GPL3")
depends=("pacman" "bubblewrap" "xz")
optdepends=(
  'bubblewrap-suid: version of bubblewrap that works on linux-hardened kernel'
  'shellcheck: check PKGBUILD scripts, taking care of special variables'
  'sudo: package installation can be done via sudo, if convenient'
)
makedepends=("rust" "cargo" "git")
provides=("rua")
conflicts=("rua")
source=("$_pkgname::git+https://github.com/vn971/rua.git")
sha256sums=("SKIP")

pkgver() {
    cd "$_pkgname"
    echo "$(grep '^version =' Cargo.toml|head -n1|cut -d\" -f2).$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
}

build () {
    cd $_pkgname
    mkdir -p target/completions

    if pacman -T pacman-git > /dev/null; then
    _features="git"
    fi
    COMPLETIONS_DIR=target/completions \
    cargo build --features "${_features:-}" --release --locked
}
    
check() {
    cd $_pkgname
    cargo test --release --locked
}

package() {
    cd "$srcdir/$_pkgname"
    install -Dm755 target/release/$_pkgname "$pkgdir/usr/bin/$_pkgname"
    install -Dm644 target/completions/rua.bash "${pkgdir}/usr/share/bash-completion/completions/rua.bash"
    install -Dm644 target/completions/rua.fish "${pkgdir}/usr/share/fish/completions/rua.fish"
    install -Dm644 target/completions/_rua "${pkgdir}/usr/share/zsh/functions/Completion/Linux/_rua"
}