summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b9c690d0642f7ed40d7fa4c472190f25281108d (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
# Maintainer: Andy Weidenbaum <archbaum@gmail.com>

pkgname=dcrdata-git
pkgver=20180228
pkgrel=1
pkgdesc="Decred block explorer"
arch=('aarch64' 'armv6h' 'armv7h' 'i686' 'x86_64')
makedepends=('dep' 'git' 'go')
groups=('decred')
url="https://github.com/decred/dcrdata"
license=('ISC')
options=('!strip' '!emptydirs')
source=(git+https://github.com/decred/dcrdata)
sha256sums=('SKIP')
provides=('dcrdata')
conflicts=('dcrdata')

pkgver() {
  date +%Y%m%d
}

prepare() {
  export GOPATH="$srcdir"
  git clone "$srcdir/dcrdata" "$GOPATH/src/github.com/decred/dcrdata"
}

build() {
  export GOPATH="$srcdir"

  msg2 'Building dcrdata and dependencies...'
  cd "$GOPATH/src/github.com/decred/dcrdata"
  dep ensure -v
  go install . ./cmd/...
}

package() {
  msg2 'Installing license...'
  install -Dm 644 "$srcdir/src/github.com/decred/dcrdata/LICENSE" \
          -t "$pkgdir/usr/share/licenses/dcrdata"

  msg2 'Installing docs...'
  for _doc in CODE_OF_CONDUCT \
              CONTRIBUTING.md \
              README.md \
              sample-dcrdata.conf \
              sample-nginx.conf \
              sample-rate_limiting.html; do
    install -Dm 644 "$srcdir/src/github.com/decred/dcrdata/$_doc" \
            -t "$pkgdir/usr/share/doc/dcrdata"
  done

  msg2 'Installing...'
  install -Dm 755 "$srcdir/bin"/* -t "$pkgdir/usr/bin"
}