diff --git a/0001-Fix-NOTHREAD-compile-error-for-combination-code.patch b/0001-Fix-NOTHREAD-compile-error-for-combination-code.patch new file mode 100644 index 0000000000000000000000000000000000000000..c5c6beb8b5d96195218f7dd0ffaf5a647ec99324 --- /dev/null +++ b/0001-Fix-NOTHREAD-compile-error-for-combination-code.patch @@ -0,0 +1,61 @@ +From 67fd6e436f4f479aead529a719e24d6864cf1dfa Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Sun, 16 Jan 2022 09:23:07 -0800 +Subject: [PATCH] Fix NOTHREAD compile error for combination code. + +The ability to combine CRCs is needed for the new summary line +when listing multiple gzip members. +--- + pigz.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/pigz.c b/pigz.c +index 01e50e0..f915c4a 100644 +--- a/pigz.c ++++ b/pigz.c +@@ -558,9 +558,7 @@ local struct { + int procs; // maximum number of compression threads (>= 1) + int setdict; // true to initialize dictionary in each thread + size_t block; // uncompressed input size per thread (>= 32K) +-#ifndef NOTHREAD + crc_t shift; // pre-calculated CRC-32 shift for length block +-#endif + + // saved gzip/zip header data for decompression, testing, and listing + time_t stamp; // time stamp from gzip header +@@ -1338,9 +1336,6 @@ local long zlib_vernum(void) { + return left < 2 ? num << (left << 2) : -1; + } + +-#ifndef NOTHREAD +-// -- threaded portions of pigz -- +- + // -- check value combination routines for parallel calculation -- + + #define COMB(a,b,c) (g.form == 1 ? adler32_comb(a,b,c) : crc32_comb(a,b,c)) +@@ -1421,6 +1416,9 @@ local unsigned long adler32_comb(unsigned long adler1, unsigned long adler2, + return sum1 | (sum2 << 16); + } + ++#ifndef NOTHREAD ++// -- threaded portions of pigz -- ++ + // -- pool of spaces for buffer management -- + + // These routines manage a pool of spaces. Each pool specifies a fixed size +@@ -4337,11 +4335,11 @@ local void defaults(void) { + ZopfliInitOptions(&g.zopts); + #endif + g.block = 131072UL; // 128K ++ g.shift = x2nmodp(g.block, 3); + #ifdef NOTHREAD + g.procs = 1; + #else + g.procs = nprocs(8); +- g.shift = x2nmodp(g.block, 3); + #endif + g.rsync = 0; // don't do rsync blocking + g.setdict = 1; // initialize dictionary each thread +-- +2.27.0 + diff --git a/pigz-2.7.tar.gz b/pigz-2.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..eecd2e875ecb3b903e2d6f12d9c6cd392bdd64e1 Binary files /dev/null and b/pigz-2.7.tar.gz differ diff --git a/pigz.spec b/pigz.spec new file mode 100644 index 0000000000000000000000000000000000000000..a433b28f7c8a4ebd5f0a4a03539fd32848dcdc49 --- /dev/null +++ b/pigz.spec @@ -0,0 +1,46 @@ +Name: pigz +Version: 2.7 +Release: 1%{?dist} +Summary: Parallel implementation of gzip +License: zlib +URL: https://www.zlib.net/pigz/ +Source0: https://www.zlib.net/%{name}/%{name}-%{version}.tar.gz +Patch0: 0001-Fix-NOTHREAD-compile-error-for-combination-code.patch + +BuildRequires: gcc +BuildRequires: make +BuildRequires: ncompress +BuildRequires: zlib-devel + +%description +pigz, which stands for parallel implementation of gzip, +is a fully functional replacement for gzip that exploits +multiple processors and multiple cores to the hilt when +compressing data. + +%prep +%autosetup -p1 + +%build +%set_build_flags +%make_build CFLAGS="$RPM_OPT_FLAGS" + +%install +install -p -D pigz $RPM_BUILD_ROOT%{_bindir}/pigz +pushd $RPM_BUILD_ROOT%{_bindir}; ln pigz unpigz; popd +install -p -D pigz.1 -m 0644 $RPM_BUILD_ROOT%{_datadir}/man/man1/pigz.1 + +%check +make tests CFLAGS="$RPM_OPT_FLAGS" + +%files +%license README +%doc pigz.pdf README +%{_bindir}/pigz +%{_bindir}/unpigz +%{_datadir}/man/man1/pigz.* + +%changelog +* Fri Mar 11 2022 Yaobin Shi - 2.7-1 +- Fix NOTHREAD compile error +- Init for Anolis OS 23