# Maintainer: Rémy Oudompheng <remy@archlinux.org>
# Contributor: Mateusz Krasowski <matkras@gmail.com>
# Contributor: Luigi ranghetti <ggranga@gmail.com>
# Generator  : CPANPLUS::Dist::Arch 1.25

pkgname='perl-autovivification'
_dist="autovivification"
pkgver=0.18
pkgrel=12
pkgdesc="Lexically disable autovivification."
arch=('x86_64')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl>=5.8.3')
makedepends=()
url='https://metacpan.org/release/autovivification'
source=("https://www.cpan.org/authors/id/V/VP/VPIT/autovivification-$pkgver.tar.gz")
sha256sums=('2d99975685242980d0a9904f639144c059d6ece15899efde4acb742d3253f105')

build() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1
    make test
}

package() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
