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

_realname=Text-Diff
pkgname=perl-${_realname}
pkgver=1.45
pkgrel=1
pkgdesc="Text::CharWidth - Perform diffs on files and record sets"
arch=('any')
url="https://metacpan.org/${_realname}/"
groups=("perl-modules")
license=('GPLv2+' 'PerlArtistic')
depends=("perl" "perl-Algorithm-Diff" "perl-Exporter")
makedepends=("perl-ExtUtils-MakeMaker")
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/N/NE/NEILB/${_realname}-${pkgver}.tar.gz)
sha256sums=('e8baa07b1b3f53e00af3636898bbf73aec9a0ff38f94536ede1dbe96ef086f04')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
}

build() {
  cd "${srcdir}/${_realname}-${pkgver}"

  perl Makefile.PL INSTALLDIRS=vendor
  make
}

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

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