# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: kevin <kevin@archlinux.org>

pkgname=perl-string-shellquote
_realname=String-ShellQuote
pkgver=1.04
pkgrel=6
pkgdesc="Quote strings for passing through the shell"
arch=('any')
license=('GPL')
url="https://search.cpan.org/dist/${_realname}/"
depends=('perl')
replaces=('string-shellquote')
options=('!emptydirs')
source=("https://search.cpan.org/CPAN/authors/id/R/RO/ROSCH/$_realname-$pkgver.tar.gz")
md5sums=('da6329dc482b21adf5697cfbd2ac5412')

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  # install module in vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

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

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

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