summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a011541decd180ec9d1f1924cc0fbceb9419a58d (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
48
49
50
51
52
53
54
55
# Maintainer: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
# Contributor: kpcyrd <git@rxv.cc>
# Contributor: Ian Naval <ianonavy@gmail.com>

_pkgname=go-ipfs
pkgname=$_pkgname-git
pkgver=0.3.7.r2.gb30d9d4
pkgrel=1
pkgdesc='global versioned p2p merkledag file system'
url="https://github.com/ipfs/$_pkgname"
arch=('i686' 'x86_64' 'armv7h')
license=('MIT')
makedepends=('git' 'go')
optdepends=('fuse: for mounting/advanced use'
            'bash-completion: bash completion support')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("git+${url}.git")
md5sums=('SKIP')

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

prepare() {
  mkdir -p "$srcdir"/src/github.com/ipfs
  ln -s "$srcdir/$_pkgname" "$srcdir"/src/github.com/ipfs/go-ipfs
}

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

  cd "$srcdir"/src/github.com/ipfs/go-ipfs/cmd/ipfs

  msg2 'Installing dependencies...'
  go get -v ./...

  msg2 'Building binary...'
  go install -v
}

package() {
  msg2 'Packaging binary...'
  install -Dm 755 bin/ipfs "${pkgdir}/usr/bin/ipfs"

  msg2 'Packaging auxiliary files...'
  cd "$_pkgname"
  install -Dm 644 misc/completion/ipfs-completion.bash "${pkgdir}/etc/bash_completion.d/ipfs"
  install -Dm 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
  install -Dm 644 -t "${pkgdir}/usr/share/doc/${pkgname}" \
    README.md \
    CHANGELOG.md
}