# Description: Object interface for AF_INET|AF_INET6 domain sockets
# URL: https://metacpan.org/release/IO-Socket-INET6
# Maintainer: unmaintained
# Depends on: p5-socket6

name=p5-io-socket-inet6
version=2.73
release=1
source=(https://search.cpan.org/CPAN/authors/id/S/SH/SHLOMIF/IO-Socket-INET6-$version.tar.gz)

build() {
  cd IO-Socket-INET6-$version

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

    /usr/bin/perl Makefile.PL
    make
  )

  make DESTDIR=$PKG install

  #Remove perlcrap
  find $PKG -type f \( \
    -name '.packlist' -or \
    -name '*.bs' -or \
    -name 'autosplit.ix' -or \
    -name 'perllocal.pod' \) -delete

  # Remove empty directories
  find $PKG -depth -empty -exec rm -rf {} \;
}
