summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fe2d200124f0863941af843cf1416873838ab2ef (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
56
57
58
59
60
61
62
# Maintainer: Andy Weidenbaum <archbaum@gmail.com>

pkgname=insight-bitcore-git
pkgver=20150805
pkgrel=1
pkgdesc="Bitcoin blockchain explorer with complete REST and websocket APIs"
arch=('i686' 'x86_64')
depends=('leveldb' 'nodejs')
makedepends=('bower' 'git' 'nodejs-grunt-cli' 'npm' 'python2')
optdepends=('bitcoin-core: Bitcoin core headless P2P node')
url="https://github.com/bitpay/insight"
license=('MIT')
source=(git+https://github.com/bitpay/insight
        insight.conf
        insight.service)
sha256sums=('SKIP'
            'ba78afbd00a873a0447a78c2661d5ea64137648c92a9d7b4f8d88817453e9283'
            'e39b630e18423dbb1868438814e7ac5e31e0b3908df97891b418083941adccb7')
provides=('insight-bitcore')
conflicts=('insight-bitcore')
options=('!strip')
install=insight.install

pkgver() {
  cd ${pkgname%-bitcore*}
  git log -1 --format="%cd" --date=short | sed "s|-||g"
}

build() {
  cd ${pkgname%-bitcore*}

  msg2 'Fetching NPM dependencies...'
  npm install --python=python2

  msg2 'Fetching Web assets...'
  bower install --allow-root --config.interactive=false

  msg2 'Compiling Web assets...'
  grunt compile
}

package() {
  cd ${pkgname%-bitcore*}

  msg2 'Installing docs...'
  install -Dm 644 README.md "$pkgdir/usr/share/doc/insight/README.md"

  msg2 'Installing...'
  install -dm 700 "$pkgdir/usr/share/insight/db"
  find . -mindepth 1 -maxdepth 1 -exec \
    cp -dpr --no-preserve=ownership '{}' "$pkgdir/usr/share/insight" \;

  msg2 'Installing insight.conf...'
  install -Dm 600 "$srcdir/insight.conf" "$pkgdir/etc/conf.d/insight"

  msg2 'Installing insight.service...'
  install -Dm 644 "$srcdir/insight.service" "$pkgdir/usr/lib/systemd/system/insight.service"

  msg2 'Cleaning up pkgdir...'
  find "$pkgdir" -type d -name .git -exec rm -r '{}' +
  find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' +
}