Enable tests when the NX GZIP device is available

Although the chances of getting an NX GZIP device available at build
time are low, they are not zero.
Enable the tests if we get lucky.
This commit is contained in:
Tulio Magno Quites Machado Filho 2021-12-03 10:57:15 -03:00 committed by Tulio Magno Quites Machado Filho
parent ce6fbb1a86
commit d41ff496fd

View File

@ -1,6 +1,6 @@
Name: libnxz Name: libnxz
Version: 0.62 Version: 0.62
Release: 1%{?dist} Release: 2%{?dist}
Summary: Zlib implementation for POWER processors Summary: Zlib implementation for POWER processors
License: ASL 2.0 License: ASL 2.0
Url: https://github.com/libnxz/power-gzip Url: https://github.com/libnxz/power-gzip
@ -45,9 +45,12 @@ application that use %{name}.
%make_build FLG="-std=gnu11 %{build_cflags} " %make_build FLG="-std=gnu11 %{build_cflags} "
%check %check
# libnxz tests only work on P9 servers or newer, bare metal, with # libnxz tests only work on P9 servers or newer, with Linux >= 5.8.
# Linux >= 5.8. This combination is not guaranteed to have at build time, # This combination is not guaranteed to have at build time. Check if
# forcing us to disable the tests. # NX GZIP engine device is available before deciding to run the tests.
if [[ -w "/dev/crypto/nx-gzip" ]]; then
make -k %{?_smp_mflags} check
fi
%install %install
make install PREFIX="%{buildroot}%{_prefix}" LIBDIR="%{buildroot}%{_libdir}" make install PREFIX="%{buildroot}%{_prefix}" LIBDIR="%{buildroot}%{_libdir}"
@ -66,6 +69,9 @@ make install PREFIX="%{buildroot}%{_prefix}" LIBDIR="%{buildroot}%{_libdir}"
%{_libdir}/libnxz.a %{_libdir}/libnxz.a
%changelog %changelog
* Fri Dec 03 2021 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 0.62-2
- Enable tests if the NX GZIP engine is available.
* Mon Aug 16 2021 Raphael Moreira Zinsly <rzinsly@linux.ibm.com> - 0.62-1 * Mon Aug 16 2021 Raphael Moreira Zinsly <rzinsly@linux.ibm.com> - 0.62-1
- Update version. - Update version.