Simplify transitional Requires and Obsoletes for legacy packages

This commit is contained in:
Björn Esser 2022-12-19 20:47:08 +01:00
parent 7e14f12831
commit 4ce12011a3
No known key found for this signature in database
GPG Key ID: F52E98007594C21D

View File

@ -1,5 +1,5 @@
# Build with new api? # Build with new api?
%if 0%{?fedora} >= 30 || 0%{?rhel} >= 9 %if 0%{?fedora} || 0%{?rhel} > 8
%bcond_without new_api %bcond_without new_api
%else %else
%bcond_with new_api %bcond_with new_api
@ -15,7 +15,7 @@
# Replace obsolete functions with a stub? # Replace obsolete functions with a stub?
%if (0%{?fedora} >= 30 || 0%{?rhel} >= 9) && %{with compat_pkg} %if %{with new_api} && %{with compat_pkg}
%bcond_without enosys_stubs %bcond_without enosys_stubs
%else %else
%bcond_with enosys_stubs %bcond_with enosys_stubs
@ -65,6 +65,12 @@
%global man_pages_minver 4.15-3 %global man_pages_minver 4.15-3
# Need versioned requires on glibc and man-pages?
%if !(0%{?fedora} || 0%{?rhel} > 9)
%global trans_pkg 1
%endif
# Hash methods and API supported by libcrypt. # Hash methods and API supported by libcrypt.
# NEVER EVER touch this, if you do NOT know what you are doing! # NEVER EVER touch this, if you do NOT know what you are doing!
%global hash_methods all %global hash_methods all
@ -162,7 +168,7 @@ fi \
Name: libxcrypt Name: libxcrypt
Version: 4.4.33 Version: 4.4.33
Release: 4%{?dist} Release: 5%{?dist}
Summary: Extended crypt library for descrypt, md5crypt, bcrypt, and others Summary: Extended crypt library for descrypt, md5crypt, bcrypt, and others
# For explicit license breakdown, see the # For explicit license breakdown, see the
@ -185,7 +191,9 @@ Patch0001: %{url}/commit/59823543d095.patch#/%{name}-4.4.33-SHA512_Maj_opti
BuildRequires: coreutils BuildRequires: coreutils
BuildRequires: fipscheck BuildRequires: fipscheck
BuildRequires: gcc BuildRequires: gcc
%if 0%{?trans_pkg}
BuildRequires: glibc-devel >= %{glibc_minver} BuildRequires: glibc-devel >= %{glibc_minver}
%endif
BuildRequires: make BuildRequires: make
BuildRequires: perl-interpreter >= %{perl_minver} BuildRequires: perl-interpreter >= %{perl_minver}
BuildRequires: perl(Class::Struct) BuildRequires: perl(Class::Struct)
@ -210,7 +218,7 @@ BuildRequires: gnupg2
%endif %endif
# We do not need to keep this forever. # We do not need to keep this forever.
%if !(0%{?fedora} > 31 || 0%{?rhel} > 9) %if 0%{?trans_pkg}
# Inherited from former libcrypt package. # Inherited from former libcrypt package.
Obsoletes: libcrypt-nss < %{glibc_minver} Obsoletes: libcrypt-nss < %{glibc_minver}
Provides: libcrypt-nss = %{glibc_minver} Provides: libcrypt-nss = %{glibc_minver}
@ -226,18 +234,16 @@ Provides: libcrypt%{?_isa} = %{glibc_minver}
# Obsolete former libxcrypt-common properly. # Obsolete former libxcrypt-common properly.
Obsoletes: %{name}-common < 4.3.3-4 Obsoletes: %{name}-common < 4.3.3-4
Provides: %{name}-common = %{version}-%{release} Provides: %{name}-common = %{version}-%{release}
# We need a version of glibc, that doesn't build libcrypt anymore.
Requires: glibc%{?_isa} >= %{glibc_minver}
%endif %endif
%if %{with new_api} && %{without compat_pkg} %if %{with new_api} && %{without compat_pkg}
Obsoletes: %{name}-compat < %{version}-%{release} Obsoletes: %{name}-compat < %{version}-%{release}
%endif %endif
%if !(0%{?fedora} > 34 || 0%{?rhel} > 9) %if 0%{?fedora}
# We need a version of glibc, that doesn't build libcrypt anymore.
Requires: glibc%{?_isa} >= %{glibc_minver}
%endif
%if 0%{?fedora} >= 30
Recommends: mkpasswd Recommends: mkpasswd
%endif %endif
@ -274,11 +280,6 @@ BuildRequires: libxcrypt-compat
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
%if !(0%{?fedora} > 34 || 0%{?rhel} > 9)
# We need a version of glibc, that doesn't build libcrypt anymore.
Requires: glibc%{?_isa} >= %{glibc_minver}
%endif
%description compat %description compat
This package contains the library providing the compatibility API This package contains the library providing the compatibility API
for applications that are linked against glibc's libxcrypt, or that for applications that are linked against glibc's libxcrypt, or that
@ -295,10 +296,12 @@ work unmodified with the library supplied by this package.
%package devel %package devel
Summary: Development files for %{name} Summary: Development files for %{name}
Conflicts: man-pages < %{man_pages_minver}
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: glibc-devel%{?_isa}
%if 0%{?trans_pkg}
Conflicts: man-pages < %{man_pages_minver}
Requires: glibc-devel%{?_isa} >= %{glibc_minver} Requires: glibc-devel%{?_isa} >= %{glibc_minver}
%endif
%description devel %description devel
The %{name}-devel package contains libraries and header files for The %{name}-devel package contains libraries and header files for
@ -310,8 +313,10 @@ developing applications that use %{name}.
Summary: Static library for -static linking with %{name} Summary: Static library for -static linking with %{name}
Requires: %{name}-devel%{?_isa} = %{version}-%{release} Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Requires: glibc-devel%{?_isa} >= %{glibc_minver} Requires: glibc-static%{?_isa}
%if 0%{?trans_pkg}
Requires: glibc-static%{?_isa} >= %{glibc_minver} Requires: glibc-static%{?_isa} >= %{glibc_minver}
%endif
%description static %description static
This package contains the libxcrypt static library for -static This package contains the libxcrypt static library for -static
@ -577,6 +582,9 @@ done
%changelog %changelog
* Mon Dec 19 2022 Björn Esser <besser82@fedoraproject.org> - 4.4.33-5
- Simplify transitional Requires and Obsoletes for legacy packages
* Tue Dec 13 2022 Björn Esser <besser82@fedoraproject.org> - 4.4.33-4 * Tue Dec 13 2022 Björn Esser <besser82@fedoraproject.org> - 4.4.33-4
- Add upstream patch to improve performance on SHA512 computation - Add upstream patch to improve performance on SHA512 computation