summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 47662368acffb8f20cc8f7a321827e28524f5acc (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
# Maintainer: Kevin MacMartin <prurigro@gmail.com>

_pkgname=gitsync
pkgname=$_pkgname-git
pkgver=20170221.r37.e2f08a5
pkgrel=1
pkgdesc='Git repository syncronisation daemon'
url='https://github.com/raybejjani/gitsync'
license=('BSD')
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
depends=('glibc')
makedepends=('git' 'go' 'make' 'python2')
source=("git://github.com/raybejjani/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname
  printf "%s.r%s.%s" "$(git show -s --format=%ci master | sed 's/\ .*//g;s/-//g')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  sed -i 's|/usr/bin/env python|/usr/bin/env python2|g' "$_pkgname/build-util/make_code_fs.py"
}

build() {
  cd $_pkgname
  export GOPATH="$srcdir/$_pkgname"
  go get -tags='makebuild' github.com/raybejjani/gitsync/gitsyncd
  make all
}

package() {
  install -Dm755 $_pkgname/bin/${_pkgname}d "${pkgdir}/usr/bin/${_pkgname}d"
  install -Dm644 $_pkgname/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}