summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 234642ce169f9bc0ea2475847374537f09751b58 (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
# Maintainer: Ian Naval <ianonavy@gmail.com>

_pkgname=go-ipfs
pkgname=$_pkgname-git
pkgver=0.2.1
pkgrel=1
pkgdesc="global versioned p2p merkledag file system"
arch=('i686' 'x86_64')
url="https://github.com/jbenet/$_pkgname"
license=('MIT')
makedepends=('git' 'go')
optdepends=('fuse: for mounting/advanced use')
options=(!strip)
source=("git+${url}.git")
md5sums=('SKIP')

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

build() {
  # Required for go get
  export GOPATH=$srcdir

  # Make src directory for $GOPATH
  mkdir -p "$GOPATH/src"

  mv "$srcdir/$_pkgname" "$GOPATH/src"
  cd "$GOPATH/src/$_pkgname/cmd/ipfs"

  echo "Installing dependencies..."
  echo $GOPATH
  go get -v ./...
  echo "Building binary..."
  go install -v
}

package() {
  cd "$srcdir"

  installDir="$pkgdir/usr/bin"

  install -dm755 "$installDir"
  install -m755 "$srcdir/bin/ipfs" "$installDir/ipfs"
}