pkgname="zlib"
pkgver="1.3.1"
pkgdesc='Compression library implementing the deflate compression method found in gzip and PKZIP'
homepage="https://www.zlib.net/"
license=("Zlib")
sources=("zlib-1.3.1.tar.gz")
urls=("https://zlib.net/fossils/${sources[0]}")
md5sums=("9855b6d802d7fe5b7bd5b196a2271655")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  ./configure --prefix=/usr
  make
}

src_check() {
  make check
}

src_install() {
  make DESTDIR="${pkgdir}/" install &&
  rm -fv "${pkgdir}/usr/lib/libz.a"
}
