blob: cb847f2f42759e4531d2f72677b3469e40e9b598 [file] [log] [blame]
Thomas F Herbert4b0ac822017-08-29 16:07:51 -04001%bcond_without aesni
Renato Botelho do Coutoe266ea32017-11-30 15:41:22 -06002%{!?_topdir:%define _topdir %(pwd)}
Thomas F Herbert20a29c72016-10-13 18:36:50 -04003%define _vpp_build_dir build-tool-native
Ed Warnickecb9cada2015-12-08 15:45:58 -07004%define _unitdir /lib/systemd/system
Ed Warnickecb9cada2015-12-08 15:45:58 -07005%define _builddir %{_topdir}
Thomas F Herbertb42b77b2018-04-06 15:13:41 -04006%define _mu_build_dir %{_topdir}/%{name}-%{_version}/build-root
Igor Mikhailov (imichail)c442e612017-05-18 19:46:17 -07007%define _vpp_tag %{getenv:TAG}
8%if "%{_vpp_tag}" == ""
9%define _vpp_tag vpp
10%endif
11%define _vpp_install_dir install-%{_vpp_tag}-native
Ed Warnickecb9cada2015-12-08 15:45:58 -070012
Ian Wells13cef0c2019-08-09 17:27:19 -070013# Failsafe backport of Python2-macros for RHEL <= 6
14%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
15%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
16%{!?python_version: %global python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
17%{!?__python2: %global __python2 %{__python}}
18%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
19%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}}
20%{!?python2_version: %global python2_version %{python_version}}
21
22%{!?python2_minor_version: %define python2_minor_version %(%{__python} -c "import sys ; print sys.version[2:3]")}
23
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +030024%{?systemd_requires}
25
Billy McFall28cf3b72018-01-15 17:54:52 -050026
27# SELinux Related definitions
28%global selinuxtype targeted
29%global moduletype services
30%global modulenames vpp-custom
31
32# Usage: _format var format
33# Expand 'modulenames' into various formats as needed
34# Format must contain '$x' somewhere to do anything useful
35%global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done;
36
37# Relabel files
38%global relabel_files() \ # ADD files in *.fc file
39
40# Version of distribution SELinux policy package
41%global selinux_policyver 3.13.1-128.6.fc22
42
43
Ed Warnickecb9cada2015-12-08 15:45:58 -070044Name: vpp
45Summary: Vector Packet Processing
Billy McFallf6e3ad02017-07-05 09:33:30 -040046License: ASL 2.0
Ed Warnickecb9cada2015-12-08 15:45:58 -070047Version: %{_version}
48Release: %{_release}
Damjan Mariona1bd0232016-12-19 19:08:11 +010049BuildRequires: systemd, chrpath
Thomas F Herberte4128912017-10-09 15:03:55 -040050BuildRequires: check, check-devel
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040051BuildRequires: mbedtls-devel mbedtls
Thomas F Herbert6eb61632018-11-27 15:57:30 -050052%if 0%{?fedora}
Ian Wells13cef0c2019-08-09 17:27:19 -070053Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040054Requires: compat-openssl10
55Requires: boost-filesystem mbedtls libffi-devel
Thomas F Herbert66731782018-03-05 17:21:56 -050056BuildRequires: subunit, subunit-devel
Thomas F Herbert440751b2017-09-11 08:58:23 -040057BuildRequires: compat-openssl10-devel
Ian Wells13cef0c2019-08-09 17:27:19 -070058BuildRequires: python, python-devel, python-virtualenv, python-ply
59BuildRequires: python3, python36-devel, python3-virtualenv
Thomas F Herbert6eb61632018-11-27 15:57:30 -050060BuildRequires: cmake
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040061%else
Thomas F Herbert6eb61632018-11-27 15:57:30 -050062%if 0%{rhel} == 7
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040063Requires: epel-release
64Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python36
65Requires: boost-filesystem mbedtls libffi-devel
66BuildRequires: epel-release
67BuildRequires: mbedtls-devel mbedtls
Thomas F Herbert6eb61632018-11-27 15:57:30 -050068BuildRequires: devtoolset-7-toolchain
Thomas F Herbert440751b2017-09-11 08:58:23 -040069BuildREquires: openssl-devel
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040070BuildRequires: python36-devel
Thomas F Herbert6eb61632018-11-27 15:57:30 -050071BuildRequires: cmake3
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040072%endif
73%endif
Thomas F Herbert440751b2017-09-11 08:58:23 -040074BuildRequires: libffi-devel
Michal Cmarada4e633e12019-01-31 10:57:40 +010075BuildRequires: glibc-static, yum-utils, redhat-lsb
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040076BuildRequires: apr-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040077BuildRequires: numactl-devel
78BuildRequires: autoconf automake libtool byacc bison flex
Neale Ranns2ea2e422017-11-07 05:20:16 -080079BuildRequires: boost boost-devel
Billy McFall28cf3b72018-01-15 17:54:52 -050080BuildRequires: selinux-policy selinux-policy-devel
Ed Warnickecb9cada2015-12-08 15:45:58 -070081
Thomas F Herbertb60f4962017-07-19 19:17:15 -040082Source: %{name}-%{_version}-%{_release}.tar.xz
83# Source: vpp-latest.tar.xz
Thomas F Herbert20a29c72016-10-13 18:36:50 -040084
Ed Warnickecb9cada2015-12-08 15:45:58 -070085%description
Damjan Marion08ff7e02016-01-20 13:45:36 +010086This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
87vpp - the vector packet engine
88vpp_api_test - vector packet engine API test tool
89vpp_json_test - vector packet engine JSON test tool
Ed Warnickecb9cada2015-12-08 15:45:58 -070090
91%package lib
92Summary: VPP libraries
93Group: System Environment/Libraries
Billy McFall28cf3b72018-01-15 17:54:52 -050094Requires: vpp-selinux-policy = %{_version}-%{_release}
Ed Warnickecb9cada2015-12-08 15:45:58 -070095
96%description lib
97This package contains the VPP shared libraries, including:
98vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
Ed Warnickecb9cada2015-12-08 15:45:58 -070099svm - vm library
100vlib - vector processing library
101vlib-api - binary API library
102vnet - network stack library
103
104%package devel
105Summary: VPP header files, static libraries
106Group: Development/Libraries
107Requires: vpp-lib
108
109%description devel
Thomas F Herbert3977a212016-10-01 18:09:33 -0400110This package contains the header files for VPP.
111Install this package if you want to write a
112program for compilation and linking with vpp lib.
113vlib
114vlibmemory
115vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
116vpp-api
117vppinfra
Ed Warnickecb9cada2015-12-08 15:45:58 -0700118
Ed Warnickef5a14362016-09-12 20:40:24 +0000119%package plugins
120Summary: Vector Packet Processing--runtime plugins
121Group: System Environment/Libraries
Gabriel Gannebf246df2018-01-18 11:00:17 +0100122Requires: vpp = %{_version}-%{_release} numactl-libs
Ed Warnickef5a14362016-09-12 20:40:24 +0000123%description plugins
124This package contains VPP plugins
125
Damjan Marioncb034b92016-12-28 18:38:59 +0100126%package api-lua
127Summary: VPP api lua bindings
128Group: Development/Libraries
129Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
130
131%description api-lua
132This package contains the lua bindings for the vpp api
133
Damjan Marioncb034b92016-12-28 18:38:59 +0100134%package api-python
Ole Troan57c3d662016-09-12 22:00:32 +0200135Summary: VPP api python bindings
136Group: Development/Libraries
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400137Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel
138Requires: python-setuptools
Ole Troan57c3d662016-09-12 22:00:32 +0200139
Damjan Marioncb034b92016-12-28 18:38:59 +0100140%description api-python
Ole Troan57c3d662016-09-12 22:00:32 +0200141This package contains the python bindings for the vpp api
142
Ian Wells13cef0c2019-08-09 17:27:19 -0700143%package api-python3
144Summary: VPP api python3 bindings
145Group: Development/Libraries
146Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel
147Requires: python-setuptools
148
149%description api-python3
150This package contains the python3 bindings for the vpp api
151
Billy McFall28cf3b72018-01-15 17:54:52 -0500152%package selinux-policy
153Summary: VPP Security-Enhanced Linux (SELinux) policy
154Group: System Environment/Base
155Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, policycoreutils-python libselinux-utils
156
157%description selinux-policy
158This package contains a tailored VPP SELinux policy
159
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400160%prep
Thomas F Herbertb42b77b2018-04-06 15:13:41 -0400161%setup -q -n %{name}-%{_version}
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400162
Ed Warnickeec6290a2016-06-08 17:15:08 -0500163%pre
164# Add the vpp group
Ed Warnickeb10427e2016-06-08 19:49:40 -0500165groupadd -f -r vpp
Ed Warnickeec6290a2016-06-08 17:15:08 -0500166
Ole Troanc60f5572017-03-17 09:54:51 +0100167%build
Thomas F Herbert6eb61632018-11-27 15:57:30 -0500168%if 0%{?rhel}
169. /opt/rh/devtoolset-7/enable
170%endif
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400171%if %{with aesni}
172 make bootstrap
173 make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
174%else
175 make bootstrap AESNI=n
176 make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
177%endif
Ian Wells13cef0c2019-08-09 17:27:19 -0700178cd %{_mu_build_dir}/../src/vpp-api/python && %py2_build
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400179cd %{_mu_build_dir}/../src/vpp-api/python && %py3_build
Billy McFall28cf3b72018-01-15 17:54:52 -0500180cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
Ole Troanc60f5572017-03-17 09:54:51 +0100181
Ed Warnickecb9cada2015-12-08 15:45:58 -0700182%install
183#
184# binaries
185#
186mkdir -p -m755 %{buildroot}%{_bindir}
187mkdir -p -m755 %{buildroot}%{_unitdir}
Gabriel Ganne714968b2017-01-26 15:42:39 +0100188install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir}
Ole Troanf14e3bf2016-12-01 21:49:03 +0100189
Damjan Marion7cd468a2016-12-19 23:05:39 +0100190# api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100191mkdir -p -m755 %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100192
Ed Warnickecb9cada2015-12-08 15:45:58 -0700193#
194# configs
195#
196mkdir -p -m755 %{buildroot}/etc/vpp
Miroslav Miklus8e08e742016-10-11 13:35:26 +0200197mkdir -p -m755 %{buildroot}/etc/sysctl.d
Thomas F Herbert5b75b6b2017-07-23 17:21:46 -0400198install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
Damjan Mariond0f673e2017-01-31 17:29:33 +0100199install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf
Damjan Marion7cd468a2016-12-19 23:05:39 +0100200install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
Ed Warnickecb9cada2015-12-08 15:45:58 -0700201#
202# libraries
203#
204mkdir -p -m755 %{buildroot}%{_libdir}
Padraig Connolly69915cb2017-01-10 17:10:39 +0000205mkdir -p -m755 %{buildroot}/etc/bash_completion.d
206mkdir -p -m755 %{buildroot}/usr/share/vpp
Matthew Smithd790c7e2018-09-06 10:59:49 -0500207for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700208do
209 install -p -m 755 $file %{buildroot}%{_libdir}
210done
211for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
212do
213 # make lib symlinks
214 ( cd %{buildroot}%{_libdir} &&
215 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
Ed Warnickef5a0e732016-09-07 17:12:52 +0000216 ( cd %{buildroot}%{_libdir} &&
217 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700218done
Damjan Marion7cd468a2016-12-19 23:05:39 +0100219for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/vpp/api -type f -name '*.api.json' -print )
Ole Troanf14e3bf2016-12-01 21:49:03 +0100220do
221 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
222done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700223
Damjan Marioncb034b92016-12-28 18:38:59 +0100224# Lua bindings
225mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli
226mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400227# for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
228for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && find . -type f -regex '.*/*.[luteamd]' -print | sed -e 's/^\.\///')
Damjan Marioncb034b92016-12-28 18:38:59 +0100229do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400230 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \
231 %{buildroot}/usr/share/doc/vpp/examples/lua/$file )
Damjan Marioncb034b92016-12-28 18:38:59 +0100232done
233
Ole Troan57c3d662016-09-12 22:00:32 +0200234# Python bindings
Ian Wells13cef0c2019-08-09 17:27:19 -0700235cd %{_mu_build_dir}/../src/vpp-api/python && %py2_install
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400236cd %{_mu_build_dir}/../src/vpp-api/python && %py3_install
Ole Troan57c3d662016-09-12 22:00:32 +0200237
Billy McFall28cf3b72018-01-15 17:54:52 -0500238# SELinux Policy
239# Install SELinux interfaces
240%_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if
241install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
242install -p -m 644 $INTERFACES \
243 %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
244
245# Install policy modules
246%_format MODULES %{_mu_build_dir}/../extras/selinux/$x.pp
247install -d %{buildroot}%{_datadir}/selinux/packages
248install -m 0644 $MODULES \
249 %{buildroot}%{_datadir}/selinux/packages
250
Ed Warnickecb9cada2015-12-08 15:45:58 -0700251#
252# devel
253#
Benoît Gannef0917bd2019-05-14 11:11:16 +0200254for dir in %{_mu_build_dir}/%{_vpp_install_dir}/{vom,vpp}/include/
Ed Warnickecb9cada2015-12-08 15:45:58 -0700255do
256 for subdir in $(cd ${dir} && find . -type d -print)
257 do
258 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
259 done
260 for file in $(cd ${dir} && find . -type f -print)
261 do
262 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
263 done
264done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700265
Paul Vinciguerra9ce6a212018-09-12 13:40:13 -0700266install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_c.py %{buildroot}/usr/share/vpp
267install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_json.py %{buildroot}/usr/share/vpp
Jon Loeliger190282c2018-01-31 09:45:11 -0600268
Ed Warnickecb9cada2015-12-08 15:45:58 -0700269# sample plugin
270mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400271#for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .)
272for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && find . -type f -regex '.*/*.[acdhimp]' -print | sed -e 's/^\.\///')
Ed Warnickecb9cada2015-12-08 15:45:58 -0700273do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400274 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \
275 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700276done
277
Billy McFall28cf3b72018-01-15 17:54:52 -0500278# vppctl sockfile directory
279mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp
280# vpp.log directory
281mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp
Ed Warnickef5a14362016-09-12 20:40:24 +0000282
283#
284# vpp-plugins
Damjan Marion79dcbc72018-09-12 14:01:10 +0200285#
Ed Warnickee7637e72016-09-14 16:58:33 -0700286mkdir -p -m755 %{buildroot}/usr/lib/vpp_plugins
287mkdir -p -m755 %{buildroot}/usr/lib/vpp_api_test_plugins
Damjan Marion79dcbc72018-09-12 14:01:10 +0200288for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib/vpp_plugins && find -type f -print)
Damjan Marion7cd468a2016-12-19 23:05:39 +0100289do
Matthew Smith4ed00392019-03-05 09:28:48 -0600290 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib/vpp_plugins/$file \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100291 %{buildroot}/usr/lib/vpp_plugins/$file
292done
293
Damjan Marion79dcbc72018-09-12 14:01:10 +0200294for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib/vpp_api_test_plugins && find -type f -print)
Damjan Marion7cd468a2016-12-19 23:05:39 +0100295do
Matthew Smith4ed00392019-03-05 09:28:48 -0600296 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib/vpp_api_test_plugins/$file \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100297 %{buildroot}/usr/lib/vpp_api_test_plugins/$file
298done
299
Mohsin Kazmi7b2017d2018-09-26 10:49:41 +0200300for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/vpp/api/plugins -type f -name '*.api.json' -print )
Ole Troanf14e3bf2016-12-01 21:49:03 +0100301do
Matthew Smith4ed00392019-03-05 09:28:48 -0600302 install -p -m 755 $file %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100303done
304
Damjan Mariona1bd0232016-12-19 19:08:11 +0100305#
306# remove RPATH from ELF binaries
307#
308%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
309
Ed Warnickecb9cada2015-12-08 15:45:58 -0700310%post
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200311if [ $1 -eq 1 ] ; then
312 sysctl --system
313fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700314%systemd_post vpp.service
315
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300316%preun
317%systemd_preun vpp.service
318
Billy McFall28cf3b72018-01-15 17:54:52 -0500319%post selinux-policy
320%_format MODULES %{_datadir}/selinux/packages/$x.pp
Billy McFall28cf3b72018-01-15 17:54:52 -0500321if %{_sbindir}/selinuxenabled ; then
Matthew Smith7c172cb2018-02-22 21:12:11 -0600322 %{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES
Billy McFall28cf3b72018-01-15 17:54:52 -0500323 %{_sbindir}/load_policy
324 %relabel_files
325fi
326
327
Ed Warnickecb9cada2015-12-08 15:45:58 -0700328%postun
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300329%systemd_postun
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200330if [ $1 -eq 0 ] ; then
331 echo "Uninstalling, unbind user-mode PCI drivers"
332 # Unbind user-mode PCI drivers
333 removed=
334 pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
335 for d in $pci_dirs; do
336 for f in ${d}/*; do
337 [ -e "${f}/config" ] || continue
338 echo ${f##*/} > ${d}/unbind
339 basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
340 removed=y
341 done
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300342 done
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200343 if [ -n "${removed}" ]; then
344 echo "There are changes in PCI drivers, rescaning"
345 echo 1 > /sys/bus/pci/rescan
346 else
347 echo "There weren't PCI devices binded"
348 fi
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300349else
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200350 echo "Upgrading package, dont' unbind interfaces"
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300351fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700352
Billy McFall28cf3b72018-01-15 17:54:52 -0500353%postun selinux-policy
354if [ $1 -eq 0 ]; then
355 %{_sbindir}/semodule -n -r %{modulenames}
356 if %{_sbindir}/selinuxenabled ; then
357 %{_sbindir}/load_policy
358 %relabel_files
359 fi
360fi
361
Ed Warnickecb9cada2015-12-08 15:45:58 -0700362%files
363%defattr(-,bin,bin)
364%{_unitdir}/vpp.service
Damjan Marion08ff7e02016-01-20 13:45:36 +0100365/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700366/usr/bin/svm*
Dave Barach0e5e3c32016-01-25 08:28:22 -0500367/usr/bin/elftool
Billy McFallce41a5c2017-09-08 20:11:58 +0000368%config(noreplace) /etc/sysctl.d/80-vpp.conf
369%config(noreplace) /etc/vpp/startup.conf
Ole Troanf14e3bf2016-12-01 21:49:03 +0100370/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700371
Billy McFall28cf3b72018-01-15 17:54:52 -0500372%defattr(-,root,vpp)
373%{_localstatedir}/run/vpp*
374
375%defattr(-,root,root)
376%{_localstatedir}/log/vpp*
377
Ed Warnickecb9cada2015-12-08 15:45:58 -0700378%files lib
379%defattr(-,bin,bin)
Igor Mikhailov (imichail)3b854a52018-05-18 20:08:26 -0700380%global __requires_exclude_from %{_libdir}/librte_pmd_mlx[45]_glue\\.so.*$
Ed Warnickef5a14362016-09-12 20:40:24 +0000381%exclude %{_libdir}/vpp_plugins
382%exclude %{_libdir}/vpp_api_test_plugins
Ed Warnickecb9cada2015-12-08 15:45:58 -0700383%{_libdir}/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100384/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700385
Damjan Marioncb034b92016-12-28 18:38:59 +0100386%files api-lua
Gabriel Gannef3854e92017-01-17 10:00:54 +0100387%defattr(644,root,root,644)
Damjan Marioncb034b92016-12-28 18:38:59 +0100388/usr/share/doc/vpp/examples/lua
389
Damjan Marioncb034b92016-12-28 18:38:59 +0100390%files api-python
Onong Tayeng9b0ce022018-11-23 15:33:41 +0530391%defattr(644,root,root,755)
Ian Wells13cef0c2019-08-09 17:27:19 -0700392%{python2_sitelib}/vpp_*
393
394%files api-python3
395%defattr(644,root,root,755)
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400396%{python3_sitelib}/vpp_*
Ole Troan57c3d662016-09-12 22:00:32 +0200397
Billy McFall28cf3b72018-01-15 17:54:52 -0500398%files selinux-policy
399%defattr(-,root,root,0755)
400%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
401%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
402
Ed Warnickecb9cada2015-12-08 15:45:58 -0700403%files devel
404%defattr(-,bin,bin)
405/usr/bin/vppapigen
406%{_includedir}/*
407/usr/share/doc/vpp/examples/sample-plugin
Ole Troan9d420872017-10-12 13:06:35 +0200408/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700409
Ed Warnickef5a14362016-09-12 20:40:24 +0000410%files plugins
411%defattr(-,bin,bin)
Ed Warnickee7637e72016-09-14 16:58:33 -0700412/usr/lib/vpp_plugins/*
413/usr/lib/vpp_api_test_plugins/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100414/usr/share/vpp/api/*