# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Moritz Bunkus <moritz@bunkus.org>

pkgname='perl-encode-imaputf7'
pkgver=1.07
pkgrel=2
pkgdesc='Modification of UTF-7 encoding for IMAP'
arch=('any')
url='https://search.cpan.org/dist/Encode-IMAPUTF7'
license=('GPL')
checkdepends=(
  perl-test-nowarnings
)
options=(
  '!emptydirs'
  purge
)
source=(
  "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Encode-IMAPUTF7-${pkgver}.tar.gz"
)
b2sums=('bcaae4de251674000b68c02d5ecfbc1ddace32a49c1430960d7a660fcf1d963ca25f092bc1f54adf5b2a3271b717042dfe239c7593a0b7a7df97a35c110c2130')

build() {
  cd Encode-IMAPUTF7-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  /usr/bin/perl Makefile.PL
  make
}

check() {
  cd Encode-IMAPUTF7-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd Encode-IMAPUTF7-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  make install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
}
