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

_realname=Try-Tiny
pkgname=perl-${_realname}
pkgver=0.30
pkgrel=1
pkgdesc="Minimal try/catch with proper localization of \$@"
arch=('any')
url="https://metacpan.org/release/Try-Tiny"
groups=('perl-modules')
license=('MIT')
depends=('perl')
options=('!emptydirs')
source=("https://www.cpan.org/authors/id/E/ET/ETHER/${_realname}-${pkgver}.tar.gz")
sha256sums=('da5bd0d5c903519bbf10bb9ba0cb7bcac0563882bcfe4503aee3fb143eddef6b')

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

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

package() {
  cd ${_realname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
