2016-04-26 11:01:32 +02:00
|
|
|
#
|
2022-03-03 11:14:10 +01:00
|
|
|
# spec file
|
2016-04-26 11:01:32 +02:00
|
|
|
#
|
2022-03-03 11:14:10 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2016-04-26 11:01:32 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-09-24 14:05:13 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-04-26 11:01:32 +02:00
|
|
|
#
|
2017-02-20 10:25:09 +01:00
|
|
|
# needssslcertforbuild
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
|
2019-10-03 10:18:33 +02:00
|
|
|
%define flavor @BUILD_FLAVOR@%{nil}
|
2022-03-03 11:14:10 +01:00
|
|
|
%define aarch64_machine armv8a
|
2019-10-03 10:18:33 +02:00
|
|
|
%define exclusive_arch aarch64 x86_64 ppc64le
|
2022-03-03 11:14:10 +01:00
|
|
|
|
2019-10-03 10:18:33 +02:00
|
|
|
%define name_tag %{nil}
|
|
|
|
%define summary_tag %{nil}
|
2022-03-03 11:14:10 +01:00
|
|
|
%if "%{flavor}" == "thunderx"
|
2019-10-03 10:18:33 +02:00
|
|
|
%define name_tag -thunderx
|
2019-11-20 07:22:42 +01:00
|
|
|
%define summary_tag (thunderx)
|
2022-03-03 11:14:10 +01:00
|
|
|
%define aarch64_machine thunderx
|
2019-10-03 10:18:33 +02:00
|
|
|
%define exclusive_arch aarch64
|
|
|
|
%endif
|
2022-03-03 11:14:10 +01:00
|
|
|
|
|
|
|
# http://doc.dpdk.org/guides-21.11/linux_gsg/build_dpdk.html#adjusting-build-options
|
|
|
|
%define platform generic
|
|
|
|
%define machine auto
|
2016-07-12 11:27:16 +02:00
|
|
|
%ifarch aarch64
|
2022-03-03 11:14:10 +01:00
|
|
|
%define machine %{aarch64_machine2}
|
2016-07-12 11:27:16 +02:00
|
|
|
%endif
|
2020-05-20 11:15:07 +02:00
|
|
|
# This is in sync with <src>/ABI_VERSION
|
|
|
|
# TODO: automate this sync
|
2022-03-03 11:14:10 +01:00
|
|
|
%define maj 22
|
2020-05-20 11:15:07 +02:00
|
|
|
%define min 0
|
2022-03-03 11:14:10 +01:00
|
|
|
#%%define lname libdpdk-%%{maj}_%%{min}
|
|
|
|
%define lname libdpdk-%{maj}
|
2016-10-06 16:10:19 +02:00
|
|
|
# Add option to build without examples
|
|
|
|
%bcond_without examples
|
2016-04-26 11:01:32 +02:00
|
|
|
# Add option to build without tools
|
|
|
|
%bcond_without tools
|
2022-03-03 11:14:10 +01:00
|
|
|
#
|
2019-10-03 10:18:33 +02:00
|
|
|
Name: dpdk%{name_tag}
|
2022-05-02 09:26:50 +02:00
|
|
|
Version: 21.11.1
|
2016-04-26 11:01:32 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Set of libraries and drivers for fast packet processing
|
2018-02-27 17:09:34 +01:00
|
|
|
License: BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-only
|
2016-04-26 11:01:32 +02:00
|
|
|
Group: System/Libraries
|
2022-03-03 11:14:10 +01:00
|
|
|
URL: https://www.dpdk.org/
|
|
|
|
Source: https://fast.dpdk.org/rel/dpdk-%{version}.tar.xz
|
2017-02-13 12:42:18 +01:00
|
|
|
Source1: preamble
|
2022-03-03 11:14:10 +01:00
|
|
|
# PATCH-FIX-OPENSUSE PATCH-FEATURE-UPSTREAM
|
|
|
|
Patch0: 0001-build-try-to-get-kernel-version-from-kernel-source.patch
|
|
|
|
Patch1: 0002-SLE15-SP3-compatibility-patch-for-kni.patch
|
2022-05-29 20:51:55 +02:00
|
|
|
Patch2: kni-fix-build-with-Linux-5.18.patch
|
2022-03-03 11:14:10 +01:00
|
|
|
BuildRequires: binutils
|
2016-04-26 11:01:32 +02:00
|
|
|
BuildRequires: doxygen
|
2016-05-12 15:45:14 +02:00
|
|
|
BuildRequires: fdupes
|
2021-09-21 11:21:37 +02:00
|
|
|
BuildRequires: kernel-syms
|
2022-03-03 11:14:10 +01:00
|
|
|
BuildRequires: libfdt-devel
|
|
|
|
BuildRequires: meson >= 0.49.2
|
2021-09-21 11:21:37 +02:00
|
|
|
BuildRequires: modutils
|
2017-02-13 12:42:18 +01:00
|
|
|
BuildRequires: pesign-obs-integration
|
2022-03-03 11:14:10 +01:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: python3
|
|
|
|
BuildRequires: python3-Sphinx
|
|
|
|
BuildRequires: python3-pyelftools >= 0.22
|
|
|
|
BuildRequires: rdma-core-devel
|
|
|
|
BuildRequires: pkgconfig(jansson)
|
|
|
|
BuildRequires: pkgconfig(libcrypto)
|
|
|
|
BuildRequires: pkgconfig(libelf)
|
|
|
|
BuildRequires: pkgconfig(libmnl)
|
|
|
|
BuildRequires: pkgconfig(libpcap)
|
|
|
|
BuildRequires: pkgconfig(numa)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
2020-05-20 11:15:07 +02:00
|
|
|
Conflicts: dpdk-any
|
|
|
|
Provides: dpdk-any = %{version}
|
2021-11-21 12:10:03 +01:00
|
|
|
Obsoletes: dpdk-kmp-trace < %{version}
|
2022-03-03 11:14:10 +01:00
|
|
|
ExclusiveArch: %{exclusive_arch}
|
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
|
|
|
|
# https://bugzilla.opensuse.org/show_bug.cgi?id=1196511
|
|
|
|
BuildRequires: pkgconfig(libbpf)
|
2018-04-20 15:41:31 +02:00
|
|
|
%endif
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
The Data Plane Development Kit is a set of libraries and drivers for
|
|
|
|
fast packet processing in the user space.
|
|
|
|
|
|
|
|
%package devel
|
2019-10-03 10:18:33 +02:00
|
|
|
Summary: Data Plane Development Kit development files %{summary_tag}
|
2016-04-26 11:01:32 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2017-08-25 12:24:55 +02:00
|
|
|
Requires: %{lname} = %{version}
|
2020-05-20 11:15:07 +02:00
|
|
|
Conflicts: dpdk-any-devel
|
2017-01-24 11:01:26 +01:00
|
|
|
Provides: dpdk-any-devel = %{version}
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package contains the headers and other files needed for developing
|
|
|
|
applications with the Data Plane Development Kit.
|
|
|
|
|
2022-03-03 11:14:10 +01:00
|
|
|
%package devel-static
|
|
|
|
Summary: Data Plane Development Kit static development files %{summary_tag}
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: %{name}-devel = %{version}
|
|
|
|
|
|
|
|
%description devel-static
|
|
|
|
This package contains the static library files needed for developing
|
|
|
|
applications with the Data Plane Development Kit.
|
|
|
|
|
2017-08-25 12:24:55 +02:00
|
|
|
%package -n %{lname}
|
2019-10-03 10:18:33 +02:00
|
|
|
Summary: Data Plane Development Kit runtime libraries %{summary_tag}
|
2017-08-25 12:24:55 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Provides: %{lname}-any = %{version}
|
|
|
|
|
|
|
|
%description -n %{lname}
|
|
|
|
This package contains the runtime libraries needed for 3rd party application
|
|
|
|
to use the Data Plane Development Kit.
|
|
|
|
|
2016-04-26 11:01:32 +02:00
|
|
|
%package doc
|
2019-10-03 10:18:33 +02:00
|
|
|
Summary: Data Plane Development Kit API documentation %{summary_tag}
|
2016-07-12 11:27:16 +02:00
|
|
|
Group: System/Libraries
|
2020-05-20 11:15:07 +02:00
|
|
|
Conflicts: dpdk-any-doc
|
2017-01-24 11:01:26 +01:00
|
|
|
Provides: dpdk-any-doc = %{version}
|
2020-05-20 11:15:07 +02:00
|
|
|
BuildArch: noarch
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%description doc
|
|
|
|
API programming documentation for the Data Plane Development Kit.
|
|
|
|
|
|
|
|
%if %{with tools}
|
|
|
|
%package tools
|
2019-10-03 10:18:33 +02:00
|
|
|
Summary: Tools for setting up Data Plane Development Kit environment %{summary_tag}
|
2016-07-12 11:27:16 +02:00
|
|
|
Group: System/Libraries
|
2016-04-26 11:01:32 +02:00
|
|
|
Requires: %{name} = %{version}
|
|
|
|
Requires: findutils
|
|
|
|
Requires: iproute
|
|
|
|
Requires: kmod
|
|
|
|
Requires: pciutils
|
2020-05-20 11:15:07 +02:00
|
|
|
Conflicts: dpdk-any-tools
|
2017-01-24 11:01:26 +01:00
|
|
|
Provides: dpdk-any-tools = %{version}
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%description tools
|
|
|
|
This package contains tools for setting up Data Plane Development Kit environment
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with examples}
|
|
|
|
%package examples
|
2019-10-03 10:18:33 +02:00
|
|
|
Summary: Data Plane Development Kit example applications %{summary_tag}
|
2016-07-12 11:27:16 +02:00
|
|
|
Group: System/Libraries
|
2016-04-26 11:01:32 +02:00
|
|
|
BuildRequires: libvirt-devel
|
2020-05-20 11:15:07 +02:00
|
|
|
Conflicts: dpdk-any-examples
|
2017-01-24 11:01:26 +01:00
|
|
|
Provides: dpdk-any-examples = %{version}
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%description examples
|
|
|
|
Example applications utilizing the Data Plane Development Kit, such
|
|
|
|
as L2 and L3 forwarding.
|
|
|
|
%endif
|
|
|
|
|
2017-02-13 12:42:18 +01:00
|
|
|
%package kmp
|
2019-10-03 10:18:33 +02:00
|
|
|
Summary: DPDK KNI kernel module %{summary_tag}
|
2017-02-13 12:42:18 +01:00
|
|
|
Group: System/Kernel
|
|
|
|
BuildRequires: %{kernel_module_package_buildreqs}
|
2020-05-20 11:15:07 +02:00
|
|
|
Conflicts: dpdk-any-kmp
|
2017-02-13 12:42:18 +01:00
|
|
|
%suse_kernel_module_package -p %{_sourcedir}/preamble pae 64kb
|
|
|
|
|
|
|
|
%description kmp
|
|
|
|
The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane.
|
|
|
|
|
2017-01-02 16:27:54 +01:00
|
|
|
%define sdkdir %{_datadir}/dpdk
|
|
|
|
%define docdir %{_docdir}/dpdk
|
|
|
|
%define incdir %{_includedir}/dpdk
|
2019-11-20 07:22:42 +01:00
|
|
|
%define pmddir %{_libdir}/dpdk-pmds-%{maj}.%{min}
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%prep
|
2022-03-03 11:14:10 +01:00
|
|
|
# can't use %%{name} because of dpdk-thunderx
|
2022-05-02 09:26:50 +02:00
|
|
|
%autosetup -p1 -n dpdk-stable-%{version}
|
2017-05-24 09:37:09 +02:00
|
|
|
|
2022-03-03 11:14:10 +01:00
|
|
|
# Skip not supported examples
|
|
|
|
sed -i "/performance-thread/d" examples/meson.build
|
2016-04-26 11:01:32 +02:00
|
|
|
|
2020-05-20 11:15:07 +02:00
|
|
|
# Verify ABI
|
|
|
|
[ "$(cat ABI_VERSION)" = "%{maj}.%{min}" ] || exit 1
|
|
|
|
|
2016-04-26 11:01:32 +02:00
|
|
|
%build
|
2022-03-03 11:14:10 +01:00
|
|
|
%define _vpath_builddir "build-%{_target_cpu}-$flavor"
|
2020-08-11 08:57:44 +02:00
|
|
|
|
2022-03-03 11:14:10 +01:00
|
|
|
%ifarch x86_64
|
|
|
|
export CFLAGS="%{optflags} -msse4"
|
2018-04-20 15:41:31 +02:00
|
|
|
%endif
|
2022-03-03 11:14:10 +01:00
|
|
|
examples="all"
|
2017-02-13 12:42:18 +01:00
|
|
|
for flavor in %{flavors_to_build}; do
|
2022-03-03 11:14:10 +01:00
|
|
|
%meson --includedir=%{incdir} \
|
|
|
|
-Ddefault_library=shared \
|
|
|
|
-Denable_docs=true \
|
|
|
|
-Db_lto=true \
|
|
|
|
%if %{with examples}
|
|
|
|
-Dexamples="$examples" \
|
|
|
|
%endif
|
|
|
|
-Dplatform="%{platform}" \
|
|
|
|
-Dcpu_instruction_set=%{machine} \
|
|
|
|
-Denable_kmods=true \
|
|
|
|
-Ddrivers_install_subdir=%{pmddir} \
|
|
|
|
-Dkernel_dir="%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor"
|
|
|
|
%meson_build
|
|
|
|
# Make sure examples are only built once
|
|
|
|
examples=""
|
2017-02-13 12:42:18 +01:00
|
|
|
done
|
2016-08-09 12:58:13 +02:00
|
|
|
|
2016-04-26 11:01:32 +02:00
|
|
|
%install
|
2022-03-03 11:14:10 +01:00
|
|
|
examples="%{?with_examples:all}"
|
2017-02-13 12:42:18 +01:00
|
|
|
for flavor in %{flavors_to_build}; do
|
2022-03-03 11:14:10 +01:00
|
|
|
%meson_install
|
|
|
|
# Also install the example binaries
|
|
|
|
if [ ! -z "$examples" ]; then
|
|
|
|
for f in %{_vpath_builddir}/examples/dpdk-*; do
|
|
|
|
bn=$(basename "$f")
|
|
|
|
[ -f "$f" ] && install -Dm 0755 ${f} "%{buildroot}%{_bindir}/${bn/dpdk-/dpdk_example_}"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
examples=""
|
2017-02-13 12:42:18 +01:00
|
|
|
done
|
2016-04-26 11:01:32 +02:00
|
|
|
|
2022-03-03 11:14:10 +01:00
|
|
|
# Fix Kernel modules on Factory (/usr merge)
|
|
|
|
%if 0%{?suse_version} > 1550
|
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib
|
|
|
|
mv %{buildroot}/lib/modules %{buildroot}%{_prefix}/lib
|
2016-04-26 11:01:32 +02:00
|
|
|
%endif
|
|
|
|
|
2022-03-03 11:14:10 +01:00
|
|
|
# Fix documentation
|
|
|
|
mkdir -p %{buildroot}%{docdir}
|
|
|
|
mv %{buildroot}%{_datadir}/doc/dpdk %{buildroot}%{docdir}
|
2016-04-26 11:01:32 +02:00
|
|
|
|
2022-03-03 11:14:10 +01:00
|
|
|
%if ! %{with tools}
|
|
|
|
# Remove tools if not needed
|
|
|
|
for tool in dpdk-devbind.py dpdk-pmdinfo.py dpdk-telemetry.py dpdk-hugepages.py; do
|
|
|
|
rm -rf "%{buildroot}%{_bindir}/$tool"
|
2017-09-06 11:56:45 +02:00
|
|
|
done
|
2022-03-03 11:14:10 +01:00
|
|
|
%else
|
|
|
|
# Add compatibility symlink
|
|
|
|
mkdir -p %{buildroot}%{_sbindir}
|
|
|
|
ln -s %{_bindir}/dpdk-devbind.py %{buildroot}%{_sbindir}/dpdk_nic_bind
|
|
|
|
%endif
|
2016-10-06 16:10:19 +02:00
|
|
|
|
2021-05-22 13:04:14 +02:00
|
|
|
# Fix interpreter
|
2021-07-28 16:45:20 +02:00
|
|
|
find %{buildroot} -name "*.py" -exec sed -i 's|python$|python3|' \{\} +
|
2021-05-22 13:04:14 +02:00
|
|
|
find %{buildroot} -name "*.py" -exec sed -i 's|env python|python|' \{\} +
|
|
|
|
|
2016-04-26 11:01:32 +02:00
|
|
|
# Remove duplicates
|
2022-03-03 11:14:10 +01:00
|
|
|
%fdupes %{buildroot}/%{docdir}
|
|
|
|
%fdupes %{buildroot}/%{sdkdir}/examples
|
|
|
|
|
|
|
|
# Fix broken symlink (yes with * in its name)
|
|
|
|
rm -v "%{buildroot}%{_libdir}/librte_*.so*"
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%post devel -p /sbin/ldconfig
|
|
|
|
%postun devel -p /sbin/ldconfig
|
2017-08-25 12:24:55 +02:00
|
|
|
%post -n %{lname} -p /sbin/ldconfig
|
|
|
|
%postun -n %{lname} -p /sbin/ldconfig
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%files
|
2022-03-03 11:14:10 +01:00
|
|
|
%{_bindir}/dpdk-dumpcap
|
2016-10-06 16:10:19 +02:00
|
|
|
%{_bindir}/dpdk-pdump
|
2022-03-03 11:14:10 +01:00
|
|
|
%{_bindir}/dpdk-proc-info
|
|
|
|
%{_bindir}/dpdk-test*
|
2016-04-26 11:01:32 +02:00
|
|
|
|
2017-08-25 12:24:55 +02:00
|
|
|
%files -n %{lname}
|
2022-03-03 11:14:10 +01:00
|
|
|
%license license/gpl-2.0.txt license/lgpl-2.1.txt license/bsd-3-clause.txt
|
2016-04-26 11:01:32 +02:00
|
|
|
%{_libdir}/*.so.*
|
2022-03-03 11:14:10 +01:00
|
|
|
%dir %{pmddir}
|
|
|
|
%{pmddir}/*.so.*
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
#BSD
|
|
|
|
%{incdir}/
|
2022-03-03 11:14:10 +01:00
|
|
|
%{sdkdir}/
|
|
|
|
%{pmddir}/*.so
|
|
|
|
%{_libdir}/*.so
|
|
|
|
%{_libdir}/pkgconfig/libdpdk*.pc
|
2016-04-26 11:01:32 +02:00
|
|
|
%if %{with examples}
|
|
|
|
%exclude %{sdkdir}/examples/
|
|
|
|
%endif
|
2022-03-03 11:14:10 +01:00
|
|
|
|
|
|
|
%files devel-static
|
|
|
|
#BSD
|
2016-04-26 11:01:32 +02:00
|
|
|
%{_libdir}/*.a
|
2022-03-03 11:14:10 +01:00
|
|
|
|
|
|
|
%files doc
|
|
|
|
#BSD
|
|
|
|
%doc %docdir
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%if %{with tools}
|
|
|
|
%files tools
|
|
|
|
%{_sbindir}/dpdk_nic_bind
|
2022-03-03 11:14:10 +01:00
|
|
|
%{_bindir}/dpdk-*.py
|
2016-04-26 11:01:32 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with examples}
|
|
|
|
%files examples
|
|
|
|
%{_bindir}/dpdk_example_*
|
|
|
|
%doc %{sdkdir}/examples
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|