rpmbuild: Include libvfio-user libraries

In case --with-shared build bundles with --with-vfio-user the vfio .so*
files must be also included for the applications to link properly. To
that end, create a separate package that will ship with these files on
board.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I2c7e933b531b67a00e5af1e3b4dfbfaf8759d7ad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14800
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
This commit is contained in:
Michal Berger 2022-09-30 11:21:19 +02:00 committed by Tomasz Zawadzki
parent 5e75ad20d0
commit cd9266403a
2 changed files with 24 additions and 0 deletions

View File

@ -116,6 +116,10 @@ build_macros() {
macros+=(-D "libdir $(get_config libdir print)")
fi
if get_config with-vfio-user; then
macros+=(-D "vfio_user 1")
fi
if [[ $deps == no ]]; then
macros+=(-D "deps 0")
fi

View File

@ -9,6 +9,7 @@
%{!?build_requirements:%define build_requirements 0}
%{!?shared:%define shared 0}
%{!?libdir:%define libdir /usr/local/lib}
%{!?vfio_user:%define vfio_user 0}
# Spec metadata
Name: spdk
@ -83,6 +84,10 @@ cfs %{buildroot}/usr/local/lib/dpdk $(find %{dpdk_path}/intel-ipsec-mb/ -name '*
cfs %{buildroot}/usr/local/lib/dpdk $(find %{dpdk_path}/isa-l/ -name '*.so*')
%endif
# Include libvfio-user libs in case --with-vfio-user is in use together with --with-shared
%if %{vfio_user} && %{shared}
cfs %{buildroot}/usr/local/lib/libvfio-user $(find build/libvfio-user/ -name '*.so*' | grep -v .symbols)
%endif
# Try to include extra binaries that were potentially built
cfs %{buildroot}/usr/local/bin build/fio
@ -96,6 +101,7 @@ mkdir -p %{buildroot}%{python3_sitelib}
cat <<-EOF > %{buildroot}/etc/ld.so.conf.d/spdk.conf
%{libdir}
/usr/local/lib/dpdk
/usr/local/lib/libvfio-user
EOF
cat <<-'EOF' > %{buildroot}/etc/profile.d/spdk_path.sh
@ -168,6 +174,20 @@ DPDK libraries
ldconfig
%endif
%if %{vfio_user} && %{shared}
%package libvfio-user
Summary: libvfio-user libraries
%description libvfio-user
libvfio-user libraries
%files libvfio-user
/usr/local/lib/libvfio-user
%post libvfio-user
ldconfig
%endif
%changelog
* Tue Feb 16 2021 Michal Berger <michalx.berger@intel.com>
- Initial RPM .spec for the SPDK