2 # spec file for package vpp
4 # Copyright (c) 2017 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/lib64
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: glibc-devel-static
42 BuildRequires: java-1_8_0-openjdk-devel
43 BuildRequires: libnuma-devel
44 BuildRequires: libopenssl-devel
45 BuildRequires: libtool
46 BuildRequires: lsb-release
48 BuildRequires: openssl-devel
49 BuildRequires: python-devel
50 BuildRequires: python-pip
51 BuildRequires: python-rpm-macros
52 BuildRequires: python3-devel
53 BuildRequires: python3-pip
55 Conflicts: otherproviders(vpp-any)
56 Provides: %{name}-any = %{version}
57 ExclusiveArch: x86_64 aarch64
58 %if 0%{?suse_version} >= 1210
59 BuildRequires: systemd-rpm-macros
63 The Vector Packet Processing platform is a framework that provides
64 switch/router functionality. It is based on Cisco's packet processing
65 stack that can run on commodity CPUs.
66 This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
67 vpp - the vector packet engine
68 vpp_api_test - vector packet engine API test tool
69 vpp_json_test - vector packet engine JSON test tool
72 Summary: VPP libraries
73 Group: System/Libraries
74 Provides: %{lname}-any = %{version}
76 %description -n %{lname}
77 This package contains the VPP shared libraries, including:
78 vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
80 vlib - vector processing library
81 vlib-api - binary API library
82 vnet - network stack library
85 Summary: VPP header files, static libraries
86 Group: Development/Libraries/C and C++
87 Requires: %{lname} = %{version}
88 Conflicts: otherproviders(%{name}-any-devel)
89 Provides: %{name}-any-devel = %{version}
92 This package contains the header files for VPP.
93 Install this package if you want to write a
94 program for compilation and linking with vpp lib.
97 vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
102 Summary: Vector Packet Processing--runtime plugins
103 Group: Productivity/Networking/Routing
104 Conflicts: otherproviders(%{name}-any-plugins)
105 Provides: %{name}-any-plugins = %{version}
108 This package contains the VPP plugins which are loaded by VPP at startup
111 Summary: VPP api lua bindings
112 Group: Development/Libraries/Other
113 Requires: %{lname} = %{version}
114 Requires: %{name} = %{version}
115 Conflicts: otherproviders(%{name}-any-api-lua)
116 Provides: %{name}-any-api-lua = %{version}
119 This package contains the lua bindings for the vpp api
122 Summary: VPP api java bindings
123 Group: Development/Libraries/Java
124 Requires: %{lname} = %{version}
125 Requires: %{name} = %{version}
126 Conflicts: otherproviders(%{name}-any-api-java)
127 Provides: %{name}-any-api-java = %{version}
129 %description api-java
130 This package contains the java bindings for the vpp api
133 Summary: VPP api python bindings
134 Group: Development/Libraries/Python
135 Requires: %{lname} = %{version}
136 Requires: %{name} = %{version}
137 Requires: python-setuptools
138 Conflicts: otherproviders(%{name}-any-python-api)
139 Provides: %{name}-any-python-api = %{version}
141 %description api-python
142 This package contains the python bindings for the vpp api
145 %setup -q -n %{name}-%{version}
148 export VPP_BUILD_USER=suse
149 export VPP_BUILD_HOST=SUSE
151 make V=1 PLATFORM=vpp bootstrap
152 make V=1 PLATFORM=vpp build-release
154 cd %{_vpp_build_dir}/../src/vpp-api/python && %{py2_build}
158 getent group vpp >/dev/null || groupadd -r vpp
159 %service_add_pre vpp.service
165 mkdir -p -m755 %{buildroot}%{_bindir}
166 mkdir -p -m755 %{buildroot}%{_unitdir}
167 install -m 755 %{_vpp_install_dir}/*/bin/* %{buildroot}%{_bindir}
170 mkdir -p -m755 %{buildroot}%{_datadir}/vpp/api
175 mkdir -p -m755 %{buildroot}%{_datadir}/vpp/api
176 install -p -m 644 %{_vpp_install_dir}/vpp/share/vpp/api/core/*.api.json %{buildroot}%{_datadir}/vpp/api
177 install -p -m 644 %{_vpp_install_dir}/vpp/share/vpp/api/plugins/*.api.json %{buildroot}%{_datadir}/vpp/api
181 mkdir -p -m755 %{buildroot}%{_sysconfdir}/vpp
182 mkdir -p -m755 %{buildroot}%{_sysconfdir}/sysctl.d
183 install -p -m 644 %{_vpp_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
184 install -p -m 644 %{_vpp_build_dir}/../src/vpp/conf/startup.conf %{buildroot}%{_sysconfdir}/vpp/startup.conf
185 install -p -m 644 %{_vpp_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}%{_sysconfdir}/sysctl.d
189 mkdir -p -m755 %{buildroot}%{_libdir}
190 mkdir -p -m755 %{buildroot}%{_sysconfdir}/bash_completion.d
191 mkdir -p -m755 %{buildroot}%{_datadir}/vpp
192 for file in $(find %{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print )
194 install -p -m 755 $file %{buildroot}%{_libdir}
196 for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
199 ( cd %{buildroot}%{_libdir} &&
200 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
201 ( cd %{buildroot}%{_libdir} &&
202 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
204 for file in $(find %{_vpp_install_dir}/vpp/share/vpp/api -type f -name '*.api.json' -print )
206 install -p -m 644 $file %{buildroot}%{_datadir}/vpp/api
208 install -p -m 644 %{_vpp_build_dir}/../src/scripts/vppctl_completion %{buildroot}%{_sysconfdir}/bash_completion.d
209 install -p -m 644 %{_vpp_build_dir}/../src/scripts/vppctl-cmd-list %{buildroot}%{_datadir}/vpp
212 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/lua/examples/cli
213 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/lua/examples/lute
214 for file in $(cd %{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
216 install -p -m 644 %{_vpp_install_dir}/../../src/vpp-api/lua/$file \
217 %{buildroot}%{_datadir}/doc/vpp/examples/lua/$file
221 mkdir -p -m755 %{buildroot}%{_datadir}/java
222 for file in $(find %{_vpp_install_dir}/vpp/share/java -type f -name '*.jar' -print )
224 install -p -m 644 $file %{buildroot}%{_datadir}/java
228 cd %{_vpp_build_dir}/../src/vpp-api/python && %{py2_install}
230 mkdir -p -m755 %{buildroot}%{python_sitelib}/vpp_papi
231 for file in $(find %{_vpp_install_dir}/*/lib/python2.7/site-packages/ -type f -print | grep -v pyc | grep -v pyo)
233 install -p -m755 $file %{buildroot}%{python_sitelib}/vpp_papi/
235 chmod -x %{buildroot}%{python_sitelib}/vpp_papi/*.txt
240 for dir in $(find %{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk)
242 for subdir in $(cd ${dir} && find . -type d -print)
244 mkdir -p -m755 %{buildroot}%{_includedir}/${subdir}
246 for file in $(cd ${dir} && find . -type f -print)
248 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
252 mkdir -p -m755 %{buildroot}%{python_sitelib}/jvppgen
253 install -p -m755 %{_vpp_build_dir}/../src/vpp-api/java/jvpp/gen/jvpp_gen.py %{buildroot}%{_prefix}/bin
254 for i in $(ls %{_vpp_build_dir}/../src/vpp-api/java/jvpp/gen/jvppgen/*.py); do
255 install -p -m755 ${i} %{buildroot}%{python_sitelib}/jvppgen
259 mkdir -p -m755 %{buildroot}%{_datadir}/doc/vpp/examples/sample-plugin/sample
260 for file in $(cd %{_vpp_install_dir}/../../sample-plugin && find -type f -print)
262 install -p -m 644 %{_vpp_install_dir}/../../sample-plugin/$file \
263 %{buildroot}%{_datadir}/doc/vpp/examples/sample-plugin/$file
269 mkdir -p -m755 %{buildroot}%{_libdir}/vpp_plugins
270 mkdir -p -m755 %{buildroot}%{_libdir}/vpp_api_test_plugins
271 for file in $(cd %{_vpp_plugins_lib_dir}/vpp_plugins && find -type f -print)
273 install -p -m 644 %{_vpp_plugins_lib_dir}/vpp_plugins/$file \
274 %{buildroot}/%{_libdir}/vpp_plugins/$file
277 for file in $(cd %{_vpp_plugins_lib_dir}/vpp_api_test_plugins && find -type f -print)
279 install -p -m 644 %{_vpp_plugins_lib_dir}/vpp_api_test_plugins/$file \
280 %{buildroot}/%{_libdir}/vpp_api_test_plugins/$file
283 for file in $(find %{_vpp_install_dir}/plugins -type f -name '*.api.json' -print )
285 install -p -m 644 $file %{buildroot}%{_datadir}/vpp/api
289 # remove RPATH from ELF binaries
291 %{_vpp_build_dir}/scripts/remove-rpath %{buildroot}
293 export NO_BRP_CHECK_RPATH=true
296 %service_add_post vpp.service
298 %post -n %{lname} -p /sbin/ldconfig
301 %service_del_preun vpp.service
304 %service_del_postun vpp.service
306 %postun -n %{lname} -p /sbin/ldconfig
309 %{_unitdir}/vpp.service
313 %dir %{_sysconfdir}/vpp
314 %config %{_sysconfdir}/sysctl.d/80-vpp.conf
315 %config %{_sysconfdir}/vpp/startup.conf
316 %{_sysconfdir}/bash_completion.d/vppctl_completion
317 %{_datadir}/vpp/vppctl-cmd-list
321 %exclude %{_libdir}/vpp_plugins
322 %exclude %{_libdir}/vpp_api_test_plugins
326 %{_datadir}/doc/vpp/examples/lua
332 %dir %{python_sitelib}/vpp_papi*
333 %{python_sitelib}/vpp_papi*
336 %dir %{python_sitelib}/jvppgen
337 %{python_sitelib}/jvppgen/*
338 %dir %{_datadir}/doc/vpp
339 %dir %{_datadir}/doc/vpp/examples
341 %{_bindir}/jvpp_gen.py
343 %{_datadir}/doc/vpp/examples/sample-plugin
345 %dir %{_datadir}/vpp/api
346 %{_datadir}/vpp/api/*
349 %dir %{_libdir}/vpp_plugins
350 %dir %{_libdir}/vpp_api_test_plugins
351 %{_libdir}/vpp_plugins/*.so*
352 %{_libdir}/vpp_api_test_plugins/*.so*