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: libboost_headers-devel
45 BuildRequires: libboost_thread-devel
46 BuildRequires: libnuma-devel
47 BuildRequires: libopenssl-devel
48 BuildRequires: libtool
49 BuildRequires: lsb-release
51 BuildRequires: mbedtls-devel
52 BuildRequires: openssl-devel
53 BuildRequires: python-devel
54 BuildRequires: python-pip
55 BuildRequires: python-rpm-macros
56 BuildRequires: python2-ply
57 BuildRequires: python3-devel
58 BuildRequires: python3-pip
60 Conflicts: otherproviders(vpp-any)
61 Provides: %{name}-any = %{version}
62 ExclusiveArch: x86_64 aarch64
63 %if 0%{?suse_version} >= 1210
64 BuildRequires: systemd-rpm-macros
68 The Vector Packet Processing platform is a framework that provides
69 switch/router functionality. It is based on Cisco's packet processing
70 stack that can run on commodity CPUs.
71 This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
72 vpp - the vector packet engine
73 vpp_api_test - vector packet engine API test tool
74 vpp_json_test - vector packet engine JSON test tool
77 Summary: VPP libraries
78 Group: System/Libraries
79 Provides: %{lname}-any = %{version}
81 %description -n %{lname}
82 This package contains the VPP shared libraries, including:
83 vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
85 vlib - vector processing library
86 vlib-api - binary API library
87 vnet - network stack library
90 Summary: VPP header files, static libraries
91 Group: Development/Libraries/C and C++
92 Requires: %{lname} = %{version}
93 Conflicts: otherproviders(%{name}-any-devel)
94 Provides: %{name}-any-devel = %{version}
97 This package contains the header files for VPP.
98 Install this package if you want to write a
99 program for compilation and linking with vpp lib.
102 vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
107 Summary: Vector Packet Processing--runtime plugins
108 Group: Productivity/Networking/Routing
109 Conflicts: otherproviders(%{name}-any-plugins)
110 Provides: %{name}-any-plugins = %{version}
113 This package contains the VPP plugins which are loaded by VPP at startup
116 Summary: VPP api lua bindings
117 Group: Development/Libraries/Other
118 Requires: %{lname} = %{version}
119 Requires: %{name} = %{version}
120 Requires: %{name}-devel = %{version}
121 Conflicts: otherproviders(%{name}-any-api-lua)
122 Provides: %{name}-any-api-lua = %{version}
125 This package contains the lua bindings for the vpp api
128 Summary: VPP api python bindings
129 Group: Development/Libraries/Python
130 Requires: %{lname} = %{version}
131 Requires: %{name} = %{version}
132 Requires: %{name}-devel = %{version}
133 Requires: python-setuptools
134 Conflicts: otherproviders(%{name}-any-python-api)
135 Provides: %{name}-any-python-api = %{version}
137 %description api-python
138 This package contains the python bindings for the vpp api
141 %setup -q -n %{name}-%{version}
144 export VPP_BUILD_USER=suse
145 export VPP_BUILD_HOST=SUSE
147 make -C build-root V=1 CC=gcc-7 CXX=g++-7 PLATFORM=vpp TAG=vpp install-packages
149 cd %{_vpp_build_dir}/../src/vpp-api/python && %{py2_build}
153 getent group vpp >/dev/null || groupadd -r vpp
154 %service_add_pre vpp.service
160 mkdir -p -m755 %{buildroot}%{_bindir}
161 mkdir -p -m755 %{buildroot}%{_unitdir}
162 install -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir}
165 mkdir -p -m755 %{buildroot}%{_datadir}/vpp/api
170 mkdir -p -m755 %{buildroot}%{_datadir}/vpp/api
171 install -p -m 644 %{_vpp_install_dir}/vpp/share/vpp/api/core/*.api.json %{buildroot}%{_datadir}/vpp/api
176 mkdir -p -m755 %{buildroot}%{_sysconfdir}/vpp
177 mkdir -p -m755 %{buildroot}%{_sysconfdir}/sysctl.d
178 install -p -m 644 %{_vpp_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
179 install -p -m 644 %{_vpp_build_dir}/../src/vpp/conf/startup.conf %{buildroot}%{_sysconfdir}/vpp/startup.conf
180 install -p -m 644 %{_vpp_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}%{_sysconfdir}/sysctl.d
184 mkdir -p -m755 %{buildroot}%{_libdir}
185 mkdir -p -m755 %{buildroot}%{_sysconfdir}/bash_completion.d
186 mkdir -p -m755 %{buildroot}%{_datadir}/vpp
187 for file in $(find %{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print )
189 install -p -m 755 $file %{buildroot}%{_libdir}
191 for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
194 ( cd %{buildroot}%{_libdir} &&
195 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
196 ( cd %{buildroot}%{_libdir} &&
197 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
199 for file in $(find %{_vpp_install_dir}/vpp/share/vpp/api -type f -name '*.api.json' -print )
201 install -p -m 644 $file %{buildroot}%{_datadir}/vpp/api
205 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/lua/examples/cli
206 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/lua/examples/lute
207 for file in $(cd %{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
209 install -p -m 644 %{_vpp_install_dir}/../../src/vpp-api/lua/$file \
210 %{buildroot}%{_datadir}/doc/vpp/examples/lua/$file
214 cd %{_vpp_build_dir}/../src/vpp-api/python && %{py2_install}
216 mkdir -p -m755 %{buildroot}%{python_sitelib}/vpp_papi
217 for file in $(find %{_vpp_install_dir}/*/lib/python2.7/site-packages/ -type f -print | grep -v pyc | grep -v pyo)
219 install -p -m755 $file %{buildroot}%{python_sitelib}/vpp_papi/
221 chmod -x %{buildroot}%{python_sitelib}/vpp_papi/*.txt
226 for dir in %{_vpp_install_dir}/{vom,vpp}/include/
228 for subdir in $(cd ${dir} && find . -type d -print)
230 mkdir -p -m755 %{buildroot}%{_includedir}/${subdir}
232 for file in $(cd ${dir} && find . -type f -print)
234 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
239 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/sample-plugin/sample
240 for file in $(cd %{_vpp_install_dir}/../../sample-plugin && find -type f -print)
242 install -p -m 644 %{_vpp_install_dir}/../../sample-plugin/$file \
243 %{buildroot}%{_datadir}/doc/vpp/examples/sample-plugin/$file
249 mkdir -p -m755 %{buildroot}%{_libdir}/vpp_plugins
250 mkdir -p -m755 %{buildroot}%{_libdir}/vpp_api_test_plugins
251 for file in $(cd %{_vpp_plugins_lib_dir}/vpp_plugins && find -type f -print)
253 install -p -m 644 %{_vpp_plugins_lib_dir}/vpp_plugins/$file \
254 %{buildroot}/%{_libdir}/vpp_plugins/$file
257 for file in $(cd %{_vpp_plugins_lib_dir}/vpp_api_test_plugins && find -type f -print)
259 install -p -m 644 %{_vpp_plugins_lib_dir}/vpp_api_test_plugins/$file \
260 %{buildroot}/%{_libdir}/vpp_api_test_plugins/$file
263 for file in $(find %{_vpp_install_dir}/vpp/share/vpp/api/plugins -type f -name '*.api.json' -print )
265 install -p -m 644 $file %{buildroot}%{_datadir}/vpp/api
269 # remove RPATH from ELF binaries
271 %{_vpp_build_dir}/scripts/remove-rpath %{buildroot}
273 export NO_BRP_CHECK_RPATH=true
276 %service_add_post vpp.service
278 %post -n %{lname} -p /sbin/ldconfig
281 %service_del_preun vpp.service
284 %service_del_postun vpp.service
286 %postun -n %{lname} -p /sbin/ldconfig
289 %{_unitdir}/vpp.service
293 %dir %{_sysconfdir}/vpp
294 %config %{_sysconfdir}/sysctl.d/80-vpp.conf
295 %config %{_sysconfdir}/vpp/startup.conf
299 %exclude %{_libdir}/vpp_plugins
300 %exclude %{_libdir}/vpp_api_test_plugins
304 %{_datadir}/doc/vpp/examples/lua
307 %dir %{python_sitelib}/vpp_papi*
308 %{python_sitelib}/vpp_papi*
311 %dir %{_datadir}/doc/vpp
312 %dir %{_datadir}/doc/vpp/examples
315 %{_datadir}/doc/vpp/examples/sample-plugin
317 %dir %{_datadir}/vpp/api
318 %{_datadir}/vpp/api/*
321 %dir %{_libdir}/vpp_plugins
322 %dir %{_libdir}/vpp_api_test_plugins
323 %{_libdir}/vpp_plugins/*.so*
324 %{_libdir}/vpp_api_test_plugins/*.so*