# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Jonathan Steel <jsteel at aur.archlinux.org>
# Contributor: Alan Young <harleypig@gmail.com>

pkgname=perl-module-find
_cpanname=Module-Find
pkgver=0.17
pkgrel=2
pkgdesc="Find and use installed perl modules in a (sub)category"
url='https://search.cpan.org/dist/Module-Find'
arch=('any')
license=('PerlArtistic' 'GPL')
depends=('perl')
checkdepends=('perl-test-pod' 'perl-test-pod-coverage')
options=('!emptydirs')
source=(${pkgname}-${pkgver}.tar.gz::https://search.cpan.org/CPAN/authors/id/C/CR/CRENZ/${_cpanname}-${pkgver}.tar.gz)
sha512sums=('910026ed3f2f28bc7df46c3bfbc0b0d3eca5ae8edcab80a9a4923cea1929974ec94ee666e6d638f367ddb77ef8bb05073da00795c6845906b6ab03b5b9ec667a')

build() {
  cd ${_cpanname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${_cpanname}-${pkgver}
  make test
}

package() {
  cd ${_cpanname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 README "${pkgdir}/usr/share/doc/${pkgname}/README"
  install -Dm 644 examples/* -t "${pkgdir}/usr/share/doc/${pkgname}/examples"
}

# vim: ts=2 sw=2 et:
