From d05cf0559e165b95c997f7a5bc86e2116484fe74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 14 Jan 2019 19:29:09 +0100 Subject: [PATCH] Add an option to disable the compat-package for future use --- libxcrypt.spec | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/libxcrypt.spec b/libxcrypt.spec index 2c0d6ba..c000484 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -5,6 +5,12 @@ %bcond_with new_api %endif +# Build the compat package? +%if 0%{?fedora} >= 999 || 0%{?rhel} >= 99 +%bcond_with compat_pkg +%else +%bcond_without compat_pkg +%endif # Run memcheck? # Valgrind does not work well on %%{power64} arches. @@ -21,10 +27,12 @@ %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 @@ -38,8 +46,10 @@ %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 @@ -90,7 +100,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 ]]; then \ +if [[ %{with new_api} == 1 && %{with compat_pkg} == 1 ]]; then \ %{_bindir}/fipshmac %{buildroot}/%{_lib}/libcrypt.so.%{csov} \ %{__ln_s} .libcrypt.so.%{csov}.hmac \\\ %{buildroot}/%{_lib}/.libcrypt.so.%{csoc}.hmac \ @@ -173,7 +183,7 @@ that have been provided by glibc's libcrypt.so.1. %endif -%if %{with new_api} +%if %{with new_api} && %{with compat_pkg} %package compat Summary: Compatibility library providing legacy API functions @@ -228,6 +238,7 @@ This version of the %{name} package ships the libcrypt.so2 library and does not provide the legacy API functions that have been provided by glibc's libcrypt.so.1. The removed functions by name are encrypt, encrypt_r, setkey, setkey_r, and fcrypt. +%if %{with compat_pkg} If you are using a third-party application that links against those functions, or that is linked against glibc's libcrypt, @@ -236,6 +247,7 @@ you may need to install the %{name}-compat package manually. All existing binary executables linked against glibc's libcrypt should work unmodified with the libcrypt.so.1 library supplied by the %{name}-compat package. +%endif EOF %endif %{__mkdir_p} %{_vpath_builddir}{,-compat} @@ -251,7 +263,7 @@ pushd %{_vpath_builddir} %make_build popd -%if %{with new_api} +%if %{with new_api} && %{with compat_pkg} # Build the compatibility library. pushd %{_vpath_builddir}-compat %configure \ @@ -264,7 +276,7 @@ popd %install -%if %{with new_api} +%if %{with new_api} && %{with compat_pkg} # Install the compatibility library. %make_install -C %{_vpath_builddir}-compat @@ -295,7 +307,7 @@ fi %check -%if %{with new_api} +%if %{with new_api} && %{with compat_pkg} for dir in %{_vpath_builddir} %{_vpath_builddir}-compat; do %else for dir in %{_vpath_builddir}; do @@ -322,7 +334,7 @@ done %ldconfig_scriptlets -%if %{with new_api} +%if %{with new_api} && %{with compat_pkg} %ldconfig_scriptlets compat %endif @@ -338,7 +350,7 @@ done %{_mandir}/man5/crypt.5.* -%if %{with new_api} +%if %{with new_api} && %{with compat_pkg} %files compat /%{_lib}/.libcrypt.so.{%{csoc},%{csov}}.hmac /%{_lib}/libcrypt.so.{%{csoc},%{csov}} @@ -365,6 +377,7 @@ done %changelog * Mon Jan 14 2019 Björn Esser - 4.4.2-5 - Build the compat package with glibc hashing methods only +- Add an option to disable the compat-package for future use * Mon Jan 14 2019 Björn Esser - 4.4.2-4 - Bump SO-name for Fedora >= 30 and enable compat package (#1666033)