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

_realname=IO-HTML
pkgname=perl-${_realname}
pkgver=1.004
pkgrel=2
pkgdesc="Open an HTML file with automatic charset detection"
arch=('any')
url='https://metacpan.org/release/IO-HTML'
msys2_references=(
  "purl: pkg:cpan/CJM/IO-HTML"
)
groups=('perl-modules')
depends=('perl')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/C/CJ/CJM/${_realname}-$pkgver.tar.gz)
sha256sums=('c87b2df59463bbf2c39596773dfb5c03bde0f7e1051af339f963f58c1cbd8bf5')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL_MM_OPT="INSTALLDIRS=vendor" \
    PERL_MB_OPT="--installdirs vendor"
  cd ${_realname}-$pkgver
  perl Makefile.PL
  make
}

check() {
  cd ${_realname}-$pkgver
  make test
}

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