dpdk.1802.spec revision 8ae62f8b
1# Add option to build as static libraries (--without shared)
2%bcond_without shared
3# Add option to build without examples
4%bcond_without examples
5# Add option to build without tools
6%bcond_without tools
7
8# Dont edit Version: and Release: directly, only these:
9%define ver %{?_ver}
10%define rel 2
11# Define when building git snapshots
12
13%define srcver %{ver}%{?_snapver:.%{_snapver}}
14
15# Add option to build the PDF documentation separately (--with pdfdoc)
16%bcond_with pdfdoc
17
18Name: dpdk
19Version: %{ver}
20Release:%{?_snapver:%{_snapver}.}%{rel}%{?dist}
21Epoch: 2
22URL: http://dpdk.org
23Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{srcver}.tar.gz
24
25Summary: Set of libraries and drivers for fast packet processing
26
27#
28# Note that, while this is dual licensed, all code that is included with this
29# Pakcage are BSD licensed. The only files that aren't licensed via BSD is the
30# kni kernel module which is dual LGPLv2/BSD, and thats not built for fedora.
31#
32License: BSD and LGPLv2 and GPLv2
33
34#
35# The DPDK is designed to optimize througput of network traffic using, among
36# other techniques, carefully crafted assembly instructions.  As such it
37# needs extensive work to port it to other architectures.
38#
39ExclusiveArch: x86_64 i686 ppc64le
40
41# machine_arch maps between rpm and dpdk arch name, often same as _target_cpu
42# machine_tmpl is the config template machine name, often "native"
43# machine is the actual machine name used in the dpdk make system
44%ifarch x86_64
45%define machine_arch x86_64
46%define machine_tmpl native
47%define machine default
48%endif
49%ifarch i686
50%define machine_arch i686
51%define machine_tmpl native
52%define machine default
53%endif
54%ifarch aarch64
55%define machine_arch arm64
56%define machine_tmpl armv8a
57%define machine armv8a
58%endif
59%ifarch ppc64le
60%define machine_arch ppc_64
61%define machine_tmpl power8
62%define machine power8
63%endif
64
65
66%define target %{machine_arch}-%{machine_tmpl}-linuxapp-gcc
67
68BuildRequires: gcc
69BuildRequires: kernel-headers, libpcap-devel, doxygen, zlib-devel
70%if 0%{?fedora} >= 25
71BuildRequires: python3-sphinx
72%else
73BuildRequires: python-sphinx
74%endif
75BuildRequires: numactl-devel
76%if %{with pdfdoc}
77BuildRequires: texlive-dejavu inkscape texlive-latex-bin-bin
78BuildRequires: texlive-kpathsea-bin texlive-metafont-bin texlive-cm
79BuildRequires: texlive-cmap texlive-ec texlive-babel-english
80BuildRequires: texlive-fancyhdr texlive-fancybox texlive-titlesec BuildRequires: texlive-framed texlive-threeparttable texlive-mdwtools
81BuildRequires: texlive-wrapfig texlive-parskip texlive-upquote texlive-multirow
82BuildRequires: texlive-helvetic texlive-times texlive-dvips
83%endif
84
85%description
86The Data Plane Development Kit is a set of libraries and drivers for
87fast packet processing in the user space.
88
89%package devel
90Summary: Data Plane Development Kit development files
91Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
92%if ! %{with shared}
93Provides: %{name}-static = %{epoch}:%{version}-%{release}
94%endif
95
96%description devel
97This package contains the headers and other files needed for developing
98applications with the Data Plane Development Kit.
99
100%package doc
101Summary: Data Plane Development Kit API documentation
102BuildArch: noarch
103
104%description doc
105API programming documentation for the Data Plane Development Kit.
106
107%if %{with tools}
108%package tools
109Summary: Tools for setting up Data Plane Development Kit environment
110Requires: %{name} = %{epoch}:%{version}-%{release}
111Requires: kmod pciutils findutils iproute
112
113%if 0%{?fedora} >= 25
114Requires: python3-pyelftools
115%endif
116%description tools
117%{summary}
118%endif
119
120%if %{with examples}
121%package examples
122Summary: Data Plane Development Kit example applications
123BuildRequires: libvirt-devel
124
125%description examples
126Example applications utilizing the Data Plane Development Kit, such
127as L2 and L3 forwarding.
128%endif
129
130%define sdkdir  %{_datadir}/%{name}
131%define docdir  %{_docdir}/%{name}
132%define incdir %{_includedir}/%{name}
133%define pmddir %{_libdir}/%{name}-pmds
134
135%prep
136%setup -q -n dpdk-%{version}
137#%patch0 -p1
138
139%build
140# set up a method for modifying the resulting .config file
141function setconf() {
142	if grep -q ^$1= %{target}/.config; then
143		sed -i "s:^$1=.*$:$1=$2:g" %{target}/.config
144	else
145		echo $1=$2 >> %{target}/.config
146	fi
147}
148
149# In case dpdk-devel is installed, we should ignore its hints about the SDK directories
150unset RTE_SDK RTE_INCLUDE RTE_TARGET
151
152# Note: _hardening_ldflags has to go on the extra cflags line because dpdk is
153# astoundingly convoluted in how it processes its linker flags.  Fixing it in
154# dpdk is the preferred solution, but adjusting to allow a gcc option in the
155# ldflags, even when gcc is used as the linker, requires large tree-wide changes
156export EXTRA_CFLAGS="$(echo %{optflags} | sed -e 's:-Wall::g' -e 's:-march=[[:alnum:]]* ::g') -Wformat -fPIC %{_hardening_ldflags}"
157export EXTRA_LDFLAGS=$(echo %{__global_ldflags} | sed -e's/-Wl,//g' -e's/-spec.*//')
158export HOST_EXTRA_CFLAGS=$EXTRA_CFLAGS
159export EXTRA_HOST_LDFLAGS=$(echo %{__global_ldflags} | sed -e's/-spec.*//')
160
161# DPDK defaults to using builder-specific compiler flags.  However,
162# the config has been changed by specifying CONFIG_RTE_MACHINE=default
163# in order to build for a more generic host.  NOTE: It is possible that
164# the compiler flags used still won't work for all Fedora-supported
165# machines, but runtime checks in DPDK will catch those situations.
166make V=1 O=%{target} T=%{target} %{?_smp_mflags} config
167
168setconf CONFIG_RTE_MACHINE '"%{machine}"'
169# Disable experimental features
170setconf CONFIG_RTE_NEXT_ABI n
171setconf CONFIG_RTE_LIBRTE_MBUF_OFFLOAD n
172# Disable unmaintained features
173setconf CONFIG_RTE_LIBRTE_POWER n
174
175# Enable automatic driver loading from this path
176setconf CONFIG_RTE_EAL_PMD_PATH '"%{pmddir}"'
177
178setconf CONFIG_RTE_LIBRTE_BNX2X_PMD y
179setconf CONFIG_RTE_LIBRTE_PMD_PCAP y
180setconf CONFIG_RTE_LIBRTE_VHOST_NUMA y
181
182setconf CONFIG_RTE_EAL_IGB_UIO n
183setconf CONFIG_RTE_LIBRTE_KNI n
184setconf CONFIG_RTE_KNI_KMOD n
185setconf CONFIG_RTE_KNI_PREEMPT_DEFAULT n
186
187setconf CONFIG_RTE_APP_EVENTDEV n
188
189setconf CONFIG_RTE_LIBRTE_NFP_PMD y
190
191%ifarch aarch64
192setconf CONFIG_RTE_LIBRTE_DPAA_BUS n
193setconf CONFIG_RTE_LIBRTE_DPAA_MEMPOOL n
194setconf CONFIG_RTE_LIBRTE_DPAA_PMD n
195%endif
196
197%if %{with shared}
198setconf CONFIG_RTE_BUILD_SHARED_LIB y
199%endif
200
201make V=1 O=%{target} %{?_smp_mflags} -Wimplicit-fallthrough=0
202make V=1 O=%{target} %{?_smp_mflags} doc-api-html doc-guides-html %{?with_pdfdoc: guides-pdf}
203
204%if %{with examples}
205make V=1 O=%{target}/examples T=%{target} %{?_smp_mflags} examples
206%endif
207
208%install
209# In case dpdk-devel is installed
210unset RTE_SDK RTE_INCLUDE RTE_TARGET
211
212%make_install O=%{target} prefix=%{_usr} libdir=%{_libdir}
213
214%if ! %{with tools}
215rm -rf %{buildroot}%{sdkdir}/usertools
216rm -rf %{buildroot}%{_sbindir}/dpdk_nic_bind
217rm -rf %{buildroot}%{_bindir}/dpdk-test-crypto-perf
218%endif
219rm -f %{buildroot}%{sdkdir}/usertools/dpdk-setup.sh
220
221%if %{with examples}
222find %{target}/examples/ -name "*.map" | xargs rm -f
223for f in %{target}/examples/*/%{target}/app/*; do
224    bn=`basename ${f}`
225    cp -p ${f} %{buildroot}%{_bindir}/dpdk_example_${bn}
226done
227%endif
228
229%if 0%{?fedora} >= 25
230# Replace /usr/bin/env python with /usr/bin/python3
231find %{buildroot}%{sdkdir}/ -name "*.py" -exec \
232  sed -i -e 's|#!\s*/usr/bin/env python|#!/usr/bin/python3|' {} +
233%endif
234
235# Create a driver directory with symlinks to all pmds
236mkdir -p %{buildroot}/%{pmddir}
237for f in %{buildroot}/%{_libdir}/*_pmd_*.so.*; do
238    bn=$(basename ${f})
239    ln -s ../${bn} %{buildroot}%{pmddir}/${bn}
240done
241
242# Setup RTE_SDK environment as expected by apps etc
243mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
244cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.sh
245if [ -z "\${RTE_SDK}" ]; then
246    export RTE_SDK="%{sdkdir}"
247    export RTE_TARGET="%{target}"
248    export RTE_INCLUDE="%{incdir}"
249fi
250EOF
251
252cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.csh
253if ( ! \$RTE_SDK ) then
254    setenv RTE_SDK "%{sdkdir}"
255    setenv RTE_TARGET "%{target}"
256    setenv RTE_INCLUDE "%{incdir}"
257endif
258EOF
259
260# Fixup target machine mismatch
261sed -i -e 's:-%{machine_tmpl}-:-%{machine}-:g' %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk*
262
263%files
264# BSD
265%{_bindir}/testpmd
266%{_bindir}/dpdk-procinfo
267%if %{with shared}
268%{_libdir}/*.so.*
269%{pmddir}/
270%endif
271
272%files doc
273#BSD
274%{docdir}
275
276%files devel
277#BSD
278%{incdir}/
279%{sdkdir}
280%if %{with tools}
281%exclude %{sdkdir}/usertools/
282%endif
283%if %{with examples}
284%exclude %{sdkdir}/examples/
285%endif
286%{_sysconfdir}/profile.d/dpdk-sdk-*.*
287%if ! %{with shared}
288%{_libdir}/*.a
289%else
290%{_libdir}/*.so
291%endif
292
293%if %{with tools}
294%files tools
295%{sdkdir}/usertools/
296%{_sbindir}/dpdk-devbind
297%{_bindir}/dpdk-pdump
298%{_bindir}/dpdk-pmdinfo
299%{_bindir}/dpdk-test-crypto-perf
300%{_bindir}/testbbdev
301%endif
302
303%if %{with examples}
304%files examples
305%{_bindir}/dpdk_example_*
306%doc %{sdkdir}/examples
307%endif
308
309%changelog
310* Wed Jul 6 2018 Thomas F Herbert <therbert@redhat.com> - 18.02-2
311- Remove aarch64 until compilation problem is resolved for Centos
312
313* Wed Jun 6 2018 Thomas F Herbert <therbert@redhat.com> - 18.02-1
314- Include testbbdev
315
316* Mon Jun 4 2018 Thomas F Herbert <therbert@redhat.com> - 17.11.2-2
317- Backport changes from Fedora 28 17.11.2-1.f28
318- Remove dependency on Python3 for Centos
319
320* Tue Apr 24 2018 Neil Horman <nhorman@redhat.com> - 2:17.11.2-1
321- Update to latest 17.11 LTS (fixes bz 1571352)
322
323* Tue Apr 10 2018 Timothy Redaelli <tredaelli@redhat.com> - 2:17.11.1-2
324- Fix Requires dpdk by adding epoch (bz 1564215)
325
326* Mon Apr 09 2018 Neil Horman <nhorman@redhat.com> - 17.11.1-1
327- sync rawhide updates (including LTS shift) with f28 (bz 1564215)
328
329* Thu Apr 05 2018 Neil Horman <nhorman@redhat.com> - 18.02-6
330- Remove some debug checks (bz 1548404)
331
332* Thu Apr 05 2018 Neil Horman <nhorman@redhat.com> - 18.02-5
333- Fix compiler flag error (bz 1548404)
334
335* Tue Mar 20 2018 Neil Horman <nhorman@redhat.com> - 18.02-4
336- Update ldflags (bz 1548404)
337- bump release to keep it in line with rawhide
338
339* Fri Mar 02 2018 Neil Horman <nhorman@redhat.com> - 18.02-2
340- update to latest upstream (bz 1550708)
341
342* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 17.11-4
343- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
344
345* Wed Jan 03 2018 Iryna Shcherbina <ishcherb@redhat.com> - 17.11-3
346- Update Python 2 dependency declarations to new packaging standards
347  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
348
349* Thu Nov 30 2017 Neil Horman <nhorman@redhat.com> - 17.11-2
350- Fix dangling symlinks (bz 1519322)
351- Fix devtools->usertools conversion (bz 1519332)
352- Fix python-pyelftools requirement (bz 1519336)
353
354* Thu Nov 16 2017 Neil Horman <nhorman@redhat.com> - 17.11-1
355- Update to latest upstream
356
357* Wed Aug 09 2017 Neil Horman <nhorman@redhat.com> - 17.08-1
358- Update to latest upstream
359
360* Mon Jul 31 2017 Neil Horman <nhorman@redhat.com> - 17.05-2
361- backport rte_eth_tx_done_cleanup map fix (#1476341)
362
363* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 17.05-2
364- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
365
366* Mon May 15 2017 Neil Horman <nhorman@redhat.com> - 17.05-1
367- Update to latest upstream
368
369* Fri Feb 24 2017 Neil Horman <nhorman@redhat.com> - 17-02-2
370- Add python dependency (#1426561)
371
372* Wed Feb 15 2017 Fedora Release Monitoring  <release-monitoring@fedoraproject.org> - 17.02-1
373- Update to 17.02 (#1422285)
374
375* Mon Feb 06 2017 Yaakov Selkowitz <yselkowi@redhat.com> - 16.11-2
376- Enable aarch64, ppc64le (#1419731)
377
378* Tue Nov 15 2016 Neil Horman <nhorman@redhat.com> - 16.11-1
379- Update to 16.11
380
381* Tue Aug 02 2016 Neil Horman <nhorman@redhat.com> - 16.07-1
382* Update to 16.07
383
384* Thu Apr 14 2016 Panu Matilainen <pmatilai@redhat.com> - 16.04-1
385- Update to 16.04
386- Drop all patches, they're not needed anymore
387- Drop linker script generation, its upstream now
388- Enable vhost numa support again
389
390* Wed Mar 16 2016 Panu Matilainen <pmatilai@redhat.com> - 2.2.0-7
391- vhost numa code causes crashes, disable until upstream fixes
392- Generalize target/machine/etc macros to enable i686 builds
393
394* Tue Mar 01 2016 Panu Matilainen <pmatilai@redhat.com> - 2.2.0-6
395- Drop no longer needed bnx2x patch, the gcc false positive has been fixed
396- Drop no longer needed -Wno-error=array-bounds from CFLAGS
397- Eliminate the need for the enic patch by eliminating second -Wall from CFLAGS
398- Disable unmaintained librte_power as per upstream recommendation
399
400* Mon Feb 15 2016 Neil Horman <nhorman@redhat.com> 2.2.0-5
401- Fix ftbfs isssue (1307431)
402
403* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-4
404- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
405
406* Tue Jan 26 2016 Panu Matilainen <pmatilai@redhat.com> - 2.2.0-3
407- Use a different quoting method to avoid messing up vim syntax highlighting
408- A string is expected as CONFIG_RTE_MACHINE value, quote it too
409
410* Mon Jan 25 2016 Panu Matilainen <pmatilai@redhat.com> - 2.2.0-2
411- Enable librte_vhost NUMA-awareness
412
413* Wed Jan 20 2016 Panu Matilainen <pmatilai@redhat.com> - 2.2.0-1
414- Update to 2.2.0
415- Establish a driver directory for automatic driver loading
416- Move the unversioned pmd symlinks from libdir -devel
417- Make option matching stricter in spec setconf
418- Spec cleanups
419- Adopt upstream standard installation layout
420
421* Thu Oct 22 2015 Aaron Conole <aconole@redhat.com> - 2.1.0-3
422- Include examples binaries
423- Enable the Broadcom NetXtreme II 10Gb PMD
424- Fix up linkages for the dpdk-devel package
425
426* Wed Sep 30 2015 Aaron Conole <aconole@redhat.com> - 2.1.0-2
427- Re-enable the IGB, IXGBE, I40E PMDs
428- Bring the Fedora and RHEL packages more in-line.
429
430* Wed Aug 26 2015 Neil Horman <nhorman@redhat.com> - 2.1.0-1
431- Update to latest version
432
433* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.0-2
434- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
435
436* Mon Apr 06 2015 Neil Horman <nhorman@redhat.com> - 2.0.0-1
437- Update to dpdk 2.0
438- converted --with shared option to --without shared option
439
440* Wed Jan 28 2015 Panu Matilainen <pmatilai@redhat.com> - 1.7.0-8
441- Always build with -fPIC
442
443* Wed Jan 28 2015 Panu Matilainen <pmatilai@redhat.com> - 1.7.0-7
444- Policy compliance: move static libraries to -devel, provide dpdk-static
445- Add a spec option to build as shared libraries
446
447* Wed Jan 28 2015 Panu Matilainen <pmatilai@redhat.com> - 1.7.0-6
448- Avoid variable expansion in the spec here-documents during build
449- Drop now unnecessary debug flags patch
450- Add a spec option to build a combined library
451
452* Tue Jan 27 2015 Panu Matilainen <pmatilai@redhat.com> - 1.7.0-5
453- Avoid unnecessary use of %%global, lazy expansion is normally better
454- Drop unused destdir macro while at it
455- Arrange for RTE_SDK environment + directory layout expected by DPDK apps
456- Drop config from main package, it shouldn't be needed at runtime
457
458* Tue Jan 27 2015 Panu Matilainen <pmatilai@redhat.com> - 1.7.0-4
459- Copy the headers instead of broken symlinks into -devel package
460- Force sane mode on the headers
461- Avoid unnecessary %%exclude by not copying unpackaged content to buildroot
462- Clean up summaries and descriptions
463- Drop unnecessary kernel-devel BR, we are not building kernel modules
464
465* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.0-3
466- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
467
468* Thu Jul 17 2014 - John W. Linville <linville@redhat.com> - 1.7.0-2
469- Use EXTRA_CFLAGS to include standard Fedora compiler flags in build
470- Set CONFIG_RTE_MACHINE=default to build for least-common-denominator machines
471- Turn-off build of librte_acl, since it does not build on default machines
472- Turn-off build of physical device PMDs that require kernel support
473- Clean-up the install rules to match current packaging
474- Correct changelog versions 1.0.7 -> 1.7.0
475- Remove ix86 from ExclusiveArch -- it does not build with above changes
476
477* Thu Jul 10 2014 - Neil Horman <nhorman@tuxdriver.com> - 1.7.0-1.0
478- Update source to official 1.7.0 release 
479
480* Thu Jul 03 2014 - Neil Horman <nhorman@tuxdriver.com>
481- Fixing up release numbering
482
483* Tue Jul 01 2014 - Neil Horman <nhorman@tuxdriver.com> - 1.7.0-0.9.1.20140603git5ebbb1728
484- Fixed some build errors (empty debuginfo, bad 32 bit build)
485
486* Wed Jun 11 2014 - Neil Horman <nhorman@tuxdriver.com> - 1.7.0-0.9.20140603git5ebbb1728
487- Fix another build dependency
488
489* Mon Jun 09 2014 - Neil Horman <nhorman@tuxdriver.com> - 1.7.0-0.8.20140603git5ebbb1728
490- Fixed doc arch versioning issue
491
492* Mon Jun 09 2014 - Neil Horman <nhorman@tuxdriver.com> - 1.7.0-0.7.20140603git5ebbb1728
493- Added verbose output to build
494
495* Tue May 13 2014 - Neil Horman <nhorman@tuxdriver.com> - 1.7.0-0.6.20140603git5ebbb1728
496- Initial Build
497
498