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

pkgbase=diffstat
pkgname=diffstat
pkgver=1.68
pkgrel=1
pkgdesc="Display a histogram of diff changes"
arch=('i686' 'x86_64')
url="https://invisible-island.net/diffstat"
makedepends=('autotools' 'gcc')
license=('spdx:MIT')
source=("https://invisible-mirror.net/archives/diffstat/diffstat-${pkgver}.tgz"{,.asc})
sha256sums=('89f9294a8ac74fcef6f1b9ac408f43ebedf8d208e3efe0b99b4acc16dc6582c7'
            'SKIP')
validpgpkeys=('19882D92DDA4C400C22C0D56CC2AF4472167BE03') # Thomas Dickey <dickey@invisible-island.net>

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

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

  export MSYSTEM=CYGWIN
  ./configure --build=${CHOST} \
    --prefix=/usr \
    --mandir=/usr/share/man
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR=${pkgdir}/ install
  install -Dm644 package/debian/copyright "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
