03669957902f28b361c8ffd34ec54a1dad3d7f02
[dpdk.git] / pkg / dpdk-core.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: 1.7.1
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: Intel(r) Data Plane Development Kit core
40 Group: System Environment/Libraries
41 License: BSD and LGPLv2 and GPLv2
42
43 ExclusiveArch: i686, x86_64
44 %global target %{_arch}-native-linuxapp-gcc
45 %global machine default
46
47 BuildRequires: kernel-devel, kernel-headers, libpcap-devel, xen-devel, doxygen
48
49 %description
50 Intel(r) DPDK core includes kernel modules, core libraries and tools.
51 testpmd application allows to test fast packet processing environments
52 on x86 platforms. For instance, it can be used to check that environment
53 can support fast path applications such as 6WINDGate, pktgen, rumptcpip, etc.
54 More libraries are available as extensions in other packages.
55
56 %package devel
57 Summary: Intel(r) Data Plane Development Kit for development
58 Requires: %{name}%{?_isa} = %{version}-%{release}
59 %description devel
60 Intel(r) DPDK devel is a set of makefiles, headers and examples
61 for fast packet processing on x86 platforms.
62
63 %package doc
64 Summary: Intel(r) Data Plane Development Kit API documentation
65 BuildArch: noarch
66 %description doc
67 Intel(r) DPDK doc explains the API details in doxygen HTML format.
68
69 %global destdir %{buildroot}%{_prefix}
70 %global moddir  /lib/modules/%(uname -r)/extra
71 %global datadir %{_datadir}/dpdk
72 %global docdir  %{_docdir}/dpdk
73
74 %prep
75 %setup -q
76
77 %build
78 make O=%{target} T=%{target} config
79 sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config
80 sed -ri 's,(RTE_APP_TEST=).*,\1n,'         %{target}/.config
81 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config
82 sed -ri 's,(LIBRTE_PMD_PCAP=).*,\1y,'      %{target}/.config
83 sed -ri 's,(LIBRTE_PMD_XENVIRT=).*,\1y,'   %{target}/.config
84 sed -ri 's,(LIBRTE_XEN_DOM0=).*,\1y,'      %{target}/.config
85 make O=%{target} %{?_smp_mflags}
86 make O=%{target} doc
87
88 %install
89 rm -rf %{buildroot}
90 make           O=%{target}     DESTDIR=%{destdir}
91 mkdir -p                               %{buildroot}%{moddir}
92 mv    %{destdir}/%{target}/kmod/*.ko   %{buildroot}%{moddir}
93 rmdir %{destdir}/%{target}/kmod
94 mkdir -p                               %{buildroot}%{_sbindir}
95 ln -s %{datadir}/tools/*nic_bind.py    %{buildroot}%{_sbindir}/dpdk_nic_bind
96 mkdir -p                               %{buildroot}%{_bindir}
97 mv    %{destdir}/%{target}/app/testpmd %{buildroot}%{_bindir}
98 rmdir %{destdir}/%{target}/app
99 mv    %{destdir}/%{target}/include     %{buildroot}%{_includedir}
100 mv    %{destdir}/%{target}/lib         %{buildroot}%{_libdir}
101 mkdir -p                               %{buildroot}%{docdir}
102 mv    %{destdir}/%{target}/doc/*       %{buildroot}%{docdir}
103 rmdir %{destdir}/%{target}/doc
104 mkdir -p                               %{buildroot}%{datadir}
105 mv    %{destdir}/%{target}/.config     %{buildroot}%{datadir}/config
106 mv    %{destdir}/%{target}             %{buildroot}%{datadir}
107 mv    %{destdir}/scripts               %{buildroot}%{datadir}
108 mv    %{destdir}/mk                    %{buildroot}%{datadir}
109 cp -a            examples              %{buildroot}%{datadir}
110 cp -a            tools                 %{buildroot}%{datadir}
111 ln -s            %{datadir}/config     %{buildroot}%{datadir}/%{target}/.config
112 ln -s            %{_includedir}        %{buildroot}%{datadir}/%{target}/include
113 ln -s            %{_libdir}            %{buildroot}%{datadir}/%{target}/lib
114
115 %files
116 %dir %{datadir}
117 %{datadir}/config
118 %{datadir}/tools
119 %{moddir}/*
120 %{_sbindir}/*
121 %{_bindir}/*
122 %{_libdir}/*
123
124 %files devel
125 %{_includedir}/*
126 %{datadir}/mk
127 %{datadir}/scripts
128 %{datadir}/%{target}
129 %{datadir}/examples
130
131 %files doc
132 %doc %{docdir}
133
134 %post
135 /sbin/ldconfig
136 /sbin/depmod
137
138 %postun
139 /sbin/ldconfig
140 /sbin/depmod