summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0b2b20136a59bcd1bd2cea9b72f03580fe692be6 (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
_pkgname=duplicacy
pkgname=$_pkgname-git
pkgver=r2
pkgrel=1
pkgdesc="A new generation cloud backup tool based on lock-free deduplication"
arch=('x86_64' 'i686')
url="https://duplicacy.com/"
license=('custom')
depends=('glibc')
makedepends=('go' 'git')
source=("git+https://github.com/gilbertchen/duplicacy")
sha256sums=('SKIP')
provides=("$_pkgname")
conflicts=("$_pkgname")

pkgver () {
  cd "$srcdir/$_pkgname"
  printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
  cd "$_pkgname/$_pkgname"

  mkdir -p "src/github.com/gilbertchen"
  ln -nsf "$srcdir/$_pkgname" "src/github.com/gilbertchen/$_pkgname"

  GOPATH="$srcdir/$_pkgname/$_pkgname" go get -d -v
}

build() {
  cd "$_pkgname/$_pkgname"

  GOPATH="$srcdir/$_pkgname/$_pkgname" go build -x
}

check() {
  cd "$_pkgname/$_pkgname"

  GOPATH="$srcdir/$_pkgname/$_pkgname" go test -v -x
}

package() {
  cd "$_pkgname"

  install -Dm755 "$_pkgname/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
  install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}