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

_realname=LWP-MediaTypes
pkgname=perl-${_realname}
pkgver=6.04
pkgrel=2
pkgdesc="Guess the media type of a file or a URL"
arch=('any')
url="https://metacpan.org/release/LWP-MediaTypes"
msys2_references=(
  "purl: pkg:cpan/OALDERS/LWP-MediaTypes"
)
groups=('perl-modules')
depends=('perl')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/O/OA/OALDERS/${_realname}-${pkgver}.tar.gz)
sha256sums=('8f1bca12dab16a1c2a7c03a49c5e58cce41a6fec9519f0aadfba8dad997919d9')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

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

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