2 # spec file for package vpp
4 # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
19 %define _vpp_build_dir %{buildroot}/../../BUILD/vpp-%{version}/build-root
20 %define _vpp_install_dir %{_vpp_build_dir}/install-vpp-native/
21 %define _vpp_plugins_lib_dir %{_vpp_install_dir}/vpp/lib
28 Summary: Set of libraries and drivers for fast packet processing
30 Group: Productivity/Networking/Routing
31 Url: https://wiki.fd.io/view/VPP
32 Source0: %{name}-%{version}-%{_release}.tar.xz
33 BuildRequires: autoconf
34 BuildRequires: automake
37 BuildRequires: check-devel
38 BuildRequires: chrpath
39 BuildRequires: distribution-release
41 BuildRequires: gcc-c++
42 BuildRequires: glibc-devel
43 BuildRequires: glibc-devel-static
44 BuildRequires: java-devel >= 1.8
45 BuildRequires: libboost_headers-devel
46 BuildRequires: libboost_thread-devel
47 BuildRequires: libnuma-devel
48 BuildRequires: libopenssl-devel
49 BuildRequires: libtool
50 BuildRequires: lsb-release
52 BuildRequires: mbedtls-devel
53 BuildRequires: openssl-devel
54 BuildRequires: python-devel
55 BuildRequires: python-pip
56 BuildRequires: python-rpm-macros
57 BuildRequires: python2-ply
58 BuildRequires: python3-devel
59 BuildRequires: python3-pip
61 Conflicts: otherproviders(vpp-any)
62 Provides: %{name}-any = %{version}
63 ExclusiveArch: x86_64 aarch64
64 %if 0%{?suse_version} >= 1210
65 BuildRequires: systemd-rpm-macros
69 The Vector Packet Processing platform is a framework that provides
70 switch/router functionality. It is based on Cisco's packet processing
71 stack that can run on commodity CPUs.
72 This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
73 vpp - the vector packet engine
74 vpp_api_test - vector packet engine API test tool
75 vpp_json_test - vector packet engine JSON test tool
78 Summary: VPP libraries
79 Group: System/Libraries
80 Provides: %{lname}-any = %{version}
82 %description -n %{lname}
83 This package contains the VPP shared libraries, including:
84 vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
86 vlib - vector processing library
87 vlib-api - binary API library
88 vnet - network stack library
91 Summary: VPP header files, static libraries
92 Group: Development/Libraries/C and C++
93 Requires: %{lname} = %{version}
94 Conflicts: otherproviders(%{name}-any-devel)
95 Provides: %{name}-any-devel = %{version}
98 This package contains the header files for VPP.
99 Install this package if you want to write a
100 program for compilation and linking with vpp lib.
103 vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
108 Summary: Vector Packet Processing--runtime plugins
109 Group: Productivity/Networking/Routing
110 Conflicts: otherproviders(%{name}-any-plugins)
111 Provides: %{name}-any-plugins = %{version}
114 This package contains the VPP plugins which are loaded by VPP at startup
117 Summary: VPP api lua bindings
118 Group: Development/Libraries/Other
119 Requires: %{lname} = %{version}
120 Requires: %{name} = %{version}
121 Requires: %{name}-devel = %{version}
122 Conflicts: otherproviders(%{name}-any-api-lua)
123 Provides: %{name}-any-api-lua = %{version}
126 This package contains the lua bindings for the vpp api
129 Summary: VPP api java bindings
130 Group: Development/Libraries/Java
131 Requires: %{lname} = %{version}
132 Requires: %{name} = %{version}
133 Requires: %{name}-devel = %{version}
134 Conflicts: otherproviders(%{name}-any-api-java)
135 Provides: %{name}-any-api-java = %{version}
137 %description api-java
138 This package contains the java bindings for the vpp api
141 Summary: VPP api python bindings
142 Group: Development/Libraries/Python
143 Requires: %{lname} = %{version}
144 Requires: %{name} = %{version}
145 Requires: %{name}-devel = %{version}
146 Requires: python-setuptools
147 Conflicts: otherproviders(%{name}-any-python-api)
148 Provides: %{name}-any-python-api = %{version}
150 %description api-python
151 This package contains the python bindings for the vpp api
154 %setup -q -n %{name}-%{version}
157 export VPP_BUILD_USER=suse
158 export VPP_BUILD_HOST=SUSE
160 make -C build-root V=1 CC=gcc-7 CXX=g++-7 PLATFORM=vpp TAG=vpp install-packages
162 cd %{_vpp_build_dir}/../src/vpp-api/python && %{py2_build}
166 getent group vpp >/dev/null || groupadd -r vpp
167 %service_add_pre vpp.service
173 mkdir -p -m755 %{buildroot}%{_bindir}
174 mkdir -p -m755 %{buildroot}%{_unitdir}
175 install -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir}
178 mkdir -p -m755 %{buildroot}%{_datadir}/vpp/api
183 mkdir -p -m755 %{buildroot}%{_datadir}/vpp/api
184 install -p -m 644 %{_vpp_install_dir}/vpp/share/vpp/api/core/*.api.json %{buildroot}%{_datadir}/vpp/api
189 mkdir -p -m755 %{buildroot}%{_sysconfdir}/vpp
190 mkdir -p -m755 %{buildroot}%{_sysconfdir}/sysctl.d
191 install -p -m 644 %{_vpp_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
192 install -p -m 644 %{_vpp_build_dir}/../src/vpp/conf/startup.conf %{buildroot}%{_sysconfdir}/vpp/startup.conf
193 install -p -m 644 %{_vpp_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}%{_sysconfdir}/sysctl.d
197 mkdir -p -m755 %{buildroot}%{_libdir}
198 mkdir -p -m755 %{buildroot}%{_sysconfdir}/bash_completion.d
199 mkdir -p -m755 %{buildroot}%{_datadir}/vpp
200 for file in $(find %{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print )
202 install -p -m 755 $file %{buildroot}%{_libdir}
204 for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
207 ( cd %{buildroot}%{_libdir} &&
208 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
209 ( cd %{buildroot}%{_libdir} &&
210 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
212 for file in $(find %{_vpp_install_dir}/vpp/share/vpp/api -type f -name '*.api.json' -print )
214 install -p -m 644 $file %{buildroot}%{_datadir}/vpp/api
218 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/lua/examples/cli
219 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/lua/examples/lute
220 for file in $(cd %{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
222 install -p -m 644 %{_vpp_install_dir}/../../src/vpp-api/lua/$file \
223 %{buildroot}%{_datadir}/doc/vpp/examples/lua/$file
227 mkdir -p -m755 %{buildroot}%{_datadir}/java
228 for file in $(find %{_vpp_install_dir}/japi/share/java -type f -name '*.jar' -print )
230 install -p -m 644 $file %{buildroot}%{_datadir}/java
234 cd %{_vpp_build_dir}/../src/vpp-api/python && %{py2_install}
236 mkdir -p -m755 %{buildroot}%{python_sitelib}/vpp_papi
237 for file in $(find %{_vpp_install_dir}/*/lib/python2.7/site-packages/ -type f -print | grep -v pyc | grep -v pyo)
239 install -p -m755 $file %{buildroot}%{python_sitelib}/vpp_papi/
241 chmod -x %{buildroot}%{python_sitelib}/vpp_papi/*.txt
246 for dir in $(find %{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk)
248 for subdir in $(cd ${dir} && find . -type d -print)
250 mkdir -p -m755 %{buildroot}%{_includedir}/${subdir}
252 for file in $(cd ${dir} && find . -type f -print)
254 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
258 mkdir -p -m755 %{buildroot}%{python_sitelib}/jvppgen
259 install -p -m755 %{_vpp_build_dir}/../extras/japi/java/jvpp/gen/jvpp_gen.py %{buildroot}%{_prefix}/bin
260 for i in $(ls %{_vpp_build_dir}/../extras/japi/java/jvpp/gen/jvppgen/*.py); do
261 install -p -m755 ${i} %{buildroot}%{python_sitelib}/jvppgen
265 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/sample-plugin/sample
266 for file in $(cd %{_vpp_install_dir}/../../sample-plugin && find -type f -print)
268 install -p -m 644 %{_vpp_install_dir}/../../sample-plugin/$file \
269 %{buildroot}%{_datadir}/doc/vpp/examples/sample-plugin/$file
275 mkdir -p -m755 %{buildroot}%{_libdir}/vpp_plugins
276 mkdir -p -m755 %{buildroot}%{_libdir}/vpp_api_test_plugins
277 for file in $(cd %{_vpp_plugins_lib_dir}/vpp_plugins && find -type f -print)
279 install -p -m 644 %{_vpp_plugins_lib_dir}/vpp_plugins/$file \
280 %{buildroot}/%{_libdir}/vpp_plugins/$file
283 for file in $(cd %{_vpp_plugins_lib_dir}/vpp_api_test_plugins && find -type f -print)
285 install -p -m 644 %{_vpp_plugins_lib_dir}/vpp_api_test_plugins/$file \
286 %{buildroot}/%{_libdir}/vpp_api_test_plugins/$file
289 for file in $(find %{_vpp_install_dir}/vpp/share/vpp/api/plugins -type f -name '*.api.json' -print )
291 install -p -m 644 $file %{buildroot}%{_datadir}/vpp/api
295 # remove RPATH from ELF binaries
297 %{_vpp_build_dir}/scripts/remove-rpath %{buildroot}
299 export NO_BRP_CHECK_RPATH=true
302 %service_add_post vpp.service
304 %post -n %{lname} -p /sbin/ldconfig
307 %service_del_preun vpp.service
310 %service_del_postun vpp.service
312 %postun -n %{lname} -p /sbin/ldconfig
315 %{_unitdir}/vpp.service
319 %dir %{_sysconfdir}/vpp
320 %config %{_sysconfdir}/sysctl.d/80-vpp.conf
321 %config %{_sysconfdir}/vpp/startup.conf
325 %exclude %{_libdir}/vpp_plugins
326 %exclude %{_libdir}/vpp_api_test_plugins
330 %{_datadir}/doc/vpp/examples/lua
336 %dir %{python_sitelib}/vpp_papi*
337 %{python_sitelib}/vpp_papi*
340 %dir %{python_sitelib}/jvppgen
341 %{python_sitelib}/jvppgen/*
342 %dir %{_datadir}/doc/vpp
343 %dir %{_datadir}/doc/vpp/examples
345 %{_bindir}/jvpp_gen.py
347 %{_datadir}/doc/vpp/examples/sample-plugin
349 %dir %{_datadir}/vpp/api
350 %{_datadir}/vpp/api/*
353 %dir %{_libdir}/vpp_plugins
354 %dir %{_libdir}/vpp_api_test_plugins
355 %{_libdir}/vpp_plugins/*.so*
356 %{_libdir}/vpp_api_test_plugins/*.so*