# $Id: PKGBUILD 65945 2012-02-22 13:54:00Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=perl-test-pod-coverage
pkgver=1.08
pkgrel=2
pkgdesc="CPAN Test::Pod::Coverage module"
arch=('any')
url="http://search.cpan.org/dist/Test-Pod-Coverage/"
license=('PerlArtistic')
depends=('perl-pod-coverage')
options=(!emptydirs)
source=("http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/Test-Pod-Coverage-$pkgver.tar.gz")
md5sums=('33405cca7c75b7b89c06ba30eea66692')

build() {
  _dir=$(find $srcdir -maxdepth 2 -type f -name 'Makefile.PL')
  if [ ! -z "$_dir" ]; then
    cd $(dirname "$_dir")
    PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
    make 
    make install DESTDIR="${pkgdir}"

  else
  _dir=$(find $srcdir -maxdepth 2 -type f -name 'Build.PL')
  if [ ! -z "$_dir" ]; then
    cd $(dirname "$_dir")
    PERL_MM_USE_DEFAULT=1 perl Build.PL INSTALLDIRS=vendor
    ./Build 
    ./Build install destdir=${pkgdir}

  else
    echo "error: failed to detect build method for $pkgname"
    echo "you may be able to fix this by editing the PKGBUILD"
    return 1
  fi fi

  # remove perllocal.pod and .packlist
  find ${pkgdir} -name perllocal.pod -delete
  find ${pkgdir} -name .packlist -delete
}
