From: Noa Osherovich <noaos@xxxxxxxxxxxx> Update spec file and cbuild dependencies to allow pyverbs to be included in SUSE distributions. Signed-off-by: Noa Osherovich <noaos@xxxxxxxxxxxx> Signed-off-by: Alaa Hleihel <alaa@xxxxxxxxxxxx> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- README.md | 2 +- buildlib/cbuild | 4 ++++ suse/rdma-core.spec | 28 ++++++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d72b408e..f7ea6030 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ NOTE: Fedora Core uses the name 'ninja-build' for the 'ninja' command. ### OpenSuSE ```sh -$ zypper install cmake gcc libnl3-devel libudev-devel ninja pkg-config valgrind-devel +$ zypper install cmake gcc libnl3-devel libudev-devel ninja pkg-config valgrind-devel python3-deve python3-Cython ``` ## Building on CentOS 6/7 diff --git a/buildlib/cbuild b/buildlib/cbuild index adbe4482..43450332 100755 --- a/buildlib/cbuild +++ b/buildlib/cbuild @@ -344,8 +344,11 @@ class leap(ZypperEnvironment): 'rpm-build', 'systemd-devel', 'valgrind-devel', + 'python3-Cython', + 'python3-devel', }; rpmbuild_options = [ "--without=curlmini" ]; + build_pyverbs = True; name = "opensuse-15.0"; aliases = {"leap"}; @@ -355,6 +358,7 @@ class tumbleweed(ZypperEnvironment): name = "tumbleweed"; specfile = "suse/rdma-core.spec"; rpmbuild_options = [ "--without=curlmini" ]; + build_pyverbs = True; # tumbleweed no longer includes python2 in the base docker images, only python3, # use that instead. python_cmd = "python3"; diff --git a/suse/rdma-core.spec b/suse/rdma-core.spec index 18bf014b..da4edd30 100644 --- a/suse/rdma-core.spec +++ b/suse/rdma-core.spec @@ -19,6 +19,7 @@ %bcond_without systemd # Do not build static libs by default. %define with_static %{?_with_static: 1} %{?!_with_static: 0} +%define with_pyverbs %{?_with_pyverbs: 1} %{?!_with_pyverbs: 0} %define git_ver %{nil} Name: rdma-core @@ -61,6 +62,10 @@ BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(udev) BuildRequires: python3-base +%if %{with_pyverbs} +BuildRequires: python3-devel +BuildRequires: python3-Cython +%endif %ifnarch s390 s390x BuildRequires: valgrind-devel %endif @@ -153,7 +158,7 @@ Obsoletes: ibacm-devel < %{version}-%{release} BuildRequires: pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-route-3.0) %endif - + %description devel RDMA core development libraries and headers. @@ -325,6 +330,14 @@ rdma-ndd is a system daemon which watches for rdma device changes and/or hostname changes and updates the Node Description of the rdma devices based on those changes. +%package -n python3-pyverbs +Summary: Python3 API over IB verbs +Group: Development/Languages/Python + +%description -n python3-pyverbs +Pyverbs is a Cython-based Python API over libibverbs, providing an +easy, object-oriented access to IB verbs. + %prep %setup -q -n %{name}-%{version}%{git_ver} @@ -361,7 +374,13 @@ on those changes. %if %{with_static} -DENABLE_STATIC=1 \ %endif - %{EXTRA_CMAKE_FLAGS} +%if %{with_pyverbs} + -DPYTHON_EXECUTABLE:PATH=%{__python3} \ + -DCMAKE_INSTALL_PYTHON_ARCH_LIB:PATH=%{python3_sitearch} \ +%else + -DNO_PYVERBS=1 +%endif + %{EXTRA_CMAKE_FLAGS} %make_jobs %install @@ -691,4 +710,9 @@ rm -rf %{buildroot}/%{_sbindir}/srp_daemon.sh %{_mandir}/man8/rdma-ndd.8* %{_libexecdir}/udev/rules.d/60-rdma-ndd.rules +%if %{with_pyverbs} +%files -n python3-pyverbs +%{python3_sitearch}/pyverbs +%endif + %changelog -- 2.19.1