summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9b781c46936aa3116940333897b9c68b39bcbb8a (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
# Maintainer:  Nicholas Wang <me#nicho1as.wang>

pkgname=tunasync-git
pkgver=20240403.r476.938f67c
pkgrel=1
pkgdesc="Mirror job management tool developed by TUNA"
url="https://github.com/tuna/tunasync"
arch=('x86_64')
license=('GPL3')
depends=('glibc')
makedepends=('git' 'go')
replaces=('tunasync-bin')
conflicts=('tunasync-bin')
provides=('tunasync' 'tunasynctl')
source=('tunasync::git+https://github.com/tuna/tunasync#branch=master')
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}"/tunasync
  printf "%s.r%s.%s" "$(git log -1 --format="%cd" --date=short | sed 's/-//g')" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

build() {
  cd "${srcdir}"/tunasync
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie"
  export GOPATH="${srcdir}"
  make
}

package() {
  install -Dm755 "${srcdir}"/tunasync/build-linux-amd64/tunasync "${pkgdir}"/usr/bin/tunasync
  install -Dm755 "${srcdir}"/tunasync/build-linux-amd64/tunasynctl "${pkgdir}"/usr/bin/tunasynctl
}