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

_perlmod='JSON'
pkgname="perl-${_perlmod}"
pkgver=4.03
pkgrel=1
pkgdesc="JSON (JavaScript Object Notation) encoder/decoder"
arch=('any')
url="https://metacpan.org/release/JSON"
license=('GPL' 'PerlArtistic')
groups=('perl-modules')
depends=('perl>=5.10.0')
options=('!emptydirs')
source=(http://search.cpan.org/CPAN/authors/id/I/IS/ISHIGAKI/JSON-${pkgver}.tar.gz)
sha256sums=('e41f8761a5e7b9b27af26fe5780d44550d7a6a66bf3078e337d676d07a699941')

build() {
  cd  "${srcdir}"/JSON-${pkgver}
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

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

package() {
  cd  "${srcdir}"/JSON-${pkgver}
  make install DESTDIR="${pkgdir}"
  find "${pkgdir}" -name '.packlist' -delete
  find "${pkgdir}" -name '*.pod' -delete
}
