blob: 6bfb12471e274fa5c73260e8c1c476e53675d284 [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
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +030013%{?systemd_requires}
14
Billy McFall28cf3b72018-01-15 17:54:52 -050015
16# SELinux Related definitions
17%global selinuxtype targeted
18%global moduletype services
19%global modulenames vpp-custom
20
21# Usage: _format var format
22# Expand 'modulenames' into various formats as needed
23# Format must contain '$x' somewhere to do anything useful
24%global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done;
25
26# Relabel files
27%global relabel_files() \ # ADD files in *.fc file
28
29# Version of distribution SELinux policy package
30%global selinux_policyver 3.13.1-128.6.fc22
31
32
Ed Warnickecb9cada2015-12-08 15:45:58 -070033Name: vpp
34Summary: Vector Packet Processing
Billy McFallf6e3ad02017-07-05 09:33:30 -040035License: ASL 2.0
Ed Warnickecb9cada2015-12-08 15:45:58 -070036Version: %{_version}
37Release: %{_release}
Damjan Mariona1bd0232016-12-19 19:08:11 +010038BuildRequires: systemd, chrpath
Thomas F Herberte4128912017-10-09 15:03:55 -040039BuildRequires: check, check-devel
Thomas F Herbert6eb61632018-11-27 15:57:30 -050040%if 0%{?fedora}
Ian Wells13cef0c2019-08-09 17:27:19 -070041Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040042Requires: compat-openssl10
Florin Coras66d61462022-04-18 09:29:59 -070043Requires: libffi-devel
Thomas F Herbert66731782018-03-05 17:21:56 -050044BuildRequires: subunit, subunit-devel
Thomas F Herbert440751b2017-09-11 08:58:23 -040045BuildRequires: compat-openssl10-devel
Ian Wells13cef0c2019-08-09 17:27:19 -070046BuildRequires: python, python-devel, python-virtualenv, python-ply
47BuildRequires: python3, python36-devel, python3-virtualenv
Thomas F Herbert6eb61632018-11-27 15:57:30 -050048BuildRequires: cmake
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040049%else
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060050%if 0%{rhel} >= 7
Christian Svensson184a70a2023-02-06 17:25:16 +010051Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
Florin Coras66d61462022-04-18 09:29:59 -070052Requires: libffi-devel
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040053BuildRequires: epel-release
Thomas F Herbert440751b2017-09-11 08:58:23 -040054BuildREquires: openssl-devel
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060055%if 0%{rhel} == 7
Christian Svensson184a70a2023-02-06 17:25:16 +010056Requires: python36
Damjan Marion162330f2020-04-29 21:28:15 +020057BuildRequires: devtoolset-9-toolchain
Thomas F Herbert6eb61632018-11-27 15:57:30 -050058BuildRequires: cmake3
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060059BuildRequires: glibc-static, yum-utils
Christian Svensson184a70a2023-02-06 17:25:16 +010060BuildRequires: python36-devel
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060061%else
Christian Svensson184a70a2023-02-06 17:25:16 +010062%if 0%{rhel} == 8
63Requires: python36
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060064BuildRequires: cmake
65BuildRequires: dnf-utils
Christian Svensson184a70a2023-02-06 17:25:16 +010066BuildRequires: python36-devel
67%else
68Requires: python3
69BuildRequires: cmake
70BuildRequires: dnf-utils
71BuildRequires: python3-devel
72%endif
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060073%endif
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040074%endif
75%endif
Thomas F Herbert440751b2017-09-11 08:58:23 -040076BuildRequires: libffi-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040077BuildRequires: apr-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040078BuildRequires: numactl-devel
79BuildRequires: autoconf automake libtool byacc bison flex
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
Ian Wells13cef0c2019-08-09 17:27:19 -0700134%package api-python3
135Summary: VPP api python3 bindings
136Group: Development/Libraries
137Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel
Yichen Wang466872f2020-06-30 23:14:23 -0700138Requires: python3-setuptools
Ian Wells13cef0c2019-08-09 17:27:19 -0700139
140%description api-python3
141This package contains the python3 bindings for the vpp api
142
Billy McFall28cf3b72018-01-15 17:54:52 -0500143%package selinux-policy
144Summary: VPP Security-Enhanced Linux (SELinux) policy
145Group: System Environment/Base
Renato Botelho do Couto1d94ab52020-03-06 13:42:22 -0600146Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, libselinux-utils
147%if 0%{rhel} < 8
148Requires(post): policycoreutils-python
149%else
150Requires(post): python3-policycoreutils
151%endif
Billy McFall28cf3b72018-01-15 17:54:52 -0500152
153%description selinux-policy
154This package contains a tailored VPP SELinux policy
155
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400156%prep
Dave Wallace27b50fe2020-09-16 21:04:24 +0000157%setup -q -c -T -n %{name}-%{_version}
158cd ..
159unxz --stdout ./SOURCES/%{name}-%{_version}-%{_release}.tar.xz | tar --extract --touch
160cd -
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400161
Ed Warnickeec6290a2016-06-08 17:15:08 -0500162%pre
163# Add the vpp group
Ed Warnickeb10427e2016-06-08 19:49:40 -0500164groupadd -f -r vpp
Ed Warnickeec6290a2016-06-08 17:15:08 -0500165
Ole Troanc60f5572017-03-17 09:54:51 +0100166%build
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -0600167%if 0%{rhel} < 8
Damjan Marion162330f2020-04-29 21:28:15 +0200168. /opt/rh/devtoolset-9/enable
Thomas F Herbert6eb61632018-11-27 15:57:30 -0500169%endif
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400170%if %{with aesni}
Dave Wallace27b50fe2020-09-16 21:04:24 +0000171 make install-dep
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400172 make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
173%else
174 make bootstrap AESNI=n
175 make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
176%endif
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400177cd %{_mu_build_dir}/../src/vpp-api/python && %py3_build
Billy McFall28cf3b72018-01-15 17:54:52 -0500178cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
Ole Troanc60f5572017-03-17 09:54:51 +0100179
Ed Warnickecb9cada2015-12-08 15:45:58 -0700180%install
181#
182# binaries
183#
184mkdir -p -m755 %{buildroot}%{_bindir}
185mkdir -p -m755 %{buildroot}%{_unitdir}
Gabriel Ganne714968b2017-01-26 15:42:39 +0100186install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir}
Ole Troanf14e3bf2016-12-01 21:49:03 +0100187
Damjan Marion7cd468a2016-12-19 23:05:39 +0100188# api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100189mkdir -p -m755 %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100190
Ed Warnickecb9cada2015-12-08 15:45:58 -0700191#
192# configs
193#
194mkdir -p -m755 %{buildroot}/etc/vpp
Miroslav Miklus8e08e742016-10-11 13:35:26 +0200195mkdir -p -m755 %{buildroot}/etc/sysctl.d
Thomas F Herbert5b75b6b2017-07-23 17:21:46 -0400196install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
Damjan Mariond0f673e2017-01-31 17:29:33 +0100197install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf
Damjan Marion7cd468a2016-12-19 23:05:39 +0100198install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
Ed Warnickecb9cada2015-12-08 15:45:58 -0700199#
200# libraries
201#
202mkdir -p -m755 %{buildroot}%{_libdir}
Padraig Connolly69915cb2017-01-10 17:10:39 +0000203mkdir -p -m755 %{buildroot}/etc/bash_completion.d
204mkdir -p -m755 %{buildroot}/usr/share/vpp
Matthew Smithd790c7e2018-09-06 10:59:49 -0500205for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700206do
207 install -p -m 755 $file %{buildroot}%{_libdir}
208done
209for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
210do
211 # make lib symlinks
212 ( cd %{buildroot}%{_libdir} &&
213 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
Ed Warnickef5a0e732016-09-07 17:12:52 +0000214 ( cd %{buildroot}%{_libdir} &&
215 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700216done
Damjan Marion7cd468a2016-12-19 23:05:39 +0100217for 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 +0100218do
219 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
220done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700221
Damjan Marioncb034b92016-12-28 18:38:59 +0100222# Lua bindings
223mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli
224mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400225# for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
226for 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 +0100227do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400228 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \
229 %{buildroot}/usr/share/doc/vpp/examples/lua/$file )
Damjan Marioncb034b92016-12-28 18:38:59 +0100230done
231
Ole Troan57c3d662016-09-12 22:00:32 +0200232# Python bindings
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400233cd %{_mu_build_dir}/../src/vpp-api/python && %py3_install
Ole Troan57c3d662016-09-12 22:00:32 +0200234
Billy McFall28cf3b72018-01-15 17:54:52 -0500235# SELinux Policy
236# Install SELinux interfaces
237%_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if
238install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
239install -p -m 644 $INTERFACES \
240 %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
241
242# Install policy modules
243%_format MODULES %{_mu_build_dir}/../extras/selinux/$x.pp
244install -d %{buildroot}%{_datadir}/selinux/packages
245install -m 0644 $MODULES \
246 %{buildroot}%{_datadir}/selinux/packages
247
Ed Warnickecb9cada2015-12-08 15:45:58 -0700248#
249# devel
250#
Damjan Marion8c1afb52020-10-16 15:28:47 +0200251for dir in %{_mu_build_dir}/%{_vpp_install_dir}/vpp/include/
Ed Warnickecb9cada2015-12-08 15:45:58 -0700252do
253 for subdir in $(cd ${dir} && find . -type d -print)
254 do
255 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
256 done
257 for file in $(cd ${dir} && find . -type f -print)
258 do
259 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
260 done
261done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700262
Paul Vinciguerra9ce6a212018-09-12 13:40:13 -0700263install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_c.py %{buildroot}/usr/share/vpp
264install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_json.py %{buildroot}/usr/share/vpp
Jon Loeliger190282c2018-01-31 09:45:11 -0600265
Ed Warnickecb9cada2015-12-08 15:45:58 -0700266# sample plugin
267mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400268#for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .)
269for 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 -0700270do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400271 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \
272 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700273done
274
Billy McFall28cf3b72018-01-15 17:54:52 -0500275# vppctl sockfile directory
276mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp
277# vpp.log directory
278mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp
Ed Warnickef5a14362016-09-12 20:40:24 +0000279
280#
281# vpp-plugins
Damjan Marion79dcbc72018-09-12 14:01:10 +0200282#
Huawei LIabf81c32022-11-11 13:50:26 +0800283mkdir -p -m755 %{buildroot}/usr/%{_lib}/vpp_plugins
284mkdir -p -m755 %{buildroot}/usr/%{_lib}/vpp_api_test_plugins
285mkdir -p -m755 %{buildroot}/usr/%{_lib}/vat2_plugins
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800286for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins && find -type f -print)
Damjan Marion7cd468a2016-12-19 23:05:39 +0100287do
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800288 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins/$file \
Huawei LIabf81c32022-11-11 13:50:26 +0800289 %{buildroot}/usr/%{_lib}/vpp_plugins/$file
Damjan Marion7cd468a2016-12-19 23:05:39 +0100290done
291
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800292for 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 +0100293do
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800294 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_api_test_plugins/$file \
Huawei LIabf81c32022-11-11 13:50:26 +0800295 %{buildroot}/usr/%{_lib}/vpp_api_test_plugins/$file
296done
297
298for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vat2_plugins && find -type f -print)
299do
300 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vat2_plugins/$file \
301 %{buildroot}/usr/%{_lib}/vat2_plugins/$file
Damjan Marion7cd468a2016-12-19 23:05:39 +0100302done
303
Mohsin Kazmi7b2017d2018-09-26 10:49:41 +0200304for 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 +0100305do
Matthew Smith4ed00392019-03-05 09:28:48 -0600306 install -p -m 755 $file %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100307done
308
Damjan Mariona1bd0232016-12-19 19:08:11 +0100309#
310# remove RPATH from ELF binaries
311#
312%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
313
Ed Warnickecb9cada2015-12-08 15:45:58 -0700314%post
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200315if [ $1 -eq 1 ] ; then
316 sysctl --system
317fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700318%systemd_post vpp.service
319
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300320%preun
321%systemd_preun vpp.service
322
Billy McFall28cf3b72018-01-15 17:54:52 -0500323%post selinux-policy
324%_format MODULES %{_datadir}/selinux/packages/$x.pp
Billy McFall28cf3b72018-01-15 17:54:52 -0500325if %{_sbindir}/selinuxenabled ; then
Matthew Smith7c172cb2018-02-22 21:12:11 -0600326 %{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES
Billy McFall28cf3b72018-01-15 17:54:52 -0500327 %{_sbindir}/load_policy
328 %relabel_files
329fi
330
331
Ed Warnickecb9cada2015-12-08 15:45:58 -0700332%postun
Christian Svensson184a70a2023-02-06 17:25:16 +0100333%systemd_postun vpp.service
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200334if [ $1 -eq 0 ] ; then
335 echo "Uninstalling, unbind user-mode PCI drivers"
336 # Unbind user-mode PCI drivers
337 removed=
338 pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
339 for d in $pci_dirs; do
340 for f in ${d}/*; do
341 [ -e "${f}/config" ] || continue
342 echo ${f##*/} > ${d}/unbind
343 basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
344 removed=y
345 done
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300346 done
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200347 if [ -n "${removed}" ]; then
348 echo "There are changes in PCI drivers, rescaning"
349 echo 1 > /sys/bus/pci/rescan
350 else
351 echo "There weren't PCI devices binded"
352 fi
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300353else
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200354 echo "Upgrading package, dont' unbind interfaces"
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300355fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700356
Billy McFall28cf3b72018-01-15 17:54:52 -0500357%postun selinux-policy
358if [ $1 -eq 0 ]; then
359 %{_sbindir}/semodule -n -r %{modulenames}
360 if %{_sbindir}/selinuxenabled ; then
361 %{_sbindir}/load_policy
362 %relabel_files
363 fi
364fi
365
Ed Warnickecb9cada2015-12-08 15:45:58 -0700366%files
367%defattr(-,bin,bin)
368%{_unitdir}/vpp.service
Matthew Smith48a13f32021-08-19 15:47:06 -0500369/usr/bin/vat2
Damjan Marion08ff7e02016-01-20 13:45:36 +0100370/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700371/usr/bin/svm*
Billy McFallce41a5c2017-09-08 20:11:58 +0000372%config(noreplace) /etc/sysctl.d/80-vpp.conf
373%config(noreplace) /etc/vpp/startup.conf
Ole Troanf14e3bf2016-12-01 21:49:03 +0100374/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700375
Billy McFall28cf3b72018-01-15 17:54:52 -0500376%defattr(-,root,vpp)
377%{_localstatedir}/run/vpp*
378
379%defattr(-,root,root)
380%{_localstatedir}/log/vpp*
381
Ed Warnickecb9cada2015-12-08 15:45:58 -0700382%files lib
383%defattr(-,bin,bin)
Igor Mikhailov (imichail)3b854a52018-05-18 20:08:26 -0700384%global __requires_exclude_from %{_libdir}/librte_pmd_mlx[45]_glue\\.so.*$
Ed Warnickef5a14362016-09-12 20:40:24 +0000385%exclude %{_libdir}/vpp_plugins
386%exclude %{_libdir}/vpp_api_test_plugins
Huawei LIabf81c32022-11-11 13:50:26 +0800387%exclude %{_libdir}/vat2_plugins
Ed Warnickecb9cada2015-12-08 15:45:58 -0700388%{_libdir}/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100389/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700390
Damjan Marioncb034b92016-12-28 18:38:59 +0100391%files api-lua
Gabriel Gannef3854e92017-01-17 10:00:54 +0100392%defattr(644,root,root,644)
Damjan Marioncb034b92016-12-28 18:38:59 +0100393/usr/share/doc/vpp/examples/lua
394
Ian Wells13cef0c2019-08-09 17:27:19 -0700395%files api-python3
396%defattr(644,root,root,755)
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400397%{python3_sitelib}/vpp_*
Ole Troan57c3d662016-09-12 22:00:32 +0200398
Billy McFall28cf3b72018-01-15 17:54:52 -0500399%files selinux-policy
400%defattr(-,root,root,0755)
401%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
402%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
403
Ed Warnickecb9cada2015-12-08 15:45:58 -0700404%files devel
405%defattr(-,bin,bin)
406/usr/bin/vppapigen
Oliver Gilesdc203712019-12-05 23:37:36 +0200407/usr/bin/vapi_c_gen.py
408/usr/bin/vapi_cpp_gen.py
409/usr/bin/vapi_json_parser.py
Ed Warnickecb9cada2015-12-08 15:45:58 -0700410%{_includedir}/*
411/usr/share/doc/vpp/examples/sample-plugin
Ole Troan9d420872017-10-12 13:06:35 +0200412/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700413
Ed Warnickef5a14362016-09-12 20:40:24 +0000414%files plugins
415%defattr(-,bin,bin)
Huawei LIabf81c32022-11-11 13:50:26 +0800416/usr/%{_lib}/vpp_plugins/*
417/usr/%{_lib}/vpp_api_test_plugins/*
418/usr/%{_lib}/vat2_plugins/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100419/usr/share/vpp/api/*