archrelease: copy trunk to extra-x86_64
[arch-packages.git] / zlib / repos / core-x86_64 / PKGBUILD
blob8a3d69efbb9f23e2a290afb83abb865616480961
1 # Maintainer: Pierre Schmitz <pierre@archlinux.de>
3 pkgbase=zlib
4 pkgname=(zlib minizip)
5 epoch=1
6 pkgver=1.2.12
7 pkgrel=2
8 arch=('x86_64')
9 license=('custom')
10 url="https://www.zlib.net/"
11 depends=('glibc')
12 options=('staticlibs')  # needed by binutils testsuite
13 source=("https://zlib.net/zlib-${pkgver}.tar.gz"{,.asc}
14         $pkgname-handle-incorrect-crc-inputs.patch::https://github.com/madler/zlib/commit/ec3df00224d4.patch)
15 sha256sums=('91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9'
16             'SKIP'
17             '00e023c3ccb7b895ebb3421970b1b77f8a527b40190f35050b79fd0e817a7b0c')
18 validpgpkeys=('5ED46A6721D365587791E2AA783FCD8E58BCAFBA')
20 prepare() {
21         cd "${srcdir}/zlib-$pkgver"
22         grep -A 24 '^  Copyright' zlib.h > LICENSE
24         # https://github.com/madler/zlib/issues/613
25         patch -Np1 -i ../$pkgname-handle-incorrect-crc-inputs.patch
28 build() {
29         cd "${srcdir}/zlib-$pkgver"
31         CFLAGS+=" -ffat-lto-objects"
32         ./configure --prefix=/usr
33         make
35         cd contrib/minizip
36         cp Makefile Makefile.orig
37         cp ../README.contrib readme.txt
38         autoreconf --install
39         ./configure --prefix=/usr --enable-static=no
40         make
43 check() {
44         cd "${srcdir}/zlib-$pkgver"
45         make test
47         cd contrib/minizip
48         make -f Makefile.orig test
51 package_zlib() {
52         pkgdesc='Compression library implementing the deflate compression method found in gzip and PKZIP'
54         cd "${srcdir}/zlib-$pkgver"
55         make install DESTDIR="${pkgdir}"
56         install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/zlib/LICENSE"
59 package_minizip() {
60         pkgdesc='Mini zip and unzip based on zlib'
61         depends=('zlib')
63         cd "${srcdir}/zlib-$pkgver/contrib/minizip"
64         make install DESTDIR="${pkgdir}"
65         install -D -m644 "${srcdir}/zlib-$pkgver/LICENSE" "${pkgdir}/usr/share/licenses/minizip/LICENSE"
67         # https://github.com/madler/zlib/pull/229
68         rm "${pkgdir}/usr/include/minizip/crypt.h"