# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Simon Perry <aur [at] sanxion [dot] net>
# Contributor: James Rayner <iphitus@gmail.com>
# Contributor: Andrew Simmons <andrew.simmons@gmail.com>

pkgname=perl-unicode-string
_realname=Unicode-String
pkgver=2.10
pkgrel=5
pkgdesc='String of Unicode characters for perl (UCS2/UTF16)'
arch=('x86_64')
license=('GPL')
url='https://metacpan.org/release/Unicode-String/'
depends=('perl')
options=('!emptydirs' purge)
source=("https://cpan.metacpan.org/authors/id/G/GA/GAAS/GAAS/Unicode-String-${pkgver}.tar.gz")
b2sums=('4d7769b74fd85e197aa1bf8a22a57f3dc519b30bb1c1d47fa1f1de6faeb47e2a0351a580a2c34c158b13a37a43d9e5b7864c2333143d335f129219efb5451857')

build() {
  cd Unicode-String-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}

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

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