# Maintainer: Thore Bödecker <foxxx0@archlinux.org>
# Conntributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: François Charette <firmicus ατ gmx δοτ net>

pkgname=perl-mime-tools
pkgver=5.515
pkgrel=3
pkgdesc="Parses streams to create MIME entities"
arch=('any')
url="https://metacpan.org/pod/MIME::Tools"
license=('GPL' 'PerlArtistic')
depends=('perl-mailtools' 'perl-io-stringy' 'perl-convert-binhex')
checkdepends=('perl-test-deep')
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-gzip64'
	'perl-mime-decoder-nbit' 'perl-mime-decoder-quotedprint' '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/MIME-tools-${pkgver}.tar.gz")
sha512sums=('3a9bbc1b58762170bfb3ccdc2d5fda006fcfdb5eca6092555011819e9fd0b68f1b0a178c86dc7e95a2e6f8d89d6988b1c26823d06ca201859ddc87f9e37981db')

build() {
  cd  "${srcdir}/MIME-tools-${pkgver}"

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

check() {
  cd  "${srcdir}/MIME-tools-${pkgver}"
  export PERL_MM_USE_DEFAULT=1
  unset PERL5LIB
  make test
}

package() {
  cd  "${srcdir}/MIME-tools-${pkgver}"

  make install DESTDIR="${pkgdir}"
}
