updated z-block-flush patch
- done some minor .spec file cleanup
This commit is contained in:
Peter Schiffer 2012-08-27 19:35:25 +02:00
parent 4f28307ec2
commit 1b3576d50e
2 changed files with 40 additions and 31 deletions

View File

@ -1,4 +1,4 @@
From 27a4fb5e54884c06fc0face8b4b432fa06dce773 Mon Sep 17 00:00:00 2001
From f1b8edadc3c733990f8a8de4d643f968e571ae85 Mon Sep 17 00:00:00 2001
From: Adam Tkac <atkac@redhat.com>
Date: Fri, 17 Aug 2012 15:13:48 +0200
Subject: [PATCH] Rank Z_BLOCK flush below Z_PARTIAL_FLUSH only when last
@ -13,24 +13,33 @@ deflateParams(stream, newLevel, Z_DEFAULT_STRATEGY);
Signed-off-by: Adam Tkac <atkac@redhat.com>
---
deflate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
deflate.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/deflate.c b/deflate.c
index 9e4c2cb..d1d0c68 100644
index 9e4c2cb..3422f72 100644
--- a/deflate.c
+++ b/deflate.c
@@ -882,8 +882,8 @@ int ZEXPORT deflate (strm, flush)
@@ -882,9 +882,16 @@ int ZEXPORT deflate (strm, flush)
* flushes. For repeated and useless calls with Z_FINISH, we keep
* returning Z_STREAM_END instead of Z_BUF_ERROR.
*/
- } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
- flush != Z_FINISH) {
+ } else if (strm->avail_in == 0 && old_flush == Z_BLOCK &&
+ RANK(flush) <= RANK(old_flush) && flush != Z_FINISH) {
ERR_RETURN(strm, Z_BUF_ERROR);
- ERR_RETURN(strm, Z_BUF_ERROR);
+ } else if (strm->avail_in == 0 && flush != Z_FINISH) {
+ char err;
+
+ /* Degrade Z_BLOCK only when last flush was Z_BLOCK */
+ err = (old_flush == Z_BLOCK) ?
+ RANK(flush) <= RANK(old_flush) : flush <= old_flush;
+
+ if (err) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
}
/* User must not provide more input after the first FINISH: */
--
1.7.11.4

View File

@ -1,15 +1,19 @@
Summary: The zlib compression and decompression library
Summary: The compression and decompression library
Name: zlib
Version: 1.2.7
Release: 7%{?dist}
Group: System Environment/Libraries
Source: http://www.zlib.net/zlib-%{version}.tar.bz2
Patch0: zlib-1.2.5-minizip-fixuncrypt.patch
Patch1: zlib-1.2.7-optimized-s390.patch
Patch2: zlib-1.2.7-z-block-flush.patch
URL: http://www.zlib.net/
# /contrib/dotzlib/ have Boost license
License: zlib and Boost
Group: System Environment/Libraries
URL: http://www.zlib.net/
Source: http://www.zlib.net/zlib-%{version}.tar.bz2
Patch0: zlib-1.2.5-minizip-fixuncrypt.patch
# resolves: #805113
Patch1: zlib-1.2.7-optimized-s390.patch
# resolves: #844791
Patch2: zlib-1.2.7-z-block-flush.patch
BuildRequires: automake, autoconf, libtool
%description
@ -37,18 +41,18 @@ to develop programs that use the zlib compression and
decompression library.
%package -n minizip
Summary: Minizip manipulates files from a .zip archive
Summary: Library for manipulation with .zip archives
Group: System Environment/Libraries
Requires: zlib = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
%description -n minizip
Minizip manipulates files from a .zip archive.
%description -n minizip
Minizip is a library for manipulation with files from .zip archives.
%package -n minizip-devel
Summary: Development files for the minizip library
Group: Development/Libraries
Requires: minizip = %{version}-%{release}
Requires: zlib-devel = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}
Requires: pkgconfig
%description -n minizip-devel
@ -62,12 +66,12 @@ developing applications which use minizip.
%patch1 -p1 -b .optimized-deflate
%endif
%patch2 -p1 -b .z-flush
iconv -f windows-1252 -t utf-8 <ChangeLog >ChangeLog.tmp
iconv -f iso-8859-2 -t utf-8 < ChangeLog > ChangeLog.tmp
mv ChangeLog.tmp ChangeLog
%build
export LDFLAGS="$LDFLAGS -Wl,-z,relro"
export CFLAGS="$RPM_OPT_FLAGS -fPIC"
export LDFLAGS="$LDFLAGS -Wl,-z,relro"
./configure --libdir=%{_libdir} --includedir=%{_includedir} --prefix=%{_prefix}
make %{?_smp_mflags}
@ -96,40 +100,36 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%postun -n minizip -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc README ChangeLog FAQ
%{_libdir}/libz.so.*
%files devel
%defattr(-,root,root,-)
%doc README doc/algorithm.txt test/example.c
%{_libdir}/libz.so
%{_includedir}/zconf.h
%{_includedir}/zlib.h
%{_mandir}/man3/zlib.3*
%{_libdir}/pkgconfig/zlib.pc
%{_includedir}/zlib.h
%{_includedir}/zconf.h
%{_mandir}/man3/zlib.3*
%files static
%defattr(-,root,root,-)
%doc README
%{_libdir}/libz.a
%files -n minizip
%defattr(-,root,root,-)
%doc contrib/minizip/MiniZip64_info.txt contrib/minizip/MiniZip64_Changes.txt
%{_libdir}/libminizip.so.*
%files -n minizip-devel
%defattr(-,root,root,-)
%dir %{_includedir}/minizip
%{_includedir}/minizip/*.h
%{_libdir}/libminizip.so
%{_libdir}/pkgconfig/minizip.pc
%changelog
* Wed Aug 22 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-7
* Mon Aug 27 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-7
- resolves: #844791
rank Z_BLOCK flush below Z_PARTIAL_FLUSH only when last flush was Z_BLOCK
- done some minor .spec file cleanup
* Mon Aug 13 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-6
- added patch from IBM which optimizes deflate on s390(x) architectures