# $ID$
# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname=perl-tie-cycle
_dist=Tie-Cycle
pkgver=1.225
pkgrel=6
pkgdesc="Cycle through a list of values via a scalar"
arch=('any')
url="https://metacpan.org/release/${_dist}"
license=('PerlArtistic' 'GPL')
depends=('perl')
checkdepends=('perl-test-pod' 'perl-test-pod-coverage')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/B/BD/BDFOY/${_dist}-${pkgver}.tar.gz)
md5sums=('260fd7edbfefd14b40d27234cd59b6ee')
sha256sums=('f330d821694af9b269b6083570d5c10ea22e6eb3b21841048ce28252b1c03d45')

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"
}
