#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=diffutils
pkgver=3.9
pkgrel=01
pkgdesc='Utility programs used for creating patch files'
arch=('x86_64')
groups=( jobbot )
url='https://www.gnu.org/software/diffutils'
depends=('glibc' 'bash')
source=("https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig}
        01-fix-colors-test.patch
        02-fix-bug-where-D-does-not-work.patch)

prepare() {
  cd $pkgname-$pkgver
  # apply patch from the source array (should be a pacman feature)
  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = *.patch ]] || continue
    msg2 "Applying patch $src..."
    patch -Np1 < "../$src"
  done
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make
}

check() {
  cd $pkgname-$pkgver
  make check
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}

#---- license gpg-key sha256sums ----

license=('GPL3')

validpgpkeys=('155D3FC500C834486D1EEA677FD9FCCB000BEEEE') # Jim Meyering

sha256sums=(d80d3be90a201868de83d78dad3413ad88160cc53bcc36eb9eaf7c20dbf023f1  # diffutils-3.9.tar.xz
	0380dd1b297da094898c1c653dd3266def05c1492a794ec634e802976165ba3e  # diffutils-3.9.tar.xz.sig
	bc0b6db1f90808551e376b98a5f5e235b7a33d0f09a780a2d6be476f64678ef7  # 01-fix-colors-test.patch
	a96a96267b65b5a17b0acad2064f9edede3f54462146850f9f0b5ea8ef0e7bf4) # 02-fix-bug-where-D-does-not-work.patch


