summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4040eb3c4436e07932b7001dfb9221ba0069435f (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
# Maintainer: Justin ! <just1602@riseup.net>

_pkgname='ttrack'
pkgname="$_pkgname-git"
pkgver=r25.2290c19
pkgrel=1
pkgdesc='simple CLI time tracker'
arch=('x86_64')
url='https://github.com/just1602/ttrack'
license=('GPL')
makedepends=("cargo")
provides=("$_pkgname")
source=("git+$url")
b2sums=('SKIP')

prepare() {
  cd "$_pkgname"
  cargo fetch --locked --target "$(rustc -vV | sed -n 's|host: ||p')"
}

build() {
  cd "$srcdir/$_pkgname"
  cargo build --frozen --release --target-dir target
}

check() {
  cd "$srcdir/$_pkgname"
  cargo test --frozen
}

package() {
  cd "$srcdir/$_pkgname"
  install -Dm755 target/release/ttrack "${pkgdir}/usr/bin/ttrack"
  install -Dm644 dist/_ttrack "${pkgdir}/usr/share/zsh/site-functions/_ttrack"
  install -Dm644 dist/ttrack.bash "${pkgdir}/usr/share/bash-completion/completions/ttrack.bash"
  install -Dm644 dist/ttrack.fish "${pkgdir}/usr/share/fish/vendor_completions.d/ttrack.fish"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/ttrack/license"
}

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