Reduce the number of hard-coded so-versions

This commit is contained in:
Daiki Ueno 2019-07-15 17:30:21 +02:00
parent 9bc33e7913
commit e0682aa6e2

View File

@ -1,3 +1,7 @@
# Recent so-version, so we do not bump accidentally.
%global nettle_so_ver 7
%global hogweed_so_ver 5
%bcond_without fips
Name: nettle
@ -55,10 +59,10 @@ make %{?_smp_mflags}
%{?__debug_package:%{__debug_install_post}} \
%{__arch_install_post} \
%{__os_install_post} \
fipshmac -d $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_libdir}/libnettle.so.7.* \
fipshmac -d $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.5.* \
file=`basename $RPM_BUILD_ROOT%{_libdir}/libnettle.so.7.*.hmac` && mv $RPM_BUILD_ROOT%{_libdir}/$file $RPM_BUILD_ROOT%{_libdir}/.$file && ln -s .$file $RPM_BUILD_ROOT%{_libdir}/.libnettle.so.7.hmac \
file=`basename $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.5.*.hmac` && mv $RPM_BUILD_ROOT%{_libdir}/$file $RPM_BUILD_ROOT%{_libdir}/.$file && ln -s .$file $RPM_BUILD_ROOT%{_libdir}/.libhogweed.so.5.hmac \
fipshmac -d $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_libdir}/libnettle.so.%{nettle_so_ver}.* \
fipshmac -d $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.%{hogweed_so_ver}.* \
file=`basename $RPM_BUILD_ROOT%{_libdir}/libnettle.so.%{nettle_so_ver}.*.hmac` && mv $RPM_BUILD_ROOT%{_libdir}/$file $RPM_BUILD_ROOT%{_libdir}/.$file && ln -s .$file $RPM_BUILD_ROOT%{_libdir}/.libnettle.so.%{nettle_so_ver}.hmac \
file=`basename $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.%{hogweed_so_ver}.*.hmac` && mv $RPM_BUILD_ROOT%{_libdir}/$file $RPM_BUILD_ROOT%{_libdir}/.$file && ln -s .$file $RPM_BUILD_ROOT%{_libdir}/.libhogweed.so.%{hogweed_so_ver}.hmac \
%{nil}
%endif
@ -75,8 +79,8 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/sexp-conv
rm -f $RPM_BUILD_ROOT%{_bindir}/nettle-hash
rm -f $RPM_BUILD_ROOT%{_bindir}/nettle-pbkdf2
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libnettle.so.7.*
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.5.*
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libnettle.so.%{nettle_so_ver}.*
chmod 0755 $RPM_BUILD_ROOT%{_libdir}/libhogweed.so.%{hogweed_so_ver}.*
%check
make check
@ -85,10 +89,10 @@ make check
%doc AUTHORS NEWS README
%license COPYINGv2 COPYING.LESSERv3
%{_infodir}/nettle.info.*
%{_libdir}/libnettle.so.7
%{_libdir}/libnettle.so.7.*
%{_libdir}/libhogweed.so.5
%{_libdir}/libhogweed.so.5.*
%{_libdir}/libnettle.so.%{nettle_so_ver}
%{_libdir}/libnettle.so.%{nettle_so_ver}.*
%{_libdir}/libhogweed.so.%{hogweed_so_ver}
%{_libdir}/libhogweed.so.%{hogweed_so_ver}.*
%if %{with fips}
%{_libdir}/.libhogweed.so.*.hmac
%{_libdir}/.libnettle.so.*.hmac