#

pkgname=jupyter-nbextension-rise
_name=rise
pkgver=5.7.1
pkgrel=8
pkgdesc='RISE: "Live" Reveal.js Jupyter/IPython Slideshow Extension'
arch=(any)
url="https://github.com/damianavila/RISE"
license=('BSD')
conflicts=(python-rise jupyter-rise)
provides=(python-rise jupyter-rise)
depends=('jupyter-notebook')
makedepends=('python' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
sha256sums=('641db777cb907bf5e6dc053098d7fd213813fa9a946542e52b900eb7095289a6')

build() {
  cd rise-$pkgver

  python setup.py build
}

package() {
  cd rise-$pkgver
  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build

  install -D -m644 LICENSE.md "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"

  # No need to call `jupyter nbextension install rise`, it is handled in setup.py
  # however, change the path from /usr/etc to /etc
  mv "$pkgdir/"{usr/etc,etc}

  pymin_ver=$(python -c 'import sys; print(sys.version_info.minor)')
  ((pynext_min=pymin_ver + 1))
  depends+=("python>=3.${pymin_ver}.0" "python<3.${pynext_min}.0")
}
