Add %bcond for minizip and do some cleanup

We should drop the minizip subpackage one day since that's totally
unsupported upstream, have a look e.g. at [1].  Nowadays there are
forks like [2] that could replace subpackage.  I contacted both
original minizip authors (per zlib upstream), and both redirected
me to [2].

[1] https://github.com/madler/zlib/pulls/praiskup
[2] https://github.com/nmoinvaz/minizip

Related: rhbz#1609830
Version: 1.2.11-10
This commit is contained in:
Pavel Raiskup 2018-08-03 17:51:16 +02:00
parent 03637265b0
commit 0fda98744b

View File

@ -1,6 +1,8 @@
%bcond_without minizip
Name: zlib
Version: 1.2.11
Release: 9%{?dist}
Release: 10%{?dist}
Summary: The compression and decompression library
# /contrib/dotzlib/ have Boost license
License: zlib and Boost
@ -24,6 +26,7 @@ BuildRequires: automake, autoconf, libtool
Zlib is a general-purpose, patent-free, lossless data compression
library which is used by many different programs.
%package devel
Summary: Header files and libraries for Zlib development
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -33,6 +36,7 @@ The zlib-devel package contains the header files and libraries needed
to develop programs that use the zlib compression and decompression
library.
%package static
Summary: Static libraries for Zlib development
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
@ -42,6 +46,8 @@ The zlib-static package includes static libraries needed
to develop programs that use the zlib compression and
decompression library.
%if %{with minizip}
%package -n minizip
Summary: Library for manipulation with .zip archives
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -49,6 +55,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%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
Requires: minizip%{?_isa} = %{version}-%{release}
@ -57,6 +64,8 @@ Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description -n minizip-devel
This package contains the libraries and header files needed for
developing applications which use minizip.
%endif
%prep
%setup -q
@ -72,10 +81,10 @@ developing applications which use minizip.
%patch6 -p1 -b .optimize-aarch64
%endif
iconv -f iso-8859-2 -t utf-8 < ChangeLog > ChangeLog.tmp
mv ChangeLog.tmp ChangeLog
%build
export CFLAGS="$RPM_OPT_FLAGS"
%ifarch ppc64
@ -86,35 +95,40 @@ CFLAGS+=" -DARM_NEON -O3"
%endif
export LDFLAGS="$LDFLAGS -Wl,-z,relro -Wl,-z,now"
# no-autotools, %%configure is not compatible
./configure --libdir=%{_libdir} --includedir=%{_includedir} --prefix=%{_prefix}
make %{?_smp_mflags}
%make_build
%if %{with minizip}
cd contrib/minizip
autoreconf --install
%configure --enable-static=no
make %{?_smp_mflags}
%make_build
%endif
%check
make test
%install
make install DESTDIR=$RPM_BUILD_ROOT
%make_install
cd contrib/minizip
make install DESTDIR=$RPM_BUILD_ROOT
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%if %{with minizip}
%make_install -C contrib/minizip
# https://github.com/madler/zlib/pull/229
rm $RPM_BUILD_ROOT%_includedir/minizip/crypt.h
%endif
find $RPM_BUILD_ROOT -name '*.la' -delete
%ldconfig_scriptlets
%ldconfig_scriptlets -n minizip
%files
%license README
%doc ChangeLog FAQ
%{_libdir}/libz.so.*
%files devel
%doc doc/algorithm.txt test/example.c
%{_libdir}/libz.so
@ -123,21 +137,31 @@ rm $RPM_BUILD_ROOT%_includedir/minizip/crypt.h
%{_includedir}/zconf.h
%{_mandir}/man3/zlib.3*
%files static
%license README
%{_libdir}/libz.a
%if %{with minizip}
%files -n minizip
%doc contrib/minizip/MiniZip64_info.txt contrib/minizip/MiniZip64_Changes.txt
%{_libdir}/libminizip.so.*
%files -n minizip-devel
%dir %{_includedir}/minizip
%{_includedir}/minizip/*.h
%{_libdir}/libminizip.so
%{_libdir}/pkgconfig/minizip.pc
%endif
%changelog
* Fri Aug 03 2018 Pavel Raiskup <praiskup@redhat.com> - 1.2.11-10
- add %%bcond for minizip
- use %%make_* macros
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.11-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild