rpmbuild: Fix dpdk version check and bump it to 20.11

dpdk packages are versioned differently across different distros. In
particular, packages under fedora use Epoch in the spec. This requires
the condition to include this value, otherwise rpmbuild assumes it's 0
failing the check.

Also, add extra log to build_rpm_with_rpmed_dpdk test to indicate
when rpmbuild fails due to not resolved build dependencies.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ia4bab6e6486e20c24f7386a085b499462fe5fe0d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14662
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Michal Berger 2022-09-24 22:36:25 +02:00 committed by Konrad Sztyber
parent 4bdf131f56
commit 23ed60ea31
2 changed files with 17 additions and 4 deletions

View File

@ -36,13 +36,20 @@ function build_rpms() (
# Separate run to see the final .spec in use # Separate run to see the final .spec in use
GEN_SPEC=yes BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@" GEN_SPEC=yes BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@"
# Actual build # Actual build
BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@" BUILDDIR=$builddir MAKEFLAGS="$MAKEFLAGS" SPDK_VERSION="$version" DEPS=no "$rootdir/rpmbuild/rpm.sh" "$@" || return $?
install_uninstall_rpms install_uninstall_rpms
} }
build_rpm_with_rpmed_dpdk() { build_rpm_with_rpmed_dpdk() {
local es=0
sudo dnf install -y dpdk-devel sudo dnf install -y dpdk-devel
build_rpm --with-shared --with-dpdk build_rpm --with-shared --with-dpdk || es=$?
if ((es == 11)); then
echo "ERROR: Failed to resolve required build dependencies. Please review the build log." >&2
fi
return "$es"
} }
build_rpm_from_gen_spec() { build_rpm_from_gen_spec() {

View File

@ -95,8 +95,14 @@ build_macros() {
# Don't build dpdk rpm rather define proper requirements for the spdk. # Don't build dpdk rpm rather define proper requirements for the spdk.
macros+=(-D "dpdk 0") macros+=(-D "dpdk 0")
macros+=(-D "shared 1") macros+=(-D "shared 1")
requirements=${requirements:+$requirements, }"dpdk-devel >= 19.11" # This maps how Epoch is used inside dpdk packages across different distros. It's
build_requirements=${build_requirements:+$build_requirements, }"dpdk-devel >= 19.11" # mainly relevant when comparing version of required packages. Default maps to 0.
local -A dpdk_rpm_epoch["fedora"]=2
local dpdk_version_min=${dpdk_rpm_epoch["$ID"]:-0}:20.11
local dpdk_req="dpdk-devel >= $dpdk_version_min"
requirements=${requirements:+$requirements, }"$dpdk_req"
build_requirements=${build_requirements:+$build_requirements, }"$dpdk_req"
else else
dpdk_build_path=$(get_config with-dpdk print) dpdk_build_path=$(get_config with-dpdk print)
dpdk_path=$(dirname "$dpdk_build_path") dpdk_path=$(dirname "$dpdk_build_path")