From 1d22c05693fcf3a2da3db15981c3aa3bc77d6912 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:21:24 +0000 Subject: [PATCH 1/5] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From a5fcbe0b38575b94772026dc679145afd1904be7 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mon, 20 Oct 2025 12:06:47 -0600 Subject: [PATCH 2/5] Version 1.1.0 --- sources | 2 +- zstr-zlib-ng.patch | 63 +++++++++++++++++++++------------------------- zstr.spec | 22 ++++++++-------- 3 files changed, 40 insertions(+), 47 deletions(-) diff --git a/sources b/sources index 7d2ab3f..b3e4d5b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zstr-1.0.7.tar.gz) = 3017da244810a45f7111f76f8d0dd988e162f08eab28b7465cad4549d84200fc834975275daf9588d35c6125e6f167c1e2dd5ec18022dac1eceabdc24d24cffe +SHA512 (zstr-1.1.0.tar.gz) = 21778d2b07c30da4fb9ee35832f39b02c95e54478c6610e28cece98908c51bcee6aed0754ec3948b71aa1e671a3d15ff2b555369379dc4583048c76d2b8305e8 diff --git a/zstr-zlib-ng.patch b/zstr-zlib-ng.patch index 5c2e9ec..6dfaf22 100644 --- a/zstr-zlib-ng.patch +++ b/zstr-zlib-ng.patch @@ -1,5 +1,5 @@ ---- zstr-1.0.7/CMakeLists.txt.orig 2022-12-06 02:31:27.000000000 -0700 -+++ zstr-1.0.7/CMakeLists.txt 2024-09-18 13:17:30.552013743 -0600 +--- zstr-1.1.0/CMakeLists.txt.orig 2025-10-20 09:17:37.000000000 -0600 ++++ zstr-1.1.0/CMakeLists.txt 2025-10-20 11:45:56.725568759 -0600 @@ -16,8 +16,8 @@ endif() # -- locate zlib @@ -36,18 +36,18 @@ + libraries: zlib-ng::zlib features : cxx_std_11" ) ---- zstr-1.0.7/src/zstr.hpp.orig 2022-12-06 02:31:27.000000000 -0700 -+++ zstr-1.0.7/src/zstr.hpp 2024-09-18 14:09:15.735533320 -0600 -@@ -11,7 +11,7 @@ - #include - #include - #include +--- zstr-1.1.0/src/zstr.hpp.orig 2025-10-20 09:17:37.000000000 -0600 ++++ zstr-1.1.0/src/zstr.hpp 2025-10-20 11:49:38.553413378 -0600 +@@ -15,7 +15,7 @@ + #ifdef MINIZ + #include + #else -#include +#include + #endif #include #include - #include "strict_fstream.hpp" -@@ -34,7 +34,7 @@ class Exception +@@ -39,7 +39,7 @@ class Exception : public std::ios_base::failure { public: @@ -56,7 +56,7 @@ { std::string msg = "zlib: "; switch (ret) -@@ -76,7 +76,7 @@ public: +@@ -81,7 +81,7 @@ public: return msg; } @@ -65,8 +65,8 @@ : std::ios_base::failure(error_to_message(zstrm_p, ret)) { } -@@ -86,7 +86,7 @@ namespace detail - { +@@ -164,7 +164,7 @@ namespace WindowBits { + } // namespace WindowBits class z_stream_wrapper - : public z_stream @@ -74,21 +74,21 @@ { public: z_stream_wrapper(bool _is_input, int _level, int _window_bits) -@@ -100,11 +100,11 @@ public: +@@ -178,11 +178,11 @@ public: { this->avail_in = 0; this->next_in = nullptr;//Z_NULL -- ret = inflateInit2(this, _window_bits ? _window_bits : 15+32); -+ ret = zng_inflateInit2(this, _window_bits ? _window_bits : 15+32); +- ret = inflateInit2(this, _window_bits ? _window_bits : WindowBits::ZLIB_OR_GZIP::MAX); ++ ret = zng_inflateInit2(this, _window_bits ? _window_bits : WindowBits::ZLIB_OR_GZIP::MAX); } else { -- ret = deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : 15+16, 8, Z_DEFAULT_STRATEGY); -+ ret = zng_deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : 15+16, 8, Z_DEFAULT_STRATEGY); +- ret = deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : WindowBits::GZIP::MAX, 8, Z_DEFAULT_STRATEGY); ++ ret = zng_deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : WindowBits::GZIP::MAX, 8, Z_DEFAULT_STRATEGY); } if (ret != Z_OK) throw Exception(this, ret); } -@@ -112,11 +112,11 @@ public: +@@ -190,11 +190,11 @@ public: { if (is_input) { @@ -102,7 +102,7 @@ } } private: -@@ -187,15 +187,15 @@ public: +@@ -323,7 +323,7 @@ public: // empty input buffer: refill from the start in_buff_start = in_buff.get(); std::streamsize sz = sbuf_p->sgetn(in_buff.get(), static_cast(buff_size)); @@ -111,17 +111,7 @@ if (in_buff_end == in_buff_start) break; // end of input } // auto detect if the stream contains text or deflate data - if (auto_detect && ! auto_detect_run) - { - auto_detect_run = true; -- unsigned char b0 = *reinterpret_cast< unsigned char * >(in_buff_start); -- unsigned char b1 = *reinterpret_cast< unsigned char * >(in_buff_start + 1); -+ unsigned char b0 = *reinterpret_cast< const unsigned char * >(in_buff_start); -+ unsigned char b1 = *reinterpret_cast< const unsigned char * >(in_buff_start + 1); - // Ref: - // http://en.wikipedia.org/wiki/Gzip - // http://stackoverflow.com/questions/9050260/what-does-a-zlib-header-look-like -@@ -222,12 +222,12 @@ public: +@@ -349,7 +349,7 @@ public: zstrm_p->avail_in = uint32_t(in_buff_end - in_buff_start); zstrm_p->next_out = reinterpret_cast< decltype(zstrm_p->next_out) >(out_buff_free_start); zstrm_p->avail_out = uint32_t((out_buff.get() + buff_size) - out_buff_free_start); @@ -130,13 +120,16 @@ // process return code if (ret != Z_OK && ret != Z_STREAM_END) throw Exception(zstrm_p.get(), ret); // update in&out pointers following inflate() - in_buff_start = reinterpret_cast< decltype(in_buff_start) >(zstrm_p->next_in); +@@ -360,7 +360,7 @@ public: + zstrm_p->next_in + #endif + ); - in_buff_end = in_buff_start + zstrm_p->avail_in; + in_buff_end = const_cast(in_buff_start) + zstrm_p->avail_in; out_buff_free_start = reinterpret_cast< decltype(out_buff_free_start) >(zstrm_p->next_out); assert(out_buff_free_start + zstrm_p->avail_out == out_buff.get() + buff_size); -@@ -249,7 +249,7 @@ public: +@@ -382,7 +382,7 @@ public: private: std::streambuf * sbuf_p; std::unique_ptr in_buff; @@ -145,7 +138,7 @@ char * in_buff_end; std::unique_ptr out_buff; std::unique_ptr zstrm_p; -@@ -288,7 +288,7 @@ public: +@@ -424,7 +424,7 @@ public: { zstrm_p->next_out = reinterpret_cast< decltype(zstrm_p->next_out) >(out_buff.get()); zstrm_p->avail_out = uint32_t(buff_size); @@ -154,7 +147,7 @@ if (ret != Z_OK && ret != Z_STREAM_END && ret != Z_BUF_ERROR) { failed = true; throw Exception(zstrm_p.get(), ret); -@@ -346,7 +346,7 @@ public: +@@ -492,7 +492,7 @@ public: zstrm_p->next_in = nullptr; zstrm_p->avail_in = 0; if (deflate_loop(Z_FINISH) != 0) return -1; diff --git a/zstr.spec b/zstr.spec index 48fe96b..1147d21 100644 --- a/zstr.spec +++ b/zstr.spec @@ -2,7 +2,7 @@ %global debug_package %{nil} Name: zstr -Version: 1.0.7 +Version: 1.1.0 Release: %autorelease Summary: A C++ header-only ZLib wrapper @@ -20,18 +20,17 @@ BuildRequires: pkgconfig(zlib-ng) # See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} -%global _desc %{expand: -This C++ header-only library enables the use of C++ standard iostreams -to access ZLib-compressed streams. +%global _desc %{expand:This C++ header-only library enables the use of C++ standard iostreams to +access ZLib-compressed streams. -For input access (decompression), the compression format is -auto-detected, and multiple concatenated compressed streams are -decompressed seamlessly. +For input access (decompression), the compression format is auto-detected, and +multiple concatenated compressed streams are decompressed seamlessly. -For output access (compression), the only parameter exposed by this API -is the compression level.} +For output access (compression), the only parameter exposed by this API is the +compression level.} -%description %_desc +%description +%_desc %package devel Summary: A C++ header-only ZLib wrapper @@ -39,7 +38,8 @@ BuildArch: noarch Requires: pkgconfig(zlib-ng) Provides: %{name}-static = %{version}-%{release} -%description devel %_desc +%description devel +%_desc %prep %autosetup -p1 From 5288b1ba5f994d8bc7cbbf22878123f4a6ac67d3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 21:11:33 +0000 Subject: [PATCH 3/5] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From 429d557e7520942e090f869591cee05c25a4a8bb Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 14 Jul 2026 19:34:48 -0600 Subject: [PATCH 4/5] Use the cmake declarative buildsystem --- zstr.spec | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/zstr.spec b/zstr.spec index 1147d21..37676d8 100644 --- a/zstr.spec +++ b/zstr.spec @@ -1,6 +1,9 @@ # There are no ELF objects in this package, so turn off debuginfo generation. %global debug_package %{nil} +# Whether to run tests +%bcond ctest 1 + Name: zstr Version: 1.1.0 Release: %autorelease @@ -13,7 +16,8 @@ Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Use zlib-ng directly rather than via the compatibility interface Patch: %{name}-zlib-ng.patch -BuildRequires: cmake +BuildSystem: cmake + BuildRequires: gcc-c++ BuildRequires: pkgconfig(zlib-ng) @@ -44,18 +48,11 @@ Provides: %{name}-static = %{version}-%{release} %prep %autosetup -p1 -%build -%cmake -%cmake_build - %install #%%cmake_install does nothing, so install manually mkdir -p %{buildroot}%{_includedir}/zstr install -m 0644 -p src/*.hpp %{buildroot}%{_includedir}/zstr -%check -%ctest - %files devel %doc README.org %license LICENSE From 398e6832518c2837a9b173714f515d295eca80d0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 09:44:09 +0000 Subject: [PATCH 5/5] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild