# Maintainer: Renato Silva <br.renatosilva@gmail.com>

pkgname='vimpager'
pkgdesc='Use ViM as PAGER'
url='https://www.vim.org/scripts/script.php?script_id=1723'
msys2_repository_url="https://github.com/rkitover/vimpager"
msys2_references=(
  "anitya: 15644"
)
license=(BSD)
arch=(any)
pkgver=2.06.r382.gce697c4
pkgrel=1
depends=(vim sharutils)
makedepends=(git)
_commit="ce697c4cf34549796e1b533be3e337ca24b62c09"
source=("git+https://github.com/rkitover/vimpager.git#commit=${_commit}")
sha256sums=('ce4dde144e74df68b8f4010268b1740ff9276bcf30944e2e27ad90dd310f3b48')

pkgver() {
  cd "${srcdir}/vimpager"

  git describe --long "${_commit}" | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

build() {
  cd "${srcdir}/vimpager"
  make vimpager
}

package() {
  cd "${srcdir}/vimpager"
  make DESTDIR="${pkgdir}" SYSCONFDIR='/etc' PREFIX='/usr' install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
