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

_realname=IO-Socket-INET6
pkgname="perl-${_realname}"
pkgver=2.73
pkgrel=1
pkgdesc="Object interface for AF_INET|AF_INET6 domain sockets"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-Socket6>=0.12')
makedepends=()
url='https://metacpan.org/release/IO-Socket-INET6'
msys2_references=(
  "purl: pkg:cpan/SHLOMIF/IO-Socket-INET6"
)
groups=('perl-modules')
source=("https://www.cpan.org/authors/id/S/SH/SHLOMIF/${_realname}-${pkgver}.tar.gz")
sha256sums=('b6da746853253d5b4ac43191b4f69a4719595ee13a7ca676a8054cf36e6d16bb')

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() {
  cd "${_realname}-${pkgver}"
  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
    make test
  )
}

package() {
  cd "${_realname}-${pkgver}"
  make DESTDIR="$pkgdir" install
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
