Commit cd926640 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

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: default avatarMichal Berger <michal.berger@intel.com>
Change-Id: I2c7e933b531b67a00e5af1e3b4dfbfaf8759d7ad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14800


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
parent 5e75ad20
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
+20 −0
Original line number Diff line number Diff line
@@ -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