summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 02fa717dd3b451e5d95042b76ac8646ac1f5af5f (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
# Maintainer: Danilo Bargen <aur at dbrgn dot ch>
pkgname=tealdeer-git
_name=tealdeer
pkgver=r108.2d1caf2
pkgrel=3
pkgdesc="A fast TLDR client written in Rust."
arch=('x86_64' 'i686')
url="https://github.com/dbrgn/tealdeer"
license=('MIT' 'Apache')
depends=('')
makedepends=('git' 'rust' 'cargo')
provides=('tldr')
conflicts=('nodejs-tldr' 'nodejs-tldr-git' 'tealdeer' 'tldr-bash-git' 'tldr-cpp-client'
           'tldr-git' 'tldr-go-client-git' 'tldr-python-client')
options=(!emptydirs)
source=('git+https://github.com/dbrgn/tealdeer')
md5sums=('SKIP')

build() {
  cd "$srcdir/$_name"
  cargo build --release
}

package() {
  cd "$srcdir/$_name"

  # Install binary
  mkdir -p $pkgdir/usr/bin
  install -o root -g root -m 755 target/release/tldr $pkgdir/usr/bin

  # Install bash completions
  mkdir -p $pkgdir/usr/share/bash-completion/completions
  install -o root -g root -m 644 bash_tealdeer $pkgdir/usr/share/bash-completion/completions/tldr
}

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

# vim:set ts=2 sw=2 et: