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

_realname=IO-Socket-IP
pkgname="perl-${_realname}"
pkgver=0.41
pkgrel=1
pkgdesc="Family-neutral IP socket supporting both IPv4 and IPv6"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
makedepends=()
url='https://metacpan.org/release/IO-Socket-IP'
groups=('perl-modules')
source=("https://www.cpan.org/authors/id/P/PE/PEVANS/${_realname}-${pkgver}.tar.gz")
sha256sums=('849a45a238f8392588b97722c850382c4e6d157cd08a822ddcb9073c73bf1446')

build() {
  cd "${_realname}-${pkgver}"
  /usr/bin/perl Build.PL INSTALLDIRS=vendor
  ./Build
}

check() {
  cd "${_realname}-${pkgver}"
  ./Build test
}

package() {
  cd "${_realname}-${pkgver}"
  #./Build DESTDIR="$pkgdir" install
  ( export PERL_AUTOINSTALL=--skipdeps                       \
      PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"     \
      PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'"
    ./Build install
  )
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
