summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c413c1c2c0c2a83dd7c64e3dc16b40e35d5e2148 (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
# Maintainer: xeruf <27jf at pm dot me>

_pkgname='synct'
pkgname="${_pkgname}-git"
pkgver=r25.3ee9c8e
pkgrel=1
pkgdesc='A POSIX shell client for the Syncthing REST API with personal idiosyncracies'
arch=('any')
url="https://github.com/xeruf/${_pkgname}"
license=('Unlicense')
depends=(coreutils grep curl bat)
provides=("${_pkgname}")
conflicts=("${_pkgname}")
optdepends=('git: merging in synct-diff'
            'jrnl: auto-merging journal conflicts'
            'emacs: merging with ediff in synct-diff')
source=("git+${url}")
sha512sums=('SKIP')

package() {
  cd "${srcdir}/${_pkgname}/"
  local bin="${pkgdir}/usr/bin"
  install -D --target-directory "$bin" ${_pkgname}*
  sed -i "s/Usage/${_pkgname} version ${pkgver}\n\0/" "$bin/${_pkgname}"
}

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