summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a3152b2c2356925723da1ec5d08af7dddefe3cc9 (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
54
# Maintainer: Eskil Queseth <eskilq at kth dot se>
# Maintainer: Gustav Sörnäs <gustav at sornas dot net>

pkgname=mum-git
pkgver=r698.fe7f460
pkgrel=1
pkgdesc="A mumble client/daemon pair"
arch=('x86_64')
url="https://github.com/mum-rs/mum.git"
license=('MIT')
sha256sums=('SKIP')
depends=('alsa-lib' 'libnotify' 'opus' 'openssl')
optdepends=('bash: for tab completions'
            'fish: for tab completions'
            'zsh: for tab completions')
makedepends=('git' 'cargo')
conflicts=('mum')
provides=('mum')
source=("git+$url")

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

build() {
    cd "${srcdir}/${pkgname%-git}"
    RUSTFLAGS="--remap-path-prefix=$(pwd)=" cargo +stable build --locked --release --target-dir=target

    ./target/release/mumctl completions bash > mumctl.bash
    ./target/release/mumctl completions fish > mumctl.fish
    ./target/release/mumctl completions zsh > mumctl.zsh
}

check() {
    cd "${srcdir}/${pkgname%-git}"
    RUSTFLAGS="--remap-path-prefix=$(pwd)=" cargo +stable test --locked --release --target-dir=target
}

package() {
    cd "${srcdir}/${pkgname%-git}"

    install -Dm 644 mumctl.bash "${pkgdir}/usr/share/bash-completion/completions/mumctl"
    install -Dm 644 mumctl.fish "${pkgdir}/usr/share/fish/completions/mumctl.fish"
    install -Dm 644 mumctl.zsh "${pkgdir}/usr/share/zsh/site-functions/_mumctl"

    install -Dm 644 documentation/mumctl.1 "${pkgdir}/usr/share/man/man1/mumctl.1"
    install -Dm 644 documentation/mumd.1 "${pkgdir}/usr/share/man/man1/mumd.1"
    install -Dm 644 documentation/mumdrc.5 "${pkgdir}/usr/share/man/man5/mumdrc.5"

    install -Dm 755 target/release/mumctl "${pkgdir}/usr/bin/mumctl"
    install -Dm 755 target/release/mumd "${pkgdir}/usr/bin/mumd"
    install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}