Username: Password: Remember me
# Maintainer: Francesco Marinucci <franzmari [at] chakralinux [dot] org>
 
_pkgname=riot
pkgname=riot-web
pkgver=1.0.3
pkgrel=1
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')
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=('08fb87299b2589c93760112c03edc3a8e4962b966d78c1fe56bf39f97323d02a')
#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
}