Compare commits

...
Sign in to create a new pull request.

39 commits

Author SHA1 Message Date
Tulio Magno Quites Machado Filho
c93c81c630 Enable DFLTCC on s390x
Ensure DFLTCC is enabled on s390x for both deflate and inflate.
2025-12-12 10:36:45 -03:00
Packit
d5f7e25717 Update to 2.3.2 upstream release
- Resolves: rhbz#2418517

Upstream tag: 2.3.2
Upstream commit: 6d9f3dc0

Commit authored by Packit automation (https://packit.dev/)
2025-12-03 09:00:04 +00:00
Tulio Magno Quites Machado Filho
f8484b5212 Do not build CRC32 Chorba optimization on RHEL10+
RHEL 10 requires x86_64-v3. Meanwhile, CRC32 Chorba is used on x86_64-v2
and older processors.

[skip changelog]
2025-11-27 16:03:47 -03:00
Tulio Magno Quites Machado Filho
c8c1c8f78d Stop using riscv64 settings on other architectures
While having this parameter doesn't, it does generate extra warnings to
the build log.

[skip changelog]
2025-11-27 16:03:02 -03:00
Packit
39ebff5723 Update to 2.3.1 upstream release
- Resolves: rhbz#2417595

Upstream tag: 2.3.1
Upstream commit: 68c83bf4

Commit authored by Packit automation (https://packit.dev/)
2025-11-27 17:24:13 +00:00
Tulio Magno Quites Machado Filho
f27b6e0bd9 packit: Update the list of distros
Fedora 43 got branched, which changed the definition of the alias
`fedora-latest` to `fedora-43`.
Explicitly list `fedora-42` in order to continue receiving updates and
triggering builds and updates.

The plan is to replace these entries with `fedora-all` or
`fedora-branched` as soon as f41 reaches EOL.

[skip changelog]
2025-08-15 10:12:57 -03:00
Packit
f7b3208bc3 Update to 2.2.5 upstream release
- Resolves: rhbz#2387088

Upstream tag: 2.2.5
Upstream commit: 42543906

Commit authored by Packit automation (https://packit.dev/)
2025-08-07 16:11:19 +00:00
Tulio Magno Quites Machado Filho
5a637136c8 Remove rpmdeplint from gating
This test is only enabled on Rawhide and does not run on branched
targets causing errors in our Bodhi updates.
There is no way to require rpmdeplint only on Rawhide because Bodhi does
not understand the concept of Rawhide.

More information: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/QTAGRWMHZBQOXWI5S3O2JSYCDRU6IT4D/
2025-02-27 16:01:47 -03:00
Tulio Magno Quites Machado Filho
9bd0cafffb Enable -fPIC for static compat libraries
Generate static compat libraries with Position Independent Code in order
to let these files to be used when linking to shared libraries.
2025-02-25 15:47:41 -03:00
Packit
a60ec15249 Update to 2.2.4 upstream release
- Resolves: rhbz#2344792

Upstream tag: 2.2.4
Upstream commit: 860e4cff

Commit authored by Packit automation (https://packit.dev/)
2025-02-10 23:09:36 +00:00
Lukas Javorsky
f800f2b35a Convert to %autorelease and %autochangelog
[skip changelog]
2025-01-22 13:42:00 +00:00
Lukas Javorsky
8d47ac10f5 Setup Packit Bot
Jobs: koji_build, bodhi_update, pull_from_upstream
2025-01-22 13:32:30 +00:00
Fedora Release Engineering
744296cca7 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 16:49:59 +00:00
Tulio Magno Quites Machado Filho
45e28263cc Update to version 2.2.3 2025-01-08 13:44:39 -03:00
Tulio Magno Quites Machado Filho
92e84a48ac Add a script that regenerates rpminspect.yaml
Every new release we notice that annocheck finds a new file that can't
be built with LTO. These files may change between releases as new
optimizations are implemented or removed.

A script that can generate the configuration will make our lives easier
when the source code is updated.
2024-11-01 16:16:52 -03:00
Lukas Javorsky
cbac09d31a Rebase to new major version 2.2.2
Fedora Change proposal: https://fedoraproject.org/wiki/Changes/ZlibNG-2.2
2024-09-25 09:33:54 +00:00
Tulio Magno Quites Machado Filho
8a46722e37 Apply a patch that fixes rhbz#2307237
Resolves: rhbz#2307237
2024-09-10 15:26:39 -03:00
Fedora Release Engineering
d059a6fd32 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 10:55:16 +00:00
Tulio Magno Quites Machado Filho
4a9267d1a4 [rpminspect] Update the list of files skipped in annocheck/lto
1. Insert the relative path of the files as this is a new requirement.
2. Re-sort the list.
3. Add the new file arch/x86/chunkset_avx2.c .
2024-07-01 19:15:07 -03:00
Tulio Magno Quites Machado Filho
d93ca1c75c Update to zlib-ng 2.1.7
Resolves: rhbz#2293101
Resolves: rhbz#2293437
2024-06-21 11:09:59 -03:00
Cristian Le
be11cd3191 Avoid using vendor as a variable
See: https://bugzilla.redhat.com/show_bug.cgi?id=2284608
2024-06-04 10:25:33 -03:00
Tulio Magno Quites Machado Filho
91dc82514a Fix the bug refereced in changelog 2024-05-31 12:09:56 -03:00
Tulio Magno Quites Machado Filho
631bb70313 Set ownership of cmake directories
Fix #2283789.
2024-05-29 15:27:51 -03:00
Tulio Magno Quites Machado Filho
f538400c35 Skip more files from annocheck's LTO check
These files affect aarch64 and ppc64le.
2024-05-29 12:08:14 -03:00
Lukas Javorsky
883f5f7fa5 Whitelist the slide_hash_avx2.c from LTO check in rpminspect
LTO can't be enabled in some zlib-ng files because compilers may not use
all flags accordingly.
More information at https://github.com/zlib-ng/zlib-ng/pull/938
2024-05-29 08:42:40 +00:00
Tulio Magno Quites Machado Filho
48ad3b2cce Update the patch that fixes rhbz#2277782
Upstream requested changes to the original patch.
This is a backport from upstream's develop branch with changes in order
to apply to zlib-ng 2.1.6.
2024-05-21 11:40:17 -03:00
Tulio Magno Quites Machado Filho
3e4241ca5d Fix illegal instruction usage in Xeon Phi x200 processors
Backport https://github.com/zlib-ng/zlib-ng/pull/1723 from upstream.

Fix rhbz#2280347
2024-05-14 15:37:46 -03:00
David Abdurachmanov
d1582f9207 Disable RVV (vector) on riscv64
See this thread on Fedora devel for the motivation behind RISC-V
architecture support:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/FZW4677BWARAO7K3B4YJZDGWHKR5UECF/

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-02-14 14:38:33 +00:00
Fedora Release Engineering
7ec7e51cea Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-27 11:13:10 +00:00
Miroslav Suchý
85998011f0 Correct SPDX license
The name of the is Zlib https://spdx.org/licenses/Zlib
But the specification allows case-insensitive names, so it is just a nitpick.
2024-01-16 21:02:13 +00:00
Tulio Magno Quites Machado Filho
939027fc96 Enable extra gating tests
Run rpmdeplint, rpminspect and installability.
2024-01-12 15:52:01 -03:00
Lukas Javorsky
1be53a0787 Stop using INSTALL_LIB_DIR CMake macro, unused
Upstream discourages from using this macro, and it is not used in the
build
2024-01-11 13:33:03 +00:00
Lukas Javorsky
09df2e7a89 Rebase to version 2.1.6 2024-01-11 13:32:44 +00:00
Yaakov Selkowitz
ccf085c1ac Add zlib-ng-compat-static to replace zlib-static 2024-01-09 14:58:15 -05:00
Tulio Magno Quites Machado Filho
05f17dd963 Update to zlib-ng 2.1.5 2023-12-22 12:19:42 -03:00
Tulio Magno Quites Machado Filho
5e4a09ffbf Enable gating tests
Ensure the Fedora zlib-ng tests will be executed when packages are
pushed to testing or stable.
2023-12-20 18:57:12 -03:00
Jacek Szafarkiewicz
245d095d95 Add support for compat mode
Build zlib-ng twice in order to distribute the compat sub-packages that
can fully replace zlib (zlib-ng-compat and zlib-ng-compat-devel).

Run ABI tests provided by upstream during %check.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
2023-12-20 15:21:43 -03:00
Fedora Release Engineering
8057d05982 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 19:45:15 +00:00
Ali Erdinc Koroglu
3d326a85e2 Update to 2.1.3 2023-07-11 18:03:49 +03:00
12 changed files with 473 additions and 58 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

38
.packit.yaml Normal file
View file

@ -0,0 +1,38 @@
# We want to use the following Packit functions in the zlib-ng package:
# koji_build, bodhi_update, pull_from_upstream
# See the documentation for more information:
# https://packit.dev/docs/configuration/
specfile_path: zlib-ng.spec
# name in upstream package repository or registry (e.g. in PyPI)
upstream_package_name: zlib-ng
upstream_project_url: https://github.com/zlib-ng/zlib-ng/
# downstream (Fedora) RPM package name
downstream_package_name: zlib-ng
jobs:
- job: pull_from_upstream
trigger: release
dist_git_branches:
- fedora-latest
- fedora-42
- fedora-rawhide
- job: koji_build
trigger: commit
allowed_pr_authors: ["ljavorsk", "tuliom", "aekoroglu", "packit"]
allowed_committers: ["ljavorsk", "tuliom", "aekoroglu", "packit"]
dist_git_branches:
- fedora-latest
- fedora-42
- fedora-rawhide
- job: bodhi_update
trigger: commit
dist_git_branches:
# rawhide updates are created automatically
- fedora-latest
- fedora-42

26
1773.patch Normal file
View file

@ -0,0 +1,26 @@
From af013cf65867e3589f6da714eefc69d9f986bb91 Mon Sep 17 00:00:00 2001
From: Nathan Moinvaziri <nathan@nathanm.com>
Date: Mon, 9 Sep 2024 13:32:33 -0700
Subject: [PATCH] Don't use chunkunroll for inflateBack
If the output buffer and the window buffer are the same
memory allocation, we cannot make the assumptions that chunkunroll
does, that it is okay to overwrite the output buffer.
---
inffast_tpl.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/inffast_tpl.h b/inffast_tpl.h
index 9ddd187d84..c8f4786754 100644
--- a/inffast_tpl.h
+++ b/inffast_tpl.h
@@ -249,7 +249,8 @@ void Z_INTERNAL INFLATE_FAST(PREFIX3(stream) *strm, uint32_t start) {
if (op < len) { /* still need some from output */
len -= op;
out = chunkcopy_safe(out, from, op, safe);
- out = CHUNKUNROLL(out, &dist, &len);
+ if (!extra_safe)
+ out = CHUNKUNROLL(out, &dist, &len);
out = chunkcopy_safe(out, out - dist, len, safe);
} else {
out = chunkcopy_safe(out, from, len, safe);

3
README.packit Normal file
View file

@ -0,0 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 1.12.0.post1.dev20+g7d30dac21.

109
changelog Normal file
View file

@ -0,0 +1,109 @@
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Wed Jan 08 2025 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.2.3-1
- Update to version 2.2.3
* Wed Sep 25 2024 Lukas Javorsky <ljavorsk@redhat.com> - 2.2.2-1
- Rebase to new major version 2.2.2
* Tue Sep 10 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.7-3
- Fixes rhbz#2307237
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Wed Jun 19 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.7-1
- Update to zlib-ng 2.1.7
- Fix rhbz#2293101
- Fix rhbz#2293437
* Tue Jun 04 2024 Cristian Le <fedora@lecris.me> - 2.1.6-6
- Avoid using reserved variable vendor. Fix #2284608
* Wed May 29 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.6-5
- Set ownership of cmake directories. Fix #2283789
* Tue May 21 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.6-4
- Update the patch that fixes rhbz#2280347
* Tue May 14 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.6-3
- Fix rhbz#2280347
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jan 11 2024 Lukas Javorsky <ljavorsk@redhat.com> - 2.1.6-1
- Rebase to version 2.1.6
* Tue Jan 09 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 2.1.5-2
- Add zlib-ng-compat-static to replace zlib-static
* Wed Dec 20 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.5-1
- Update to zlib-ng 2.1.5
* Wed Oct 18 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-7
- Improve the patch that defines the FAR macro
* Wed Sep 27 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-6
- Add a patch that defines the FAR macro
* Wed Sep 20 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-5
- Fix WITH_SANITIZER
* Tue Sep 19 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-4
- Disable WITH_NEW_STRATEGIES in compat mode
* Thu Aug 24 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 2.1.3-3
- Enable zlib compat build
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 11 2023 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 2.1.3-1
- Update to 2.1.3
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Apr 14 2022 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 2.0.6-1
- New upstream release 2.0.6
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-2.20210625gitc69f78bc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Aug 07 2021 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 2.0.2-5.20210625gitc69f78bc5e
- Update to v2.0.5.
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-2.20210323git5fe25907e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sun Apr 18 2021 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 2.0.2-1.20210323gite5fe25907e
- Update to v2.0.2.
- Remove the manpage that got removed from upstream.
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.9-0.4.20200912gite58738845
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sun Sep 13 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.3.20200912gite58738845
- Update to a newer commit.
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.9-0.3.20200609gitfe69810c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 09 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.2.20200609gitfe69810c2
- Replace cmake commands with new cmake macros
* Mon Jul 06 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.1.20200609gitfe69810c2
- Improve the archive name.
- Starte release at 0.1 as required for prerelease.
- Make the devel package require an arch-dependent runtime subpackage.
- Remove %%ldconfig_scriptlets.
- Glob the man page extension.
- Move unversioned shared library to the devel subpackage
* Wed Jul 01 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.20200609gitfe69810c2
- Initial commit

12
far.diff Normal file
View file

@ -0,0 +1,12 @@
diff --git a/zconf.h.in b/zconf.h.in
index 074f0255..e7183db3 100644
--- a/zconf.h.in
+++ b/zconf.h.in
@@ -200,4 +200,7 @@ typedef PTRDIFF_TYPE ptrdiff_t;
typedef size_t z_size_t;
+/* Some packages depend on FAR being defined, i.e. old versions of minizip. */
+#define FAR
+
#endif /* ZCONF_H */

12
gating.yaml Normal file
View file

@ -0,0 +1,12 @@
--- !Policy
product_versions:
- fedora-*
decision_contexts:
- bodhi_update_push_testing
- bodhi_update_push_stable
- bodhi_update_push_stable_critpath
subject_type: koji_build
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis}
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional}

7
plans/build-gating.fmf Normal file
View file

@ -0,0 +1,7 @@
summary: Fedora zlib-ng tests
discover:
- name: fedora
how: fmf
url: https://src.fedoraproject.org/tests/zlib-ng.git
execute:
how: tmt

33
regenerate-rpminspect Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/bash
#
# Regenerated rpminspect.yaml.
# The contents in rpminspect.yaml depends on the usage of NOLTOFLAG in
# zlib-ng's build system.
OUTPUT=$(pwd)/rpminspect.yaml
cat - <<EOF > $OUTPUT
# This file has been generated automatically by regenerate-rpminspect.
# Ignore LTO test on CPU-optimized files which cannot use the LTO.
# More described in upstream: https://github.com/zlib-ng/zlib-ng/pull/938
annocheck:
extra_opts:
- hardened:
EOF
tmpdir=$(mktemp -p $(pwd) -d)
fedpkg prep --builddir $tmpdir > /dev/null
rootdir=$(dirname $(find $tmpdir -name arch))
for makefile in $(find $tmpdir -name Makefile.in); do
dir=$(dirname $makefile)
for f in $(gawk \
'match($0, /\$\(NOLTOFLAG\).*\/([^\/]+\.c)/, ret) {print ret[1]}' \
$makefile | sort -u); do
echo "--skip-lto=$(realpath --relative-to=$rootdir $dir)/$f" >> $OUTPUT
done
done
rm -rf $tmpdir

37
rpminspect.yaml Normal file
View file

@ -0,0 +1,37 @@
# This file has been generated automatically by regenerate-rpminspect.
# Ignore LTO test on CPU-optimized files which cannot use the LTO.
# More described in upstream: https://github.com/zlib-ng/zlib-ng/pull/938
annocheck:
extra_opts:
- hardened:
--skip-lto=arch/arm/adler32_neon.c
--skip-lto=arch/arm/chunkset_neon.c
--skip-lto=arch/arm/compare256_neon.c
--skip-lto=arch/arm/crc32_acle.c
--skip-lto=arch/arm/insert_string_acle.c
--skip-lto=arch/arm/slide_hash_armv6.c
--skip-lto=arch/arm/slide_hash_neon.c
--skip-lto=arch/power/adler32_power8.c
--skip-lto=arch/power/adler32_vmx.c
--skip-lto=arch/power/chunkset_power8.c
--skip-lto=arch/power/compare256_power9.c
--skip-lto=arch/power/crc32_power8.c
--skip-lto=arch/power/slide_hash_power8.c
--skip-lto=arch/power/slide_hash_vmx.c
--skip-lto=arch/s390/crc32-vx.c
--skip-lto=arch/x86/adler32_avx2.c
--skip-lto=arch/x86/adler32_avx512.c
--skip-lto=arch/x86/adler32_avx512_vnni.c
--skip-lto=arch/x86/adler32_sse42.c
--skip-lto=arch/x86/adler32_ssse3.c
--skip-lto=arch/x86/chunkset_avx2.c
--skip-lto=arch/x86/chunkset_sse2.c
--skip-lto=arch/x86/chunkset_ssse3.c
--skip-lto=arch/x86/compare256_avx2.c
--skip-lto=arch/x86/compare256_sse2.c
--skip-lto=arch/x86/crc32_pclmulqdq.c
--skip-lto=arch/x86/crc32_vpclmulqdq.c
--skip-lto=arch/x86/insert_string_sse42.c
--skip-lto=arch/x86/slide_hash_avx2.c
--skip-lto=arch/x86/slide_hash_sse2.c

View file

@ -1 +1 @@
SHA512 (zlib-ng-2.0.6.tar.gz) = 4888f17160d0a87a9b349704047ae0d0dc57237a10e11adae09ace957afa9743cce5191db67cb082991421fc961ce68011199621034d2369c0e7724fad58b4c5
SHA512 (zlib-ng-2.3.2.tar.gz) = 8781ee4bfda7cb8c8c5150c2e6a067d699580616b61af2ea4cf03cbe14c6715b31a29a20b7c3dd97254a9e487c72c5228c9cfa817ff71aa765fe7043ab136f04

View file

@ -1,17 +1,36 @@
%bcond_without compat
%bcond_without sanitizers
# Be explicit about the soname in order to avoid unintentional changes.
# Before modifying any of the sonames, this must be announced to the Fedora
# community as it may break many other packages.
# A change proposal is needed:
# https://docs.fedoraproject.org/en-US/program_management/changes_policy/
%global soname libz-ng.so.2
%global compat_soname libz.so.1
# Compatible with the following zlib version.
%global zlib_ver 1.3.1
# Obsoletes zlib versions less than.
%global zlib_obsoletes 1.3
# ABI files for ix86 and s390x are not available upstream.
%global supported_abi_test aarch64 ppc64le x86_64
Name: zlib-ng
Version: 2.0.6
Release: 3%{?dist}
Version: 2.3.2
Release: %autorelease
Summary: Zlib replacement with optimizations
License: zlib
License: Zlib
Url: https://github.com/zlib-ng/zlib-ng
Source0: https://github.com/zlib-ng/zlib-ng/archive/%{version}/%{name}-%{version}.tar.gz
# Be explicit about the soname in order to avoid unintentional changes.
%global soname libz-ng.so.2
Patch: far.diff
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: cmake >= 3.1
BuildRequires: gcc-c++
BuildRequires: cmake(GTest)
BuildRequires: libabigail
%description
zlib-ng is a zlib replacement that provides optimizations for "next generation"
@ -22,77 +41,195 @@ Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains static libraries and header files for
developing application that use %{name}.
The %{name}-devel package contains libraries and header files for developing
application that use %{name}.
%if %{with compat}
%package compat
Summary: Zlib implementation provided by %{name}
Provides: zlib = %{zlib_ver}
Provides: zlib%{?_isa} = %{zlib_ver}
Conflicts: zlib%{?_isa}
Obsoletes: zlib < %{zlib_obsoletes}
%description compat
zlib-ng is a zlib replacement that provides optimizations for "next generation"
systems.
The %{name}-compat package contains the library that is API and binary
compatible with zlib.
%package compat-devel
Summary: Development files for %{name}-compat
Requires: %{name}-compat%{?_isa} = %{version}-%{release}
Provides: zlib-devel = %{zlib_ver}
Provides: zlib-devel%{?_isa} = %{zlib_ver}
Conflicts: zlib-devel%{?_isa}
Obsoletes: zlib-devel < %{zlib_obsoletes}
%description compat-devel
The %{name}-compat-devel package contains libraries and header files for
developing application that use zlib.
%package compat-static
Summary: Static libraries for %{name}-compat
Requires: %{name}-compat-devel%{?_isa} = %{version}-%{release}
Provides: zlib-static = %{zlib_ver}
Provides: zlib-static%{?_isa} = %{zlib_ver}
Conflicts: zlib-static%{?_isa}
Obsoletes: zlib-static < %{zlib_obsoletes}
%description compat-static
The %{name}-compat-static package contains static libraries needed for
developing applications that use zlib.
%endif
%prep
%autosetup -p1 -n %{name}-%{version}
%build
cat <<_EOF_
###########################################################################
#
# Build the default zlib-ng library
#
###########################################################################
_EOF_
# zlib-ng uses a different macro for library directory.
%cmake -DWITH_SANITIZERS=ON -DINSTALL_LIB_DIR=%{_libdir}
%global cmake_param %{?with_sanitizers:-DWITH_SANITIZER=ON}
%ifarch riscv64
%global cmake_param %cmake_param -DWITH_RVV=OFF
%endif
%ifarch s390x
%global cmake_param %cmake_param -DWITH_DFLTCC_DEFLATE=ON -DWITH_DFLTCC_INFLATE=ON
%endif
%if 0%{?rhel} >= 10
%ifarch x86_64
# RHEL 10 has x86_64-v3 as baseline, turning the CRC32 Chorba optimization
# unnecessary.
# More info: https://github.com/zlib-ng/zlib-ng/releases/tag/2.3.1
%global cmake_param %cmake_param -DWITH_CRC32_CHORBA=OFF
%endif
%endif
# Setting __cmake_builddir is not necessary in this step, but do it anyway for symmetry.
%global __cmake_builddir %{_vpath_builddir}
%cmake %{cmake_param}
%cmake_build
%if %{with compat}
cat <<_EOF_
###########################################################################
#
# Build the compat mode library
#
###########################################################################
_EOF_
%global __cmake_builddir %{_vpath_builddir}-compat
# defining BUILD_SHARED_LIBS disables the static library
%undefine _cmake_shared_libs
# Disable new strategies in order to keep compatibility with zlib.
%cmake %{cmake_param} -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON
%cmake_build
%endif
%check
cat <<_EOF_
###########################################################################
#
# Run the zlib-ng tests
#
###########################################################################
_EOF_
%global __cmake_builddir %{_vpath_builddir}
%ctest
%ifarch ppc64le
# Workaround Copr, that sets _target_cpu to ppc64le.
%global target_cpu powerpc64le
%else
%global target_cpu %{_target_cpu}
%endif
%ifarch x86_64
%global cpu_vendor pc
%else
%global cpu_vendor unknown
%endif
%ifarch %{supported_abi_test}
CHOST=%{target_cpu}-%{cpu_vendor}-linux-gnu sh test/abicheck.sh
%endif
%if %{with compat}
cat <<_EOF_
###########################################################################
#
# Run the compat mode tests
#
###########################################################################
_EOF_
%global __cmake_builddir %{_vpath_builddir}-compat
%ctest
%ifarch %{supported_abi_test}
CHOST=%{target_cpu}-%{cpu_vendor}-linux-gnu sh test/abicheck.sh --zlib-compat
%endif
%endif
%install
%global __cmake_builddir %{_vpath_builddir}
%cmake_install
%if %{with compat}
%global __cmake_builddir %{_vpath_builddir}-compat
%cmake_install
%endif
%files
%{_libdir}/%{soname}
%{_libdir}/libz-ng.so.2.*
%license LICENSE.md
%doc README.md
%{_libdir}/libz-ng.so.%{version}
%{_libdir}/%{soname}
%files devel
%{_includedir}/zconf-ng.h
%{_includedir}/zlib-ng.h
%{_includedir}/zlib_name_mangling-ng.h
%{_libdir}/libz-ng.so
%{_libdir}/pkgconfig/%{name}.pc
%dir %{_libdir}/cmake/zlib-ng/
%{_libdir}/cmake/zlib-ng/*
%if %{with compat}
%files compat
%{_libdir}/%{compat_soname}
%{_libdir}/libz.so.%{zlib_ver}.zlib-ng
%files compat-devel
%{_includedir}/zconf.h
%{_includedir}/zlib.h
%{_includedir}/zlib_name_mangling.h
%{_libdir}/libz.so
%{_libdir}/pkgconfig/zlib.pc
%dir %{_libdir}/cmake/ZLIB/
%{_libdir}/cmake/ZLIB/*
%files compat-static
%{_libdir}/libz.a
%endif
%changelog
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Apr 14 2022 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 2.0.6-1
- New upstream release 2.0.6
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.5-2.20210625gitc69f78bc5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Aug 07 2021 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 2.0.2-5.20210625gitc69f78bc5e
- Update to v2.0.5.
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-2.20210323git5fe25907e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sun Apr 18 2021 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 2.0.2-1.20210323gite5fe25907e
- Update to v2.0.2.
- Remove the manpage that got removed from upstream.
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.9-0.4.20200912gite58738845
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sun Sep 13 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.3.20200912gite58738845
- Update to a newer commit.
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.9-0.3.20200609gitfe69810c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 09 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.2.20200609gitfe69810c2
- Replace cmake commands with new cmake macros
* Mon Jul 06 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.1.20200609gitfe69810c2
- Improve the archive name.
- Starte release at 0.1 as required for prerelease.
- Make the devel package require an arch-dependent runtime subpackage.
- Remove %%ldconfig_scriptlets.
- Glob the man page extension.
- Move unversioned shared library to the devel subpackage
* Wed Jul 01 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 1.9.9-0.20200609gitfe69810c2
- Initial commit
%autochangelog