summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dce6e307b4f47c49faad9d908fb81f7cc5af5660 (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: Hans-Nikolai Viessmann <hv15@hw.ac.uk>

_pkgname=spideroak-systemd
pkgname=${_pkgname}-git
pkgdesc="Systemd service for SpiderOak-One"
pkgver=r20.cc2366a
pkgrel=1
arch=('any')
url="https://github.com/hv15/${_pkgname}"
license=('custom:CC0-1.0')
makedepends=('git')
depends=('spideroak-one')
install="${_pkgname}.install"
source=("${pkgname}::git+https://github.com/hv15/${_pkgname}.git"
        'spideroak-systemd.install')
md5sums=('SKIP'
         'f6884dd8db3619c7e184396b9cb8a164')

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

package() {
  cd "$pkgname"

  # systemd files
  install -Dm644 spideroak@.service "$pkgdir/usr/lib/systemd/system/spideroak@.service"
  install -Dm755 spideroak.sh "$pkgdir/usr/lib/systemd/scripts/spideroak"

  # example resource file
  install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  install -Dm644 .spideroak.rc "$pkgdir/usr/share/$pkgname/spideroak.rc.proto"

  # license
  install -Dm644 COPYING.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}