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

_realname=Encode-Locale
pkgname=perl-${_realname}
pkgver=1.05
pkgrel=2
pkgdesc="Determine the locale encoding"
arch=('any')
license=(PerlArtistic GPL)
options=('!emptydirs')
depends=('perl>=5.008')
makedepends=()
checkdepends=()
groups=('perl-modules')
conflicts=('perl-libwww<6')
url="https://metacpan.org/dist/Encode-Locale"
source=(https://www.cpan.org/authors/id/G/GA/GAAS/${_realname}-${pkgver}.tar.gz)
sha256sums=('176fa02771f542a4efb1dbc2a4c928e8f4391bf4078473bd6040d8f11adb0ec1')

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

    cd "${_realname}-${pkgver}"
    /usr/bin/perl Makefile.PL
    make
  )
}

check() {
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    cd "${_realname}-${pkgver}"
    make test
  )
}

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