#!/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=gzip
pkgver=1.13
pkgrel=02
pkgdesc='GNU compression utility'
url='https://www.gnu.org/software/gzip/'
depends=('glibc' 'bash' 'coreutils' 'sed' 'grep')
optdepends=('less: zless support'
            'util-linux: zmore support'
            'diffutils: zdiff/zcmp support')
source=("https://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.xz"{,.sig})

prepare() {
  cd $pkgname-$pkgver
  # apply patch from the source array (should be a pacman feature)
  local filename
  for filename in "${source[@]}"; do
    if [[ "$filename" =~ \.patch$ ]]; then
      echo "Applying patch ${filename##*/}"
      patch -p1 -N -i "$srcdir/${filename##*/}"
    fi
  done
  :
}

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

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

package() {
  cd $pkgname-$pkgver
  make prefix="$pkgdir/usr" install
}

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=('GPL-3.0-or-later')

validpgpkeys=('155D3FC500C834486D1EEA677FD9FCCB000BEEEE') # Jim Meyering

sha256sums=(7454eb6935db17c6655576c2e1b0fabefd38b4d0936e0f87f48cd062ce91a057  # gzip-1.13.tar.xz
	aa752d6460fff2e0064857f1c6057d2dc49a28a45ad28c6b29c525851d6771f1) # gzip-1.13.tar.xz.sig

##  e1ffd3c828b6ba13a84c9eb290cdf4f3e2b69f536a5acc83df2d987ebed742e8  gzip-1.13-02-x86_64.pkg.tar.lz
