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

_realname=Path-Tiny
pkgname=perl-${_realname}
pkgver=0.118
pkgrel=1
pkgdesc="File path utility"
arch=('any')
license=('GPL' 'PerlArtistic')
url="https://metacpan.org/release/Path-Tiny"
groups=('perl-modules')
depends=('perl>=5.8.1')
options=(!emptydirs)
source=(https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/${_realname}-${pkgver}.tar.gz)
sha256sums=('32138d8d0f4c9c1a84d2a8f91bc5e913d37d8a7edefbb15a10961bfed560b0fd')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  unset PERL5LIB PERL_MM_OPT
  /usr/bin/perl Makefile.PL
  make
}

check() (
  cd "${srcdir}/${_realname}-${pkgver}"
  export PERL_MM_USE_DEFAULT=1
  unset PERL5LIB
  make test
)
package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
  find "${pkgdir}" -name .packlist -o -name perllocal.pod -delete
}
