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

pkgname=counterwallet-git
pkgver=20160124
pkgrel=1
pkgdesc="Counterparty web wallet"
arch=('any')
makedepends=('bower' 'git' 'nodejs-grunt-cli' 'npm')
optdepends=('counterblockd-git: extended API services'
            'openresty: web app server')
groups=('counterparty')
url="https://github.com/CounterpartyXCP/counterwallet"
license=('CDDL')
source=(git+https://github.com/CounterpartyXCP/counterwallet)
sha256sums=('SKIP')
provides=('counterwallet')
conflicts=('counterwallet')
options=('!strip')
install=counterwallet.install

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

prepare() {
  cd ${pkgname%-git}

  msg2 'Configuring counterwallet.conf.json for no Transifex lookups...'
  cp -dpr --no-preserve=ownership counterwallet.conf.json.example counterwallet.conf.json
  sed -i 's@"AVAIL.*@"AVAILABLE_LANGUAGES": ["en"],@' counterwallet.conf.json
}

build() {
  cd ${pkgname%-git}

  msg2 'Fetching Web assets...'
  pushd src && bower install --allow-root --config.interactive=false && popd

  msg2 'Fetching NPM dependencies...'
  npm install

  msg2 'Building the static site...'
  grunt build
}

package() {
  cd ${pkgname%-git}

  msg2 'Installing...'
  install -dm 755 "$pkgdir/srv/http/counterwallet"
  tar -c . | tar -x -C "$pkgdir/srv/http/counterwallet"

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