summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f2834397f6fb5f1cef5e36d26712becb2aadf86 (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: Jose Riha <jose1711 gmail com>
# Contributor: David Cao <dcao@protonmail.com>

pkgname=timew-git
pkgver=r3124.814956b9
pkgrel=1
pkgdesc="A command-line time tracker (also known as timewarrior)"
arch=('i686' 'x86_64')
url="https://github.com/GothenburgBitFactory/timewarrior"
license=('MIT')
depends=('gcc-libs')
makedepends=('cmake' 'git')
optdepends=('task: Taskwarrior integration'
            'asciidoctor: Man page generation during compilation')
provides=('timew')
conflicts=('timew')

install=timew-git.install
source=('git+https://github.com/GothenburgBitFactory/timewarrior'
        'git+https://github.com/GothenburgBitFactory/libshared.git')
md5sums=('SKIP' 'SKIP')

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

prepare() {
  cd "timewarrior"
  git submodule init
  git submodule update src/libshared

  cp "${srcdir}/timewarrior/ext/on-modify.timewarrior" "${srcdir}"
}

build() {
  cd "timewarrior"
  cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/usr .
  make
}

package() {
  cd "timewarrior"
  make DESTDIR="${pkgdir}/" install

  install -Dm644 "${srcdir}/on-modify.timewarrior" \
    "${pkgdir}/usr/share/doc/timew/on-modify.timewarrior"

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}