Fix and simplify the conditionals for the compat package

This commit is contained in:
Björn Esser 2019-01-24 20:53:14 +01:00
parent dd49144394
commit 904ed6a794
No known key found for this signature in database
GPG Key ID: F52E98007594C21D

View File

@ -6,10 +6,10 @@
%endif
# Build the compat package?
%if 0%{?fedora} >= 999 || 0%{?rhel} >= 99
%bcond_with compat_pkg
%else
%if !(0%{?fedora} >= 999 || 0%{?rhel} >= 99 || %{without new_api})
%bcond_without compat_pkg
%else
%bcond_with compat_pkg
%endif
# Run memcheck?
@ -27,12 +27,6 @@
%global sol 0
%global sof 0
%global sov %{soc}.%{sol}.%{sof}
%if %{with compat_pkg}
%global csoc 1
%global csol 1
%global csof 0
%global csov %{csoc}.%{csol}.%{csof}
%endif
%else
%global soc 1
%global sol 1
@ -40,21 +34,29 @@
%global sov %{soc}.%{sol}.%{sof}
%endif
%if %{with compat_pkg}
%global csoc 1
%global csol 1
%global csof 0
%global csov %{csoc}.%{csol}.%{csof}
%endif
# Hash methods and API supported by libcrypt.
# NEVER EVER touch this, if you do NOT know what you are doing!
%if %{with new_api}
%global hash_methods fedora,glibc,strong
%global obsolete_api no
%if %{with compat_pkg}
%global compat_methods glibc
%global compat_api glibc
%endif
%else
%global hash_methods all
%global obsolete_api glibc
%endif
%if %{with compat_pkg}
%global compat_methods glibc
%global compat_api glibc
%endif
# Needed for the distribution README file.
%if 0%{?fedora}
@ -100,7 +102,7 @@
%{_bindir}/fipshmac %{buildroot}/%{_lib}/libcrypt.so.%{sov} \
%{__ln_s} .libcrypt.so.%{sov}.hmac \\\
%{buildroot}/%{_lib}/.libcrypt.so.%{soc}.hmac \
if [[ %{with new_api} == 1 && %{with compat_pkg} == 1 ]]; then \
if [[ %{with compat_pkg} == 1 ]]; then \
%{_bindir}/fipshmac %{buildroot}/%{_lib}/libcrypt.so.%{csov} \
%{__ln_s} .libcrypt.so.%{csov}.hmac \\\
%{buildroot}/%{_lib}/.libcrypt.so.%{csoc}.hmac \
@ -110,7 +112,7 @@ fi \
Name: libxcrypt
Version: 4.4.3
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Extended crypt library for descrypt, md5crypt, bcrypt, and others
# For explicit license breakdown, see the
@ -152,6 +154,10 @@ Provides: %{name}-common == %{version}-%{release}
Requires: glibc%{?_isa} >= 2.26.9000-46
%endif
%if %{with new_api} && %{without compat_pkg}
Obsoletes: %{name}-compat <= %{version}-%{release}
%endif
%if 0%{?fedora} >= 30
Recommends: mkpasswd
%endif
@ -183,7 +189,7 @@ that have been provided by glibc's libcrypt.so.1.
%endif
%if %{with new_api} && %{with compat_pkg}
%if %{with compat_pkg}
%package compat
Summary: Compatibility library providing legacy API functions
@ -263,7 +269,7 @@ pushd %{_vpath_builddir}
%make_build
popd
%if %{with new_api} && %{with compat_pkg}
%if %{with compat_pkg}
# Build the compatibility library.
pushd %{_vpath_builddir}-compat
%configure \
@ -276,7 +282,7 @@ popd
%install
%if %{with new_api} && %{with compat_pkg}
%if %{with compat_pkg}
# Install the compatibility library.
%make_install -C %{_vpath_builddir}-compat
@ -305,7 +311,7 @@ fi
%check
%if %{with new_api} && %{with compat_pkg}
%if %{with compat_pkg}
for dir in %{_vpath_builddir} %{_vpath_builddir}-compat; do
%else
for dir in %{_vpath_builddir}; do
@ -332,7 +338,7 @@ done
%ldconfig_scriptlets
%if %{with new_api} && %{with compat_pkg}
%if %{with compat_pkg}
%ldconfig_scriptlets compat
%endif
@ -348,7 +354,7 @@ done
%{_mandir}/man5/crypt.5.*
%if %{with new_api} && %{with compat_pkg}
%if %{with compat_pkg}
%files compat
/%{_lib}/.libcrypt.so.{%{csoc},%{csov}}.hmac
/%{_lib}/libcrypt.so.{%{csoc},%{csov}}
@ -373,6 +379,9 @@ done
%changelog
* Thu Jan 24 2019 Björn Esser <besser82@fedoraproject.org> - 4.4.3-2
- Fix and simplify the conditionals for the compat package
* Thu Jan 24 2019 Björn Esser <besser82@fedoraproject.org> - 4.4.3-1
- New upstream release