# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=TermReadKey
pkgname=perl-${_realname}
pkgver=2.38
pkgrel=2
pkgdesc="Provides simple control over terminal driver modes"
arch=('i686' 'x86_64')
license=('custom')
depends=('perl')
url="https://metacpan.org/author/JSTOWE${_realname}/"
groups=('perl-modules')
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/J/JS/JSTOWE/${_realname}-${pkgver}.tar.gz)
sha256sums=('5a645878dc570ac33661581fbb090ff24ebce17d43ea53fd22e105a856a47290')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  install -d "${pkgdir}/usr/share/licenses/${pkgname}/"
  head -7 README > "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
