# Maintainer: Sébastien "Seblu" Luttringer <seblu@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=gzip
pkgver=1.14
pkgrel=2.2
pkgdesc='GNU compression utility'
arch=('x86_64' 'aarch64')
url='https://www.gnu.org/software/gzip/'
license=('GPL-3.0-or-later')
depends=('glibc' 'sh' 'coreutils' 'sed')
makedepends=('git' 'less' 'python' 'wget')
optdepends=('diffutils: zdiff/zcmp support'
            'grep: zegrep/zfgrep/zforce/zgrep support'
            'less: zless support'
            'util-linux: zmore support')
validpgpkeys=('155D3FC500C834486D1EEA677FD9FCCB000BEEEE') # Jim Meyering
source=("git+https://https.git.savannah.gnu.org/git/gzip.git#tag=v${pkgver}?signed"
        "git+https://https.git.savannah.gnu.org/git/gnulib.git")
sha256sums=('b1c2422ee156ef11e9601d2651f8543dd71f941887cd407fe23584ab95417c93'
            'SKIP')

prepare() {
  cd $pkgname

  git submodule init
  git config submodule.gnulib.url "${srcdir}/gnulib"
  git -c protocol.file.allow=always submodule update

  ./bootstrap
}

build() {
  cd $pkgname
  ./configure \
    --prefix=/usr \
    --disable-gcc-warnings
  make
}

check() {
  cd $pkgname
  make check
}

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