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

_realname=YAML
pkgname=perl-${_realname}
pkgver=1.30
pkgrel=1
pkgdesc="Perl/CPAN Module YAML : YAML Aint Markup Language"
arch=('any')
url="https://metacpan.org/${_realname}/"
groups=('perl-modules')
license=('GPL' 'PerlArtistic')
depends=('perl')
checkdepends=('perl-Test-Deep' 'perl-Test-YAML')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/T/TI/TINITA/${_realname}-${pkgver}.tar.gz)
sha256sums=('5030a6d6cbffaf12583050bf552aa800d4646ca9678c187add649227f57479cd')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"

  # install module in vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

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

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