Username: Password: Remember me
# Maintainer: Francesco Marinucci <franzmari [at] chakralinux [dot] org>
 
_pkgname=riot
pkgname=riot-web
pkgver=1.0.8
pkgrel=2
pkgdesc="A glossy Matrix collaboration client web version."
arch=('x86_64')
url="https://riot.im"
_url="https://github.com/vector-im/riot-web"
license=('Apache')
makedepends=('npm' 'git' 'yarn')
source=($_pkgname-$pkgver.tar.gz::"$_url/archive/v$pkgver.tar.gz")
#        $_pkgname-$pkgver.tar.gz.asc::"$_url/releases/download/v$pkgver/v$pkgver-src.tar.gz.asc")
sha256sums=('f1c2711f3f177a4285d8d0e6bf664127aaf3e763f16bac5e36b46a1fff65db32')
#validpgpkeys=('6FEB6F83D48B93547E7DFEDEE019645248E8F4A1') # riot.im (Package Signing key) <packages@riot.im>
 
prepare() {
  cd $_pkgname-web-$pkgver
  sed -i 's@https://riot.im/download/desktop/update/@null@g' electron_app/riot.im/config.json
}
 
build() {
  cd $_pkgname-web-$pkgver
  npm install --cache ../npm-cache
  npm run build --cache ../npm-cache
}
 
package() {
 
  cd $_pkgname-web-$pkgver
 
  install -d "$pkgdir"/{usr/share/webapps,etc/webapps}/$_pkgname
 
  cp -r webapp/* $pkgdir/usr/share/webapps/$_pkgname/
  install -Dm644 config.sample.json -t "$pkgdir"/etc/webapps/$_pkgname/
  ln -s /etc/webapps/$_pkgname/config.json "$pkgdir"/usr/share/webapps/$_pkgname/
  echo "$pkgver" > "$pkgdir"/usr/share/webapps/$_pkgname/version
}