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

_realname='MIME-tools'
pkgname="perl-${_realname}"
pkgver=5.518
pkgrel=1
pkgdesc='Parses streams to create MIME entities'
arch=('any')
url='https://metacpan.org/dist/MIME-tools'
msys2_repository_url='https://git.skoll.ca/Skollsoft-Public/mime-tools'
msys2_changelog_url='https://metacpan.org/dist/MIME-tools/changes'
msys2_references=(
  'anitya: 11809'
  'archlinux: perl-mime-tools'
  'gentoo: dev-perl/MIME-tools'
  'purl: pkg:cpan/DSKOLL/MIME-tools'
)
license=(
  'spdx:Artistic-1.0-Perl'
  'spdx:GPL-1.0-or-later'
)
depends=(
  'perl-Convert-BinHex'
  'perl-IO-Stringy'
  'perl-MailTools'
)
options=('!emptydirs')
provides=(
  'perl-MIME-Body=5.428.0'
  'perl-MIME-Decoder'
  'perl-MIME-Decoder-Base64'
  'perl-MIME-Decoder-Binary'
  'perl-MIME-Decoder-Binhex'
  'perl-MIME-Decoder-Quotedprint'
  'perl-MIME-Decoder-gzip64'
  'perl-MIME-Decoder-nbit'
  'perl-MIME-decoder-uu'
  'perl-MIME-Entity'
  'perl-MIME-Field-Contdisp=5.428.0'
  'perl-MIME-Field-Contraenc=5.428.0'
  'perl-MIME-Field-Conttype=5.428.0'
  'perl-MIME-Field-Paramval=5.428.0'
  'perl-MIME-Head=5.428.0'
  'perl-MIME-Parser'
  'perl-MIME-Parser-Filer'
  'perl-MIME-Parser-Reader'
  'perl-MIME-Parser-Results'
  'perl-MIME-WordDecoder'
  'perl-MIME-Words=5.428.0'
)
source=("https://www.cpan.org/authors/id/D/DS/DSKOLL/${_realname}-${pkgver}.tar.gz")
sha256sums=('4c1dd6316c13df6f897bd33ec82b13e2228cb80a420a264d320aead21acd123e')

build() {
  cd "${_realname}-${pkgver}"

  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

package() {
  cd "${_realname}-${pkgver}"

  make install DESTDIR="${pkgdir}"
}
