# Maintainer: Ash Berlin-Taylor <ash_archlinux@firemirror.com>
pkgname='perl-yaml-pp'
pkgver=0.39.0
pkgrel=2
_distdir="YAML-PP-v$pkgver"
pkgdesc="Simple configuration automation"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl>=0')
makedepends=('perl-test-deep>=0' 'perl-test-warn>=0')
url='https://search.cpan.org/dist/YAML-PP'
source=("https://cpan.metacpan.org/authors/id/T/TI/TINITA/YAML-PP-v$pkgver.tar.gz")
sha512sums=('348a4c2e7efdaa407fb46d2a632c381d3655fe9b1eb4e557cc66eea8346e2e24013d2ff94601f25b47dfdd96b14b7f3fe7338f74668230a82f87495a756adf3c')

build() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""                 \
      PERL_AUTOINSTALL=--skipdeps                            \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
      MODULEBUILDRC=/dev/null

    cd "$srcdir/$_distdir"
    /usr/bin/perl Makefile.PL
    make
  )
}

check() {
  cd "$srcdir/$_distdir"
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    make test
  )
}

package() {
  cd "$srcdir/$_distdir"
  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
