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

_realname=File-Which
pkgname=perl-${_realname}
pkgver=1.22
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=("https://www.cpan.org/authors/id/P/PL/PLICEASE/${_realname}-${pkgver}.tar.gz"
        'File-Which-1.09.patch')
sha256sums=('e8a8ffcf96868c6879e82645db4ff9ef00c2d8a286fed21971e7280f52cf0dd4'
            '1e5b9187b5af3589e298e486c9b53b0b3ec61dd058173aab168e551163be0e5e')

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