# Maintainer: Konstantin Gizdov <arch at kge dot pw>
pkgname=perl-locale-codes
pkgver=3.85
pkgrel=1
pkgdesc='Distribution of modules to handle locale codes'
_dist=Locale-Codes
arch=('any')
url="https://metacpan.org/release/${_dist}"
license=('GPL' 'PerlArtistic')
depends=(perl)
checkdepends=('perl-test-inter')
options=('!emptydirs' purge)
source=("https://search.cpan.org/CPAN/authors/id/SBECK/${_dist}-${pkgver}.tar.gz")
b2sums=('c6d4349bd741dbd4dcd198401c49946aa57d42974be242421b4683e21d4dcb9715c7e267b2cf719d2194ffdc1f985682c5755fdd355852c3a26f51fc58c10fef')

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

check() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd "${srcdir}/${_dist}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
