diff --git a/libxcrypt.spec b/libxcrypt.spec index 9c614e9..6c1a264 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -12,6 +12,13 @@ %bcond_with compat_pkg %endif +# Replace obsolete functions with a stub? +%if (0%{?fedora} >= 999 || 0%{?rhel} >= 99) && %{with compat_pkg} +%bcond_without enosys_stubs +%else +%bcond_with enosys_stubs +%endif + # Run memcheck? # Valgrind does not work well on %%{power64} arches. %ifnarch %{power64} @@ -57,6 +64,12 @@ %global compat_api glibc %endif +%if %{with enosys_stubs} +%global enosys_stubs yes +%else +%global enosys_stubs no +%endif + # Needed for the distribution README file. %if 0%{?fedora} @@ -262,20 +275,26 @@ EOF %build # Build the default system library. pushd %{_vpath_builddir} -%configure \ - %{common_configure_options} \ - --enable-hashes=%{hash_methods} \ - --enable-obsolete-api=%{obsolete_api} +%configure \ + %{common_configure_options} \ + --enable-hashes=%{hash_methods} \ + --enable-obsolete-api=%{obsolete_api} \ +%if %{with new_api} + --enable-obsolete-api-enosys=%{obsolete_api} +%else + --enable-obsolete-api-enosys=%{enosys_stubs} +%endif %make_build popd %if %{with compat_pkg} # Build the compatibility library. pushd %{_vpath_builddir}-compat -%configure \ - %{common_configure_options} \ - --enable-hashes=%{compat_methods} \ - --enable-obsolete-api=%{compat_api} +%configure \ + %{common_configure_options} \ + --enable-hashes=%{compat_methods} \ + --enable-obsolete-api=%{compat_api} \ + --enable-obsolete-api-enosys=%{enosys_stubs} %make_build popd %endif @@ -381,6 +400,7 @@ done %changelog * Thu Jan 24 2019 Björn Esser - 4.4.3-2 - Fix and simplify the conditionals for the compat package +- Add an option to replace unsafe functions in the compat lib with a stub * Thu Jan 24 2019 Björn Esser - 4.4.3-1 - New upstream release