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