# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=perl-try-tiny
pkgver=0.30
pkgrel=1
pkgdesc="Minimal try/catch with proper localization of \$@"
arch=('any')
url="http://search.cpan.org/dist/Try-Tiny"
license=('MIT')
depends=('perl')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/E/ET/ETHER/Try-Tiny-${pkgver}.tar.gz")
sha512sums=('f523736ab0504ca0f7150be312e62988c4b9473a9e8469b0746dc8364945e2922c64c92e95e6c2b5792c5d6399dabea3d00aa45c065155b95519d5658a07216c')

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

check() {
  cd Try-Tiny-${pkgver}
  make test
}

package() {
  cd Try-Tiny-${pkgver}
  make DESTDIR="$pkgdir" install
  # upstream typo :/
  install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}