From f3ce2471e1f46831bb75726d5e1dbd00a1932892 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 8 Nov 2021 15:12:21 +0100 Subject: build as remi-libzip for EL-9 --- libzip.spec | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/libzip.spec b/libzip.spec index 386d1be..7ea315b 100644 --- a/libzip.spec +++ b/libzip.spec @@ -14,13 +14,22 @@ %{?scl: %scl_package libzip} +%if 0%{?rhel} >= 9 +%global move_to_opt 1 +%global _prefix /opt/%{?vendeur:%{vendeur}/}%{libname} +%global __arch_install_post /bin/true +Name: %{?vendeur:%{vendeur}-}%{libname} +%else +%global move_to_opt 0 %if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 Name: %{?scl_prefix}%{libname} %else Name: %{libname}%{soname} %endif +%endif + Version: 1.8.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: C library for reading, creating, and modifying zip archives License: BSD @@ -64,12 +73,20 @@ Provides: %{libname} = %{version}-%{release} %endif %endif +%if %{move_to_opt} +# Filter in the /opt installation +%{?filter_from_provides: %filter_from_provides /libzip/d} +%{?filter_from_requires: %filter_from_requires /libzip/d} +%{?filter_setup} +%endif + %if 0%{?rhel} >= 8 && 0%{?scl:1} %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} %global __provides_exclude ^(libzip\\.so|cmake|pkgconfig).*$ %global __requires_exclude ^libzip\\.so.*$ %endif + %description libzip is a C library for reading, creating, and modifying zip archives. Files can be added from data buffers, files, or compressed data copied directly from @@ -166,6 +183,8 @@ make %{?_smp_mflags} %install +mkdir -p %{buildroot}%{_licensedir} + %if 0%{?cmake_install:1} %cmake_install %else @@ -195,12 +214,24 @@ make check %{!?_licensedir:%global license %%doc} %license LICENSE %{_libdir}/libzip.so.%{soname}* +%if %{move_to_opt} +%dir %{_prefix} +%dir %{_mandir} +%dir %{_libdir} +%dir %{_libdir} +%dir %{_datadir} +%dir %{_licensedir} +%endif %files tools %{_bindir}/zipcmp %{_bindir}/zipmerge %{_bindir}/ziptool %{_mandir}/man1/zip* +%if %{move_to_opt} +%dir %{_bindir} +%dir %{_mandir}/man1 +%endif %files devel %doc AUTHORS THANKS *.md @@ -212,9 +243,18 @@ make check %{_mandir}/man3/libzip* %{_mandir}/man3/zip* %{_mandir}/man3/ZIP* +%if %{move_to_opt} +%dir %{_includedir} +%dir %{_mandir}/man3 +%dir %{_libdir}/pkgconfig +%dir %{_libdir}/cmake +%endif %changelog +* Mon Nov 8 2021 Remi Collet - 1.8.0-3 +- build as remi-libzip for EL-9 + * Mon Jun 21 2021 Remi Collet - 1.8.0-2 - ensure libzstd >= 1.3.6 is used -- cgit