5ba343132e29232f88ef63ab8b0664117b5b12e5
[deb_dpdk.git] / pkg / dpdk.spec
1 # Copyright 2014 6WIND S.A.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions
5 # are met:
6 #
7 # - Redistributions of source code must retain the above copyright
8 #   notice, this list of conditions and the following disclaimer.
9 #
10 # - Redistributions in binary form must reproduce the above copyright
11 #   notice, this list of conditions and the following disclaimer in
12 #   the documentation and/or other materials provided with the
13 #   distribution.
14 #
15 # - Neither the name of 6WIND S.A. nor the names of its
16 #   contributors may be used to endorse or promote products derived
17 #   from this software without specific prior written permission.
18 #
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30 # OF THE POSSIBILITY OF SUCH DAMAGE.
31
32 Name: dpdk
33 Version: 17.08
34 Release: 1
35 Packager: packaging@6wind.com
36 URL: http://dpdk.org
37 Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{version}.tar.gz
38
39 Summary: Data Plane Development Kit core
40 Group: System Environment/Libraries
41 License: BSD and LGPLv2 and GPLv2
42
43 ExclusiveArch: i686 x86_64 aarch64
44 %ifarch aarch64
45 %global machine armv8a
46 %global target arm64-%{machine}-linuxapp-gcc
47 %global config arm64-%{machine}-linuxapp-gcc
48 %else
49 %global machine default
50 %global target %{_arch}-%{machine}-linuxapp-gcc
51 %global config %{_arch}-native-linuxapp-gcc
52 %endif
53
54 BuildRequires: kernel-devel, kernel-headers, libpcap-devel
55 %ifarch i686 x86_64
56 BuildRequires: xen-devel
57 %endif
58 BuildRequires: doxygen, python-sphinx, inkscape
59 BuildRequires: texlive-collection-latexextra
60
61 %description
62 DPDK core includes kernel modules, core libraries and tools.
63 testpmd application allows to test fast packet processing environments
64 on x86 platforms. For instance, it can be used to check that environment
65 can support fast path applications such as 6WINDGate, pktgen, rumptcpip, etc.
66 More libraries are available as extensions in other packages.
67
68 %package devel
69 Summary: Data Plane Development Kit for development
70 Requires: %{name}%{?_isa} = %{version}-%{release}
71 %description devel
72 DPDK devel is a set of makefiles, headers and examples
73 for fast packet processing on x86 platforms.
74
75 %package doc
76 Summary: Data Plane Development Kit API documentation
77 BuildArch: noarch
78 %description doc
79 DPDK doc is divided in two parts: API details in doxygen HTML format
80 and guides in sphinx HTML/PDF formats.
81
82 %prep
83 %setup -q
84
85 %build
86 make O=%{target} T=%{config} config
87 sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config
88 sed -ri 's,(RTE_APP_TEST=).*,\1n,'         %{target}/.config
89 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config
90 sed -ri 's,(RTE_NEXT_ABI=).*,\1n,'         %{target}/.config
91 sed -ri 's,(LIBRTE_VHOST=).*,\1y,'         %{target}/.config
92 sed -ri 's,(LIBRTE_PMD_PCAP=).*,\1y,'      %{target}/.config
93 %ifarch i686 x86_64
94 sed -ri 's,(LIBRTE_PMD_XENVIRT=).*,\1y,'   %{target}/.config
95 %endif
96 make O=%{target} %{?_smp_mflags}
97 make O=%{target} doc
98
99 %install
100 rm -rf %{buildroot}
101 make install O=%{target} DESTDIR=%{buildroot} \
102         prefix=%{_prefix} bindir=%{_bindir} sbindir=%{_sbindir} \
103         includedir=%{_includedir}/dpdk libdir=%{_libdir} \
104         datadir=%{_datadir}/dpdk docdir=%{_docdir}/dpdk
105
106 %files
107 %dir %{_datadir}/dpdk
108 %{_datadir}/dpdk/usertools
109 /lib/modules/%(uname -r)/extra/*
110 %{_sbindir}/*
111 %{_bindir}/*
112 %{_libdir}/*
113
114 %files devel
115 %{_includedir}/dpdk
116 %{_datadir}/dpdk/mk
117 %{_datadir}/dpdk/buildtools
118 %{_datadir}/dpdk/%{target}
119 %{_datadir}/dpdk/examples
120
121 %files doc
122 %doc %{_docdir}/dpdk
123
124 %post
125 /sbin/ldconfig
126 /sbin/depmod
127
128 %postun
129 /sbin/ldconfig
130 /sbin/depmod