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

pkgname=gzip
pkgver=1.11
pkgrel=1
pkgdesc="GNU compression utility"
arch=('i686' 'x86_64')
url="https://www.gnu.org/software/gzip/"
license=('GPL3')
groups=('compression')
depends=('bash' 'less')
install=gzip.install
source=(https://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.xz{,.sig}
        'gzip-1.6-msys2.patch')
sha256sums=('9b9a95d68fdcb936849a4d6fada8bf8686cddf58b9b26c9c4289ed0c92a77907'
            'SKIP'
            'b4a3417b3358a576c058dbdcc9e59576a96824d8d098f6d44215b4b96581ba74')
validpgpkeys=('155D3FC500C834486D1EEA677FD9FCCB000BEEEE') # Jim Meyering <jim@meyering.net>

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

  patch -p1 -i ${srcdir}/gzip-1.6-msys2.patch
  autoreconf -fiv
}

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

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check || true
}

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