SHA256
1
0
forked from pool/dpdk
dpdk/dpdk.spec

423 lines
14 KiB
RPMSpec
Raw Normal View History

#
# spec file for package dpdk
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define machine native
%ifarch x86_64
%define target x86_64-%{machine}-linuxapp-gcc
%else if %ix86
%define target i686-%{machine}-linuxapp-gcc
%endif
%bcond_without shared
# Add option to build without examples
%bcond_without examples
# Add option to build without tools
%bcond_without tools
Name: dpdk
Version: 2.2.0
Release: 0
Summary: Set of libraries and drivers for fast packet processing
License: BSD-3-Clause and GPL-2.0 and LGPL-2.1
Group: System/Libraries
Url: http://dpdk.org
Source: http://fast.dpdk.org/rel/dpdk-%{version}.tar.xz
Patch1: 0001-enic-fix-Type-punning-and-strict-aliasing-warning.patch
Patch2: 0002-examples-ip_pipeline-fix-implicit-declaration-of-fun.patch
Patch3: 0003-mk-fix-external-shared-library-dependencies-of-libraries.patch
Patch4: 0004-54f9e32-vhost-handle-dirty-pages-logging-request.patch
Patch5: 0005-d293dac-vhost-claim-support-of-guest-announce.patch
Patch6: 0006-d639996-vhost-enable-log_shmfd-protocol-feature.patch
#PATCH-FIX-UPSTREAM 0007-ixgbe-fix-VLAN-filter-missing-brackets.patch
Patch7: 0007-ixgbe-fix-VLAN-filter-missing-brackets.patch
Accepting request 399089 from home:ndas:branches:network - Applied all the fixes recommended by upstream for v2.2 stable release(bsc#981996). [+0008-app-testpmd-handle-SIGINT-and-SIGTERM.patch, +0009-bonding-copy-entire-config-structure-in-mode-4.patch, +0010-bonding-fix-active-slaves-with-no-primary.patch, +0011-bonding-do-not-ignore-multicast-in-mode-4.patch, +0012-bonding-do-not-activate-slave-twice.patch, +0013-bonding-fix-crash-when-no-slave-device.patch, +0014-bonding-fix-detach-of-bonded-device.patch, +0015-bonding-fix-detach-of-slave-devices.patch, +0016-eal-linux-support-built-in-kernel-modules.patch, +0017-examples-l3fwd-handle-SIGINT-and-SIGTERM.patch, +0018-fm10k-fix-VLAN-flag-in-scattered-Rx.patch, +0019-i40e-base-fix-driver-load-failure.patch, +0020-i40e-base-fix-missing-check-for-stopped-admin-queue.patch, +0021-i40e-fix-inverted-check-for-no-refcount.patch, +0022-i40e-fix-overflow.patch, +0023-i40e-fix-VLAN-filtering.patch, +0024-mempool-fix-leak-when-creation-fails.patch, +0025-pcap-fix-captured-frame-length.patch, +0026-port-fix-crash-for-ethdev-writer-nodrop.patch, +0027-port-fix-crash-for-ring-writer-nodrop.patch, +0028-tools-fix-unbinding-failure-handling.patch, +0029-tools-support-Python-3-in-bind-script.patch, +0030-tools-support-binding-to-built-in-kernel-modules.patch, +0031-vhost-fix-leak-of-fds-and-mmaps.patch, +0032-virtio-fix-crash-in-statistics-functions.patch, +0033-virtio-fix-descriptors-pointing-to-the-same-buffer.patch, +0034-virtio-fix-restart.patch] OBS-URL: https://build.opensuse.org/request/show/399089 OBS-URL: https://build.opensuse.org/package/show/network/dpdk?expand=0&rev=3
2016-05-31 13:30:42 +02:00
#PATCH-FIX-UPSTREAM 0008-app-testpmd-handle-SIGINT-and-SIGTERM.patch
Patch8: 0008-app-testpmd-handle-SIGINT-and-SIGTERM.patch
#PATCH-FIX-UPSTREAM 0009-bonding-copy-entire-config-structure-in-mode-4.patch
Patch9: 0009-bonding-copy-entire-config-structure-in-mode-4.patch
#PATCH-FIX-UPSTREAM 0010-bonding-fix-active-slaves-with-no-primary.patch
Patch10: 0010-bonding-fix-active-slaves-with-no-primary.patch
#PATCH-FIX-UPSTREAM 0011-bonding-do-not-ignore-multicast-in-mode-4.patch
Patch11: 0011-bonding-do-not-ignore-multicast-in-mode-4.patch
#PATCH-FIX-UPSTREAM 0012-bonding-do-not-activate-slave-twice.patch
Patch12: 0012-bonding-do-not-activate-slave-twice.patch
#PATCH-FIX-UPSTREAM 0013-bonding-fix-crash-when-no-slave-device.patch
Patch13: 0013-bonding-fix-crash-when-no-slave-device.patch
#PATCH-FIX-UPSTREAM 0014-bonding-fix-detach-of-bonded-device.patch
Patch14: 0014-bonding-fix-detach-of-bonded-device.patch
#PATCH-FIX-UPSTREAM 0015-bonding-fix-detach-of-slave-devices.patch
Patch15: 0015-bonding-fix-detach-of-slave-devices.patch
#PATCH-FIX-UPSTREAM 0016-eal-linux-support-built-in-kernel-modules.patch
Patch16: 0016-eal-linux-support-built-in-kernel-modules.patch
#PATCH-FIX-UPSTREAM 0017-examples-l3fwd-handle-SIGINT-and-SIGTERM.patch
Patch17: 0017-examples-l3fwd-handle-SIGINT-and-SIGTERM.patch
#PATCH-FIX-UPSTREAM 0018-fm10k-fix-VLAN-flag-in-scattered-Rx.patch
Patch18: 0018-fm10k-fix-VLAN-flag-in-scattered-Rx.patch
#PATCH-FIX-UPSTREAM 0019-i40e-base-fix-driver-load-failure.patch
Patch19: 0019-i40e-base-fix-driver-load-failure.patch
#PATCH-FIX-UPSTREAM 0020-i40e-base-fix-missing-check-for-stopped-admin-queue.patch
Patch20: 0020-i40e-base-fix-missing-check-for-stopped-admin-queue.patch
#PATCH-FIX-UPSTREAM 0021-i40e-fix-inverted-check-for-no-refcount.patch
Patch21: 0021-i40e-fix-inverted-check-for-no-refcount.patch
#PATCH-FIX-UPSTREAM 0022-i40e-fix-overflow.patch
Patch22: 0022-i40e-fix-overflow.patch
#PATCH-FIX-UPSTREAM 0023-i40e-fix-VLAN-filtering.patch
Patch23: 0023-i40e-fix-VLAN-filtering.patch
#PATCH-FIX-UPSTREAM 0024-mempool-fix-leak-when-creation-fails.patch
Patch24: 0024-mempool-fix-leak-when-creation-fails.patch
#PATCH-FIX-UPSTREAM 0025-pcap-fix-captured-frame-length.patch
Patch25: 0025-pcap-fix-captured-frame-length.patch
#PATCH-FIX-UPSTREAM 0026-port-fix-crash-for-ethdev-writer-nodrop.patch
Patch26: 0026-port-fix-crash-for-ethdev-writer-nodrop.patch
#PATCH-FIX-UPSTREAM 0027-port-fix-crash-for-ring-writer-nodrop.patch
Patch27: 0027-port-fix-crash-for-ring-writer-nodrop.patch
#PATCH-FIX-UPSTREAM 0028-tools-fix-unbinding-failure-handling.patch
Patch28: 0028-tools-fix-unbinding-failure-handling.patch
#PATCH-FIX-UPSTREAM 0029-tools-support-Python-3-in-bind-script.patch
Patch29: 0029-tools-support-Python-3-in-bind-script.patch
#PATCH-FIX-UPSTREAM 0030-tools-support-binding-to-built-in-kernel-modules.patch
Patch30: 0030-tools-support-binding-to-built-in-kernel-modules.patch
#PATCH-FIX-UPSTREAM 0031-vhost-fix-leak-of-fds-and-mmaps.patch
Patch31: 0031-vhost-fix-leak-of-fds-and-mmaps.patch
#PATCH-FIX-UPSTREAM 0032-virtio-fix-crash-in-statistics-functions.patch
Patch32: 0032-virtio-fix-crash-in-statistics-functions.patch
#PATCH-FIX-UPSTREAM 0033-virtio-fix-descriptors-pointing-to-the-same-buffer.patch
Patch33: 0033-virtio-fix-descriptors-pointing-to-the-same-buffer.patch
#PATCH-FIX-UPSTREAM 0034-virtio-fix-restart.patch
Patch34: 0034-virtio-fix-restart.patch
#
# Patches for build fixes
#
#PATCH-FIX-UPSTREAM: 0099-mk-fix-gcc-5-version-on-suse.patch
Patch99: 0099-mk-fix-gcc-5-version-on-suse.patch
#PATCH-FIX-UPSTREAM: 0100-kni-fix-build-with-gcc-6.patch
Patch100: 0100-kni-fix-build-with-gcc-6.patch
#PATCH-FIX-UPSTREAM: 0101-ixgbe-fix-uninitialized-warning.patch
Patch101: 0101-ixgbe-fix-uninitialized-warning.patch
#PATCH-FIX-UPSTREAM: 0102-ixgbe-fix-constant-sign-in-left-shift-operator.patch
Patch102: 0102-ixgbe-fix-constant-sign-in-left-shift-operator.patch
#PATCH-FIX-OPENSUSE: 0103-e1000-base-Add-missing-braces-to-the-if-statements.patch
#Not merged yet: http://dpdk.org/dev/patchwork/patch/14268/
Patch103: 0103-e1000-base-Add-missing-braces-to-the-if-statements.patch
#PATCH-FIX-UPSTREAM: 0104-igb-fix-constant-sign-in-left-shift-operator.patch
Patch104: 0104-igb-fix-constant-sign-in-left-shift-operator.patch
#PATCH-FIX-UPSTREAM: 0105-e1000-fix-missing-link-interrupt-check-brackets.patch
Patch105: 0105-e1000-fix-missing-link-interrupt-check-brackets.patch
#PATCH-FIX-UPSTREAM: 0106-app-test-fix-missing-brackets.patch
Patch106: 0106-app-test-fix-missing-brackets.patch
#PATCH-FIX-UPSTREAM: 0107-examples-ip_pipeline-use-unsigned-constants-for-left.patch
Patch107: 0107-examples-ip_pipeline-use-unsigned-constants-for-left.patch
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: libnuma-devel
BuildRequires: libpcap-devel
BuildRequires: zlib-devel
#
# The DPDK is designed to optimize througput of network traffic using, among
# other techniques, carefully crafted x86 assembly instructions. As such it
# currently (and likely never will) run on non-x86 platforms
#
ExclusiveArch: x86_64 %ix86
%description
The Data Plane Development Kit is a set of libraries and drivers for
fast packet processing in the user space.
%package devel
Summary: Data Plane Development Kit development files
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
This package contains the headers and other files needed for developing
applications with the Data Plane Development Kit.
%package doc
Summary: Data Plane Development Kit API documentation
BuildArch: noarch
%description doc
API programming documentation for the Data Plane Development Kit.
%if %{with tools}
%package tools
Summary: Tools for setting up Data Plane Development Kit environment
Requires: %{name} = %{version}
Requires: findutils
Requires: iproute
Requires: kmod
Requires: pciutils
%description tools
This package contains tools for setting up Data Plane Development Kit environment
%endif
%if %{with examples}
%package examples
Summary: Data Plane Development Kit example applications
BuildRequires: libvirt-devel
%description examples
Example applications utilizing the Data Plane Development Kit, such
as L2 and L3 forwarding.
%endif
%define sdkdir %{_datadir}/%{name}
%define docdir %{_docdir}/%{name}
%define incdir %{_includedir}/%{name}
%define pmddir %{_libdir}/%{name}-pmds
%prep
%setup -q
%patch1 -p1 -z .enic
%patch2 -p1 -z .examples
%patch3 -p1 -z .dtneeded
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
Accepting request 399089 from home:ndas:branches:network - Applied all the fixes recommended by upstream for v2.2 stable release(bsc#981996). [+0008-app-testpmd-handle-SIGINT-and-SIGTERM.patch, +0009-bonding-copy-entire-config-structure-in-mode-4.patch, +0010-bonding-fix-active-slaves-with-no-primary.patch, +0011-bonding-do-not-ignore-multicast-in-mode-4.patch, +0012-bonding-do-not-activate-slave-twice.patch, +0013-bonding-fix-crash-when-no-slave-device.patch, +0014-bonding-fix-detach-of-bonded-device.patch, +0015-bonding-fix-detach-of-slave-devices.patch, +0016-eal-linux-support-built-in-kernel-modules.patch, +0017-examples-l3fwd-handle-SIGINT-and-SIGTERM.patch, +0018-fm10k-fix-VLAN-flag-in-scattered-Rx.patch, +0019-i40e-base-fix-driver-load-failure.patch, +0020-i40e-base-fix-missing-check-for-stopped-admin-queue.patch, +0021-i40e-fix-inverted-check-for-no-refcount.patch, +0022-i40e-fix-overflow.patch, +0023-i40e-fix-VLAN-filtering.patch, +0024-mempool-fix-leak-when-creation-fails.patch, +0025-pcap-fix-captured-frame-length.patch, +0026-port-fix-crash-for-ethdev-writer-nodrop.patch, +0027-port-fix-crash-for-ring-writer-nodrop.patch, +0028-tools-fix-unbinding-failure-handling.patch, +0029-tools-support-Python-3-in-bind-script.patch, +0030-tools-support-binding-to-built-in-kernel-modules.patch, +0031-vhost-fix-leak-of-fds-and-mmaps.patch, +0032-virtio-fix-crash-in-statistics-functions.patch, +0033-virtio-fix-descriptors-pointing-to-the-same-buffer.patch, +0034-virtio-fix-restart.patch] OBS-URL: https://build.opensuse.org/request/show/399089 OBS-URL: https://build.opensuse.org/package/show/network/dpdk?expand=0&rev=3
2016-05-31 13:30:42 +02:00
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
# Build fixes
%patch99 -p1 -z .rtetoolchain
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%build
# set up a method for modifying the resulting .config file
function setconf() {
if grep -q ^$1= %{target}/.config; then
sed -i "s:^$1=.*$:$1=$2:g" %{target}/.config
else
echo $1=$2 >> %{target}/.config
fi
}
# In case dpdk-devel is installed, we should ignore its hints about the SDK directories
unset RTE_SDK RTE_INCLUDE RTE_TARGET
# For the release, '-Wno-error=array-bounds' is done to prevent a spurious error
# generated by gcc 5.X against the 2.1 branch
export EXTRA_CFLAGS="%{optflags} -Wformat -fPIC -Wno-error=array-bounds"
# 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.
make V=1 O=%{target} T=%{target} %{?_smp_mflags} config
setconf CONFIG_RTE_MACHINE '"default"'
# Disable experimental features
setconf CONFIG_RTE_NEXT_ABI n
setconf CONFIG_RTE_LIBRTE_CRYPTODEV n
setconf CONFIG_RTE_LIBRTE_MBUF_OFFLOAD n
# Enable automatic driver loading from this path
setconf CONFIG_RTE_EAL_PMD_PATH '"%{pmddir}"'
setconf CONFIG_RTE_LIBRTE_BNX2X_PMD y
setconf CONFIG_RTE_LIBRTE_PMD_PCAP y
setconf CONFIG_RTE_LIBRTE_VHOST_NUMA y
setconf CONFIG_RTE_EAL_IGB_UIO n
setconf CONFIG_RTE_LIBRTE_KNI n
setconf CONFIG_RTE_KNI_KMOD n
setconf CONFIG_RTE_KNI_PREEMPT_DEFAULT n
%if %{with shared}
setconf CONFIG_RTE_BUILD_SHARED_LIB y
%endif
make V=1 O=%{target} %{?_smp_mflags}
make V=1 O=%{target} %{?_smp_mflags} doc-api-html
%if %{with examples}
make V=1 O=%{target}/examples T=%{target} %{?_smp_mflags} examples
%endif
%install
# In case dpdk-devel is installed
unset RTE_SDK RTE_INCLUDE RTE_TARGET
%make_install O=%{target} prefix=%{_usr} libdir=%{_libdir}
%if ! %{with tools}
rm -rf %{buildroot}%{sdkdir}/tools
rm -rf %{buildroot}%{_sbindir}/dpdk_nic_bind
%endif
rm -f %{buildroot}%{sdkdir}/tools/setup.sh
%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}
for f in %{buildroot}/%{_libdir}/*_pmd_*.so; do
bn=$(basename ${f})
ln -s ../${bn} %{buildroot}%{pmddir}/${bn}
done
# 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
if ( ! \$RTE_SDK ) then
setenv RTE_SDK "%{sdkdir}"
setenv RTE_TARGET "%{target}"
setenv RTE_INCLUDE "%{incdir}"
endif
EOF
# Fixup target machine mismatch
sed -i -e 's:-%{machine}-:-default-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk*
# Upstream has an option to build a combined library but it's bloatware which
# wont work at all when library versions start moving, replace it with a
# linker script which avoids these issues. Linking against the script during
# build resolves into links to the actual used libraries which is just fine
# for us, so this combined library is a build-time only construct now.
%if %{with shared}
libext=so
%else
libext=a
%endif
comblib=libdpdk.${libext}
echo "GROUP (" > ${comblib}
find %{buildroot}/%{_libdir}/ -name "*.${libext}" |\
sed -e "s:^%{buildroot}/: :g" >> ${comblib}
echo ")" >> ${comblib}
install -m 644 ${comblib} %{buildroot}/%{_libdir}/${comblib}
#doc
mkdir %{buildroot}%{_docdir}/
mv %{buildroot}%{_datadir}/doc/dpdk %{buildroot}%{_docdir}/
# Remove unwanted binaries "-f" so if the file
# doesn't exist --> don't complain!
rm -f %{buildroot}%{_bindir}/cmdline_test
rm -f %{buildroot}%{_bindir}/test
rm -f %{buildroot}%{_bindir}/testpipeline
rm -f %{buildroot}%{_bindir}/testacl
rm -f %{buildroot}%{_bindir}/*.map
# Remove duplicates
%fdupes %{buildroot}/%{_prefix}
%post devel -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
# BSD
%{_bindir}/testpmd
%{_bindir}/dpdk_proc_info
%if %{with shared}
%dir %{_libdir}/dpdk-pmds
%{_libdir}/*.so.*
%{pmddir}/
%endif
%files doc
%defattr(-,root,root)
#BSD
%docdir
%doc LICENSE.GPL LICENSE.LGPL
%files devel
%defattr(-,root,root)
#BSD
%{incdir}/
%{sdkdir}
%if %{with tools}
%exclude %{sdkdir}/tools/
%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)
%{sdkdir}/tools/
%{_sbindir}/dpdk_nic_bind
%endif
%if %{with examples}
%files examples
%defattr(-,root,root)
%{_bindir}/dpdk_example_*
%doc %{sdkdir}/examples
%endif
%changelog