acl: new test-acl application
[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 includes full version because there is no ABI stability yet
33 Name: dpdk-core-1.6.0
34 Version: r2
35 %define fullversion 1.6.0%{version}
36 Release: 1
37 Packager: packaging@6wind.com
38 URL: http://dpdk.org
39 Source: http://dpdk.org/browse/dpdk/snapshot/dpdk-%{fullversion}.tar.gz
40
41 Summary: Intel(r) Data Plane Development Kit core
42 Group: System Environment/Libraries
43 License: BSD and LGPLv2 and GPLv2
44
45 ExclusiveArch: i686, x86_64
46 %define target %{_arch}-native-linuxapp-gcc
47 %define machine default
48
49 BuildRequires: kernel-devel, kernel-headers, doxygen
50
51 %description
52 Intel(r) DPDK core includes kernel modules, core libraries and tools.
53 testpmd application allows to test fast packet processing environments
54 on x86 platforms. For instance, it can be used to check that environment
55 can support fast path applications such as 6WINDGate, pktgen, rumptcpip, etc.
56 More libraries are available as extensions in other packages.
57
58 %package devel
59 Summary: Intel(r) Data Plane Development Kit core for development
60 %description devel
61 Intel(r) DPDK core-devel is a set of makefiles, headers, examples and documentation
62 for fast packet processing on x86 platforms.
63 More libraries are available as extensions in other packages.
64
65 %define destdir %{buildroot}%{_prefix}
66 %define moddir  /lib/modules/%(uname -r)/extra
67 %define datadir %{_datadir}/dpdk
68 %define docdir  %{_docdir}/dpdk
69
70 %prep
71 %setup -qn dpdk-%{fullversion}
72
73 %build
74 make O=%{target} T=%{target} config
75 sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config
76 sed -ri 's,(RTE_APP_TEST=).*,\1n,'         %{target}/.config
77 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config
78 make O=%{target} %{?_smp_mflags}
79 make O=%{target} doc
80
81 %install
82 rm -rf %{buildroot}
83 make           O=%{target}     DESTDIR=%{destdir}
84 mkdir -p                               %{buildroot}%{moddir}
85 mv    %{destdir}/%{target}/kmod/*.ko   %{buildroot}%{moddir}
86 rmdir %{destdir}/%{target}/kmod
87 mkdir -p                               %{buildroot}%{_sbindir}
88 ln -s %{datadir}/tools/igb_uio_bind.py %{buildroot}%{_sbindir}/igb_uio_bind
89 mkdir -p                               %{buildroot}%{_bindir}
90 mv    %{destdir}/%{target}/app/testpmd %{buildroot}%{_bindir}
91 rmdir %{destdir}/%{target}/app
92 mv    %{destdir}/%{target}/include     %{buildroot}%{_includedir}
93 mv    %{destdir}/%{target}/lib         %{buildroot}%{_libdir}
94 mkdir -p                               %{buildroot}%{docdir}
95 mv    %{destdir}/%{target}/doc/*       %{buildroot}%{docdir}
96 rmdir %{destdir}/%{target}/doc
97 mkdir -p                               %{buildroot}%{datadir}
98 mv    %{destdir}/%{target}/.config     %{buildroot}%{datadir}/config
99 mv    %{destdir}/%{target}             %{buildroot}%{datadir}
100 mv    %{destdir}/mk                    %{buildroot}%{datadir}
101 cp -a            examples              %{buildroot}%{datadir}
102 cp -a            tools                 %{buildroot}%{datadir}
103 ln -s            %{datadir}/config     %{buildroot}%{datadir}/%{target}/.config
104 ln -s            %{_includedir}        %{buildroot}%{datadir}/%{target}/include
105 ln -s            %{_libdir}            %{buildroot}%{datadir}/%{target}/lib
106
107 %files
108 %dir %{datadir}
109 %{datadir}/config
110 %{datadir}/tools
111 %{moddir}/*
112 %{_sbindir}/*
113 %{_bindir}/*
114 %{_libdir}/*
115
116 %files devel
117 %{_includedir}/*
118 %{datadir}/mk
119 %{datadir}/%{target}
120 %{datadir}/examples
121 %doc %{docdir}
122
123 %post
124 /sbin/ldconfig
125 /sbin/depmod
126
127 %postun
128 /sbin/ldconfig
129 /sbin/depmod