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

_realname=IPC-Run3
pkgname=perl-${_realname}
pkgver=0.048
pkgrel=1
pkgdesc="run a subprocess with input/ouput redirection"
arch=('any')
url="https://github.com/rjbs/ipc-run3/"
groups=('perl-modules')
depends=('perl')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
source=("https://www.cpan.org/authors/id/R/RJ/RJBS/${_realname}-${pkgver}.tar.gz"
        'IPC-Run3-0.045.patch')
sha256sums=('3d81c3cc1b5cff69cca9361e2c6e38df0352251ae7b41e2ff3febc850e463565'
            'ec8de83d7fab02bf68ac660893c64063e13681eefb5b57a0999ee2e752e97e75')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
  patch -p1 -i ${srcdir}/IPC-Run3-0.045.patch
}

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

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

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