summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a8bd7f92013cbdb30499d0b02b55947b4f5166a9 (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
# Maintainer: Bartłomiej Kamiński <bartlomiej.kaminski@maidsafe.net>
pkgname=safe-mail-tutorial
pkgver=0.4.0
pkgrel=1
pkgdesc="A tutorial app showcasing how to use the low level API from safe_app_nodejs library to build a simple email application."
arch=('i686' 'x86_64')
url="https://github.com/maidsafe/safe_examples"
license=('GPL3')
groups=('maidsafe')
depends=('safe-browser')
makedepends=('nvm')
optdepends=()
install=
changelog=
source=('https://github.com/maidsafe/safe_examples/archive/alpha-2.tar.gz')
md5sums=('9f2fd11606650443355a3641e8ba8cd6')

build() {
  # use nvm
  . /usr/share/nvm/nvm.sh

  # prepare nvm dir
  mkdir -p $HOME/.nvm-tmp
  export NVM_DIR=$HOME/.nvm-tmp
  nvm install 7.10.0

  # load dependencies for safe-browser
  cd "safe_examples-alpha-2/email_app"
  npm install
  npm run package

  nvm unload
  rm -rf $HOME/.nvm-tmp
}

package() {
  cd "safe_examples-alpha-2/email_app/out"
  mkdir -p "$pkgdir/opt/maidsafe"
  mkdir -p "$pkgdir/usr/bin"
  case $CARCH in
    "i686")
      mv safe-mail-tutorial-linux-x86 "$pkgdir/opt/maidsafe/$pkgname-$pkgver"
      ;;
    "x86_64")
      mv safe-mail-tutorial-linux-x64 "$pkgdir/opt/maidsafe/$pkgname-$pkgver"
      ;;
  esac
  ln -s "/opt/maidsafe/$pkgname-$pkgver/safe-mail-tutorial" "$pkgdir/usr/bin/safe-mail-tutorial"
}