# Maintainer (AUR): John Jenkins twodopeshaggy@gmail.com
# Contributor (AUR): Gustavo Dutra <mechamo@gustavodutra.com>
# Contributor: André Silva <emulatorman@hyperbola.info>

# parabola changes and rationale:
#  - split package for icecat and iceweasel

pkgbase=vimperator
pkgname=('iceweasel-vimperator' 'icecat-vimperator')
license=("MIT")
pkgver=3.16.0
pkgrel=1
arch=('any')
url="http://vimperator.org/vimperator"
_extensionId="vimperator@mozdev.org"
_fileName=vimperator-$pkgver.xpi
source=(https://github.com/vimperator/vimperator-labs/releases/download/$pkgbase-$pkgver/$pkgbase-$pkgver.xpi)
md5sums=('e1a254894d0c39545e3a5f8fb2f1a8a3')
conflicts=('vimperator-hg' 'vimperator-git')

package_iceweasel-vimperator() {
  pkgdesc="Make iceweasel look and behave like Vim"
  depends=('iceweasel')
  cd $srcdir || return 1
  local dstdir=$pkgdir/usr/lib/iceweasel/browser/extensions/$_extensionId
  install -d $dstdir || return 1
  cp -R * $dstdir || return 1
  rm $dstdir/$_fileName
}

package_icecat-vimperator() {
  pkgdesc="Make icecat look and behave like Vim"
  depends=('icecat')
  cd $srcdir || return 1
  local dstdir=$pkgdir/usr/lib/icecat/browser/extensions/$_extensionId
  install -d $dstdir || return 1
  cp -R * $dstdir || return 1
  rm $dstdir/$_fileName
}
