summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3781a3aeeee21580dbba33117b61ae7f628e5097 (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
# Maintainer: Luis Martinez <luis dot martinez at tuta dot io>

pkgname=diary-git
pkgver=r24.d9bfeac
pkgrel=1
pkgdesc="Encrypted memories -- a journal program with local encryption support"
arch=('x86_64')
url="https://github.com/actuday6418/diary"
license=('GPL3')
depends=('gcc-libs')
makedepends=('cargo' 'git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url")
sha256sums=('SKIP')

pkgver() {
  cd "$pkgname"
  (
    set -o pipefail
    git describe --long --tags 2> /dev/null | sed 's/^v//;s/-/.r/;s/-/./' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "$pkgname"
  cargo build --release --locked --all-features --target-dir=target
}

check() {
  cd "$pkgname"
  cargo test --release --locked --target-dir=target
}

package() {
  cd "$pkgname"
  install -Dvm 755 target/release/diary -t "$pkgdir/usr/bin/"
  install -Dvm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}