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

_realname=File-Which
pkgname=perl-${_realname}
pkgver=1.18
pkgrel=1
pkgdesc="Portable implementation of which"
arch=('any')
url="http://search.cpan.org/dist/File-Which"
groups=('perl-modules')
depends=('perl' 'perl-Test-Script>=1.05')
license=('GPL' 'PerlArtistic')
source=("http://www.cpan.org/authors/id/P/PL/PLICEASE/${_realname}-${pkgver}.tar.gz"
        'File-Which-1.09.patch')
md5sums=('554bfb36568d828fbeee64f4b9a9faa8'
         '24762366105449a2b808ebcb105ca1db')

prepare() {
  cd "$srcdir/${_realname}-${pkgver}"
  patch -p1 -i ${srcdir}/File-Which-1.09.patch
}

build() {
  cd "$srcdir/${_realname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

package() {
  cd "$srcdir/${_realname}-${pkgver}"
  make install DESTDIR="$pkgdir"
}
