2016-04-26 11:01:32 +02:00
|
|
|
#
|
2021-07-28 16:45:20 +02:00
|
|
|
# spec file
|
2016-04-26 11:01:32 +02:00
|
|
|
#
|
2021-04-22 16:25:17 +02:00
|
|
|
# Copyright (c) 2021 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}
|
|
|
|
%define aarch64_machine2 armv8a
|
|
|
|
%define exclusive_arch aarch64 x86_64 ppc64le
|
|
|
|
%define name_tag %{nil}
|
|
|
|
%define summary_tag %{nil}
|
|
|
|
%if "%flavor" == "thunderx"
|
|
|
|
%define name_tag -thunderx
|
2019-11-20 07:22:42 +01:00
|
|
|
%define summary_tag (thunderx)
|
2019-10-03 10:18:33 +02:00
|
|
|
%define aarch64_machine2 thunderx
|
|
|
|
%define exclusive_arch aarch64
|
|
|
|
%endif
|
2016-08-09 12:58:13 +02:00
|
|
|
%define machine native
|
|
|
|
%define machine2 default
|
2016-05-12 15:45:14 +02:00
|
|
|
%ifarch x86_64
|
2016-07-12 11:27:16 +02:00
|
|
|
%define machine native
|
2016-04-26 11:01:32 +02:00
|
|
|
%define target x86_64-%{machine}-linuxapp-gcc
|
2016-07-12 11:27:16 +02:00
|
|
|
%endif
|
|
|
|
%ifarch aarch64
|
2019-10-03 10:18:33 +02:00
|
|
|
%define machine2 %aarch64_machine2
|
2016-08-09 12:58:13 +02:00
|
|
|
%define target arm64-%{machine2}-linuxapp-gcc
|
2016-07-12 11:27:16 +02:00
|
|
|
%endif
|
2016-08-09 12:58:13 +02:00
|
|
|
%ifarch ppc64le
|
|
|
|
%define machine2 power8
|
|
|
|
%define target ppc_64-%{machine2}-linuxapp-gcc
|
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
|
|
|
|
%define maj 20
|
|
|
|
%define min 0
|
|
|
|
%define lname libdpdk-%{maj}_%{min}
|
2016-07-12 11:27:16 +02:00
|
|
|
%bcond_without shared
|
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
|
2019-10-03 10:18:33 +02:00
|
|
|
Name: dpdk%{name_tag}
|
2021-05-22 13:04:14 +02:00
|
|
|
Version: 19.11.8
|
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
|
2020-05-20 11:15:07 +02:00
|
|
|
URL: http://dpdk.org
|
2017-01-05 10:51:54 +01:00
|
|
|
Source: http://fast.dpdk.org/rel/dpdk-%{version}.tar.xz
|
2017-02-13 12:42:18 +01:00
|
|
|
Source1: preamble
|
2020-05-20 11:15:07 +02:00
|
|
|
Patch1: 0001-fix-cpu-compatibility.patch
|
2020-09-22 11:15:39 +02:00
|
|
|
Patch2: 0001-SLE15-SP3-compatibility-patch-for-kni.patch
|
2016-04-26 11:01:32 +02:00
|
|
|
BuildRequires: doxygen
|
2016-05-12 15:45:14 +02:00
|
|
|
BuildRequires: fdupes
|
2017-11-15 12:20:10 +01:00
|
|
|
BuildRequires: libelf-devel
|
2019-04-30 08:01:40 +02:00
|
|
|
BuildRequires: libmnl-devel
|
2016-04-26 11:01:32 +02:00
|
|
|
BuildRequires: libnuma-devel
|
|
|
|
BuildRequires: libpcap-devel
|
2017-02-13 12:42:18 +01:00
|
|
|
BuildRequires: pesign-obs-integration
|
2020-05-20 11:15:07 +02:00
|
|
|
BuildRequires: zlib-devel
|
|
|
|
Conflicts: dpdk-any
|
|
|
|
Provides: dpdk-any = %{version}
|
|
|
|
ExclusiveArch: %exclusive_arch
|
2018-10-25 16:03:17 +02:00
|
|
|
%if 0%{?sle_version} >= 120400
|
2018-01-16 12:52:44 +01:00
|
|
|
BuildRequires: rdma-core-devel
|
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.
|
|
|
|
|
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
|
2017-06-21 12:46:55 +02:00
|
|
|
# can't use %{name} because of dpdk-thunderx
|
2019-06-17 18:01:42 +02:00
|
|
|
%setup -q -n dpdk-stable-%{version}
|
2019-02-23 16:00:59 +01:00
|
|
|
%patch1 -p1 -z .init
|
2020-09-22 11:15:39 +02:00
|
|
|
%patch2 -p1 -z .init
|
2017-05-24 09:37:09 +02:00
|
|
|
|
2017-01-05 10:51:54 +01:00
|
|
|
# This fixes CROSS compilation (broken) in the mk file for ThunderX
|
|
|
|
sed -i '/^CROSS /s/^/#/' mk/machine/thunderx/rte.vars.mk
|
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
|
2020-08-11 08:57:44 +02:00
|
|
|
|
|
|
|
cp mk/machine/armv8a/rte.vars.mk mk/machine/thunderx
|
|
|
|
|
2016-04-26 11:01:32 +02:00
|
|
|
# set up a method for modifying the resulting .config file
|
|
|
|
function setconf() {
|
2017-04-05 16:51:28 +02:00
|
|
|
if grep -q ^$1= $3/.config; then
|
|
|
|
sed -i "s:^$1=.*$:$1=$2:g" $3/.config
|
2016-04-26 11:01:32 +02:00
|
|
|
else
|
2017-04-05 16:51:28 +02:00
|
|
|
echo $1=$2 >> $3/.config
|
2016-04-26 11:01:32 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-04-05 16:51:28 +02:00
|
|
|
function setdefaultconf()
|
|
|
|
{
|
2018-03-06 13:12:48 +01:00
|
|
|
# Remove the below once upstream fixes the DPAA for NXP ARM
|
|
|
|
setconf CONFIG_RTE_LIBRTE_DPAA_BUS n $1
|
|
|
|
setconf CONFIG_RTE_LIBRTE_DPAA_MEMPOOL n $1
|
|
|
|
setconf CONFIG_RTE_LIBRTE_DPAA_PMD n $1
|
2020-05-20 11:15:07 +02:00
|
|
|
setconf CONFIG_RTE_LIBRTE_PMD_CAAM_JR n $1
|
2018-03-06 13:12:48 +01:00
|
|
|
setconf CONFIG_RTE_LIBRTE_PMD_DPAA_SEC n $1
|
|
|
|
setconf CONFIG_RTE_LIBRTE_PMD_DPAA_EVENTDEV n $1
|
2020-05-20 11:15:07 +02:00
|
|
|
%ifarch aarch64
|
|
|
|
setconf CONFIG_RTE_LIBRTE_PFE_PMD n $1
|
|
|
|
%endif
|
2018-03-06 13:12:48 +01:00
|
|
|
|
2017-04-05 16:51:28 +02:00
|
|
|
setconf CONFIG_RTE_MACHINE '"%{machine2}"' $1
|
|
|
|
# Disable experimental features
|
|
|
|
setconf CONFIG_RTE_NEXT_ABI n $1
|
|
|
|
|
|
|
|
# Enable automatic driver loading from this path
|
|
|
|
setconf CONFIG_RTE_EAL_PMD_PATH '"%{pmddir}"' $1
|
|
|
|
|
|
|
|
setconf CONFIG_RTE_LIBRTE_BNX2X_PMD y $1
|
2017-12-22 10:54:56 +01:00
|
|
|
setconf CONFIG_RTE_LIBRTE_BNX2X_MF_SUPPORT y $1
|
2017-04-05 16:51:28 +02:00
|
|
|
setconf CONFIG_RTE_LIBRTE_PMD_PCAP y $1
|
|
|
|
setconf CONFIG_RTE_LIBRTE_VHOST_NUMA y $1
|
2018-10-25 16:03:17 +02:00
|
|
|
%if 0%{?sle_version} >= 120400
|
2018-01-16 12:52:44 +01:00
|
|
|
setconf CONFIG_RTE_LIBRTE_MLX5_PMD y $1
|
|
|
|
setconf CONFIG_RTE_LIBRTE_MLX4_PMD y $1
|
2018-04-20 15:41:31 +02:00
|
|
|
%endif
|
2017-04-05 16:51:28 +02:00
|
|
|
setconf CONFIG_RTE_EAL_IGB_UIO n $1
|
|
|
|
setconf CONFIG_RTE_KNI_KMOD n $1
|
|
|
|
|
|
|
|
%if %{with shared}
|
|
|
|
setconf CONFIG_RTE_BUILD_SHARED_LIB y $1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%ifarch aarch64 ppc64le
|
|
|
|
setconf CONFIG_RTE_LIBRTE_DISTRIBUTOR n $1
|
|
|
|
%endif
|
|
|
|
%ifarch ppc64le
|
|
|
|
setconf CONFIG_RTE_LIBRTE_PMD_RING n $1
|
2018-02-28 09:18:10 +01:00
|
|
|
setconf CONFIG_RTE_LIBRTE_IXGBE_PMD n $1
|
|
|
|
setconf CONFIG_RTE_LIBRTE_POWER n $1
|
2017-04-05 16:51:28 +02:00
|
|
|
%endif
|
|
|
|
}
|
2016-04-26 11:01:32 +02:00
|
|
|
# In case dpdk-devel is installed, we should ignore its hints about the SDK directories
|
|
|
|
unset RTE_SDK RTE_INCLUDE RTE_TARGET
|
|
|
|
|
2019-03-15 13:07:02 +01:00
|
|
|
export EXTRA_CFLAGS="%{optflags} -Wformat -fPIC -U_FORTIFY_SOURCE"
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
# DPDK defaults to using builder-specific compiler flags. However,
|
|
|
|
# the config has been changed by specifying CONFIG_RTE_MACHINE=default
|
|
|
|
# in order to build for a more generic host. NOTE: It is possible that
|
|
|
|
# the compiler flags used still won't work for all Fedora-supported
|
|
|
|
# machines, but runtime checks in DPDK will catch those situations.
|
|
|
|
|
2017-06-21 12:46:55 +02:00
|
|
|
make V=1 O=%{target} T=%{target} %{?_smp_mflags} config
|
2017-04-05 16:51:28 +02:00
|
|
|
setdefaultconf %{target}
|
2017-03-21 10:55:37 +01:00
|
|
|
|
2017-02-13 12:42:18 +01:00
|
|
|
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
|
|
|
|
for flavor in %{flavors_to_build}; do
|
2017-04-05 16:51:28 +02:00
|
|
|
export RTE_KERNELDIR=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor
|
2017-06-21 12:46:55 +02:00
|
|
|
make V=1 O=%{target}-$flavor T=%{target} %{?_smp_mflags} config
|
2017-04-05 16:51:28 +02:00
|
|
|
setdefaultconf %{target}-$flavor
|
|
|
|
setconf CONFIG_RTE_EAL_IGB_UIO y %{target}-$flavor
|
|
|
|
setconf CONFIG_RTE_KNI_KMOD y %{target}-$flavor
|
2017-02-13 12:42:18 +01:00
|
|
|
cd %{target}-$flavor
|
2017-06-21 12:46:55 +02:00
|
|
|
make V=1 %{?_smp_mflags}
|
2017-02-13 12:42:18 +01:00
|
|
|
cd -
|
|
|
|
done
|
2016-08-09 12:58:13 +02:00
|
|
|
|
2017-06-21 12:46:55 +02:00
|
|
|
make V=1 O=%{target} %{?_smp_mflags}
|
|
|
|
make V=1 O=%{target} %{?_smp_mflags} doc-api-html
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%if %{with examples}
|
2017-06-21 12:46:55 +02:00
|
|
|
make V=1 O=%{target}/examples T=%{target} %{?_smp_mflags} examples
|
2016-04-26 11:01:32 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%install
|
2017-02-13 12:42:18 +01:00
|
|
|
# export needed for kmp package
|
|
|
|
export EXTRA_CFLAGS='-DVERSION=\"%{version}\"'
|
|
|
|
export INSTALL_MOD_PATH=%{buildroot}
|
|
|
|
export INSTALL_MOD_DIR=updates
|
|
|
|
export BRP_PESIGN_FILES="*.ko"
|
|
|
|
|
|
|
|
for flavor in %{flavors_to_build}; do
|
|
|
|
cd %{target}-$flavor
|
2017-04-05 16:51:28 +02:00
|
|
|
export RTE_KERNELDIR=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor
|
2020-05-20 11:15:07 +02:00
|
|
|
dir=%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor
|
2017-04-05 16:51:28 +02:00
|
|
|
krel=$(make -s -C "$dir" kernelrelease)
|
|
|
|
mkdir -p %{buildroot}/lib/modules/$krel/extra/dpdk/
|
|
|
|
#make install expects same kernel for build and target, lets copy it manually
|
|
|
|
install -m644 ../%{target}-$flavor/kmod/*.ko %{buildroot}/lib/modules/$krel/extra/dpdk/
|
2017-02-13 12:42:18 +01:00
|
|
|
cd -
|
|
|
|
done
|
2016-04-26 11:01:32 +02:00
|
|
|
# In case dpdk-devel is installed
|
|
|
|
unset RTE_SDK RTE_INCLUDE RTE_TARGET
|
|
|
|
|
|
|
|
%make_install O=%{target} prefix=%{_usr} libdir=%{_libdir}
|
|
|
|
|
|
|
|
%if ! %{with tools}
|
2017-09-06 11:56:45 +02:00
|
|
|
rm -rf %{buildroot}%{sdkdir}/usertools/
|
2016-04-26 11:01:32 +02:00
|
|
|
rm -rf %{buildroot}%{_sbindir}/dpdk_nic_bind
|
|
|
|
%endif
|
2017-09-06 11:56:45 +02:00
|
|
|
rm -f %{buildroot}%{sdkdir}/usertools/setup.sh
|
2016-10-06 16:10:19 +02:00
|
|
|
#TODO pip elftools has issues to fix
|
|
|
|
rm -rf %{buildroot}%{_bindir}/dpdk-pmdinfo
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%if %{with examples}
|
|
|
|
find %{target}/examples/ -name "*.map" | xargs rm -f
|
|
|
|
for f in %{target}/examples/*/%{target}/app/*; do
|
|
|
|
bn=`basename ${f}`
|
|
|
|
cp -p ${f} %{buildroot}%{_bindir}/dpdk_example_${bn}
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Create a driver directory with symlinks to all pmds
|
|
|
|
mkdir -p %{buildroot}/%{pmddir}
|
2017-02-24 14:21:15 +01:00
|
|
|
for f in %{buildroot}/%{_libdir}/*_pmd_*.so.*; do
|
2016-04-26 11:01:32 +02:00
|
|
|
bn=$(basename ${f})
|
|
|
|
ln -s ../${bn} %{buildroot}%{pmddir}/${bn}
|
|
|
|
done
|
2017-09-06 11:56:45 +02:00
|
|
|
#mempool is a driver now from 16.07
|
|
|
|
mkdir -p %{buildroot}/%{pmddir}
|
|
|
|
for f in %{buildroot}/%{_libdir}/*_mempool_*.so.*; do
|
|
|
|
bn=$(basename ${f})
|
|
|
|
ln -s ../${bn} %{buildroot}%{pmddir}/${bn}
|
|
|
|
done
|
|
|
|
|
2016-04-26 11:01:32 +02:00
|
|
|
# Setup RTE_SDK environment as expected by apps etc
|
|
|
|
mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
|
|
|
|
cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.sh
|
|
|
|
if [ -z "\${RTE_SDK}" ]; then
|
|
|
|
export RTE_SDK="%{sdkdir}"
|
|
|
|
export RTE_TARGET="%{target}"
|
|
|
|
export RTE_INCLUDE="%{incdir}"
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.csh
|
2018-08-29 13:23:54 +02:00
|
|
|
if ( ! \${?RTE_SDK} ) then
|
2016-04-26 11:01:32 +02:00
|
|
|
setenv RTE_SDK "%{sdkdir}"
|
|
|
|
setenv RTE_TARGET "%{target}"
|
|
|
|
setenv RTE_INCLUDE "%{incdir}"
|
|
|
|
endif
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Fixup target machine mismatch
|
2016-08-09 12:58:13 +02:00
|
|
|
sed -i -e 's:-%{machine}-:-%{machine2}-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk*
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
#doc
|
|
|
|
mkdir %{buildroot}%{_docdir}/
|
|
|
|
mv %{buildroot}%{_datadir}/doc/dpdk %{buildroot}%{_docdir}/
|
|
|
|
|
2016-10-06 16:10:19 +02:00
|
|
|
ln -s %{_bindir}/dpdk-procinfo %{buildroot}%{_bindir}/dpdk_proc_info
|
|
|
|
ln -s %{_sbindir}/dpdk-devbind %{buildroot}%{_sbindir}/dpdk_nic_bind
|
|
|
|
|
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
|
2017-02-13 12:42:18 +01:00
|
|
|
%fdupes %{buildroot}/%{_prefix}
|
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
|
|
|
|
%defattr(-,root,root)
|
|
|
|
# BSD
|
|
|
|
%{_bindir}/testpmd
|
2018-03-06 13:12:48 +01:00
|
|
|
%{_bindir}/testbbdev
|
2020-05-20 11:15:07 +02:00
|
|
|
%{_bindir}/testsad
|
2016-10-06 16:10:19 +02:00
|
|
|
%{_bindir}/dpdk-procinfo
|
2016-04-26 11:01:32 +02:00
|
|
|
%{_bindir}/dpdk_proc_info
|
2016-10-06 16:10:19 +02:00
|
|
|
%{_bindir}/dpdk-pdump
|
2016-04-26 11:01:32 +02:00
|
|
|
|
2017-08-25 12:24:55 +02:00
|
|
|
%files -n %{lname}
|
|
|
|
%defattr(-,root,root)
|
2016-04-26 11:01:32 +02:00
|
|
|
%if %{with shared}
|
|
|
|
%{_libdir}/*.so.*
|
2019-11-20 07:22:42 +01:00
|
|
|
%{pmddir}
|
2016-04-26 11:01:32 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
|
|
|
#BSD
|
|
|
|
%docdir
|
2018-03-06 13:12:48 +01:00
|
|
|
%doc license/gpl-2.0.txt license/lgpl-2.1.txt
|
2016-04-26 11:01:32 +02:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
#BSD
|
|
|
|
%{incdir}/
|
|
|
|
%{sdkdir}
|
|
|
|
%if %{with tools}
|
2017-09-06 11:56:45 +02:00
|
|
|
%exclude %{sdkdir}/usertools/
|
2016-04-26 11:01:32 +02:00
|
|
|
%endif
|
|
|
|
%if %{with examples}
|
|
|
|
%exclude %{sdkdir}/examples/
|
|
|
|
%endif
|
|
|
|
%{_sysconfdir}/profile.d/dpdk-sdk-*.*
|
|
|
|
%if ! %{with shared}
|
|
|
|
%{_libdir}/*.a
|
|
|
|
%else
|
|
|
|
%{_libdir}/*.so
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with tools}
|
|
|
|
%files tools
|
|
|
|
%defattr(-,root,root)
|
2017-09-06 11:56:45 +02:00
|
|
|
%{sdkdir}/usertools/
|
2016-10-06 16:10:19 +02:00
|
|
|
%{_sbindir}/dpdk-devbind
|
2016-04-26 11:01:32 +02:00
|
|
|
%{_sbindir}/dpdk_nic_bind
|
2017-09-06 11:56:45 +02:00
|
|
|
%{_bindir}/dpdk-test-eventdev
|
2020-05-20 11:15:07 +02:00
|
|
|
%{_bindir}/dpdk-test-compress-perf
|
2017-09-06 11:56:45 +02:00
|
|
|
%{_bindir}/dpdk-test-crypto-perf
|
2016-04-26 11:01:32 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with examples}
|
|
|
|
%files examples
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_bindir}/dpdk_example_*
|
|
|
|
%doc %{sdkdir}/examples
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|