diff --git a/libxcrypt.spec b/libxcrypt.spec index 29037a5..41a398c 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -24,10 +24,34 @@ %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 glibc,strong +%global obsolete_api no +%global compat_methods glibc +%global compat_api glibc +%else +%global hash_methods all +%global obsolete_api glibc +%endif + + # Needed for out-of-tree builds. %global _configure ../configure +# Common configure options. +%global common_configure_options \\\ + --libdir=/%{_lib} \\\ + --disable-silent-rules \\\ + --enable-shared \\\ + --enable-static \\\ + --disable-failure-tokens \\\ + --srcdir=.. \\\ + --with-pkgconfigdir=%{_libdir}/pkgconfig + + # Add generation of HMAC checksums of the final stripped # binaries. %%define with lazy globbing is used here # intentionally, because using %%global does not work. @@ -179,33 +203,21 @@ discouraged. %build pushd %{_vpath_builddir} +%configure \ + %{common_configure_options} \ + --enable-hashes=%{hash_methods} \ + --enable-obsolete-api=%{obsolete_api} +%make_build +popd %if %{with new_api} -%configure \ - --libdir=/%{_lib} \ - --disable-silent-rules \ - --enable-shared \ - --enable-static \ - --disable-failure-tokens \ - --enable-hashes=strong,glibc \ - --enable-obsolete-api=no \ - --srcdir=.. \ - --with-pkgconfigdir=%{_libdir}/pkgconfig -%make_build -popd pushd %{_vpath_builddir}-compat -%endif -%configure \ - --libdir=/%{_lib} \ - --disable-silent-rules \ - --enable-shared \ - --enable-static \ - --disable-failure-tokens \ - --enable-hashes=all \ - --enable-obsolete-api=glibc \ - --srcdir=.. \ - --with-pkgconfigdir=%{_libdir}/pkgconfig +%configure \ + %{common_configure_options} \ + --enable-hashes=%{compat_methods} \ + --enable-obsolete-api=%{compat_api} %make_build popd +%endif %install @@ -296,6 +308,7 @@ done %changelog * Mon Oct 01 2018 Björn Esser - 4.2.1-3 - Drop compat-devel package +- Set configure options from globals * Sun Sep 30 2018 Björn Esser - 4.2.1-2 - Build out-of-tree