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

_realname=Module-Build
pkgname=perl-${_realname}
pkgver=0.4231
pkgrel=1
pkgdesc="Build, test, and install Perl modules"
arch=('any')
url="https://metacpan.org/release/Module-Build"
license=('PerlArtistic' 'GPL')
depends=('perl>=5.8.0' 'perl-CPAN-Meta>=2.142060' 'perl-inc-latest')
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/L/LE/LEONT/${_realname}-${pkgver}.tar.gz
        module-build-0.4224-msysize.patch)
sha512sums=('ee1dc18a7df3fe67e7f954d5e1e071aa0a6f5bce6783b768bceb01f071e64ac8be63f410c932c7c16764e5d4f52fc664ce11a12f26f6afc75a26f79883efad70'
            'cc88c8b6f52140033073391b95abff08ecd9fad588cc2a4ea655e21ec9d2271faa53f5e1960f63196c6921a00e872db559b6e7104fb9c3e97e7d47b87492f89d')

prepare() {
  cd ${_realname}-${pkgver}
  patch -p1 -i ${srcdir}/module-build-0.4224-msysize.patch
}

build() {
  cd ${_realname}-${pkgver}
  perl Build.PL installdirs=vendor
  perl Build
}

check() {
  cd ${_realname}-${pkgver}
  perl Build test
}

package() {
  cd ${_realname}-${pkgver}
  perl Build install destdir="${pkgdir}"
}
