blob: 2bd16ca9e253615d116d235127ebe91bcf0d3ec6 [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
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040051Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python36
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
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040055BuildRequires: python36-devel
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060056%if 0%{rhel} == 7
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
60%else
61BuildRequires: cmake
62BuildRequires: dnf-utils
63%endif
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040064%endif
65%endif
Thomas F Herbert440751b2017-09-11 08:58:23 -040066BuildRequires: libffi-devel
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060067BuildRequires: redhat-lsb
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040068BuildRequires: apr-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040069BuildRequires: numactl-devel
70BuildRequires: autoconf automake libtool byacc bison flex
Billy McFall28cf3b72018-01-15 17:54:52 -050071BuildRequires: selinux-policy selinux-policy-devel
Ed Warnickecb9cada2015-12-08 15:45:58 -070072
Thomas F Herbertb60f4962017-07-19 19:17:15 -040073Source: %{name}-%{_version}-%{_release}.tar.xz
74# Source: vpp-latest.tar.xz
Thomas F Herbert20a29c72016-10-13 18:36:50 -040075
Ed Warnickecb9cada2015-12-08 15:45:58 -070076%description
Damjan Marion08ff7e02016-01-20 13:45:36 +010077This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
78vpp - the vector packet engine
79vpp_api_test - vector packet engine API test tool
80vpp_json_test - vector packet engine JSON test tool
Ed Warnickecb9cada2015-12-08 15:45:58 -070081
82%package lib
83Summary: VPP libraries
84Group: System Environment/Libraries
Billy McFall28cf3b72018-01-15 17:54:52 -050085Requires: vpp-selinux-policy = %{_version}-%{_release}
Ed Warnickecb9cada2015-12-08 15:45:58 -070086
87%description lib
88This package contains the VPP shared libraries, including:
89vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
Ed Warnickecb9cada2015-12-08 15:45:58 -070090svm - vm library
91vlib - vector processing library
92vlib-api - binary API library
93vnet - network stack library
94
95%package devel
96Summary: VPP header files, static libraries
97Group: Development/Libraries
98Requires: vpp-lib
99
100%description devel
Thomas F Herbert3977a212016-10-01 18:09:33 -0400101This package contains the header files for VPP.
102Install this package if you want to write a
103program for compilation and linking with vpp lib.
104vlib
105vlibmemory
106vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
107vpp-api
108vppinfra
Ed Warnickecb9cada2015-12-08 15:45:58 -0700109
Ed Warnickef5a14362016-09-12 20:40:24 +0000110%package plugins
111Summary: Vector Packet Processing--runtime plugins
112Group: System Environment/Libraries
Gabriel Gannebf246df2018-01-18 11:00:17 +0100113Requires: vpp = %{_version}-%{_release} numactl-libs
Ed Warnickef5a14362016-09-12 20:40:24 +0000114%description plugins
115This package contains VPP plugins
116
Damjan Marioncb034b92016-12-28 18:38:59 +0100117%package api-lua
118Summary: VPP api lua bindings
119Group: Development/Libraries
120Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
121
122%description api-lua
123This package contains the lua bindings for the vpp api
124
Ian Wells13cef0c2019-08-09 17:27:19 -0700125%package api-python3
126Summary: VPP api python3 bindings
127Group: Development/Libraries
128Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel
Yichen Wang466872f2020-06-30 23:14:23 -0700129Requires: python3-setuptools
Ian Wells13cef0c2019-08-09 17:27:19 -0700130
131%description api-python3
132This package contains the python3 bindings for the vpp api
133
Billy McFall28cf3b72018-01-15 17:54:52 -0500134%package selinux-policy
135Summary: VPP Security-Enhanced Linux (SELinux) policy
136Group: System Environment/Base
Renato Botelho do Couto1d94ab52020-03-06 13:42:22 -0600137Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, libselinux-utils
138%if 0%{rhel} < 8
139Requires(post): policycoreutils-python
140%else
141Requires(post): python3-policycoreutils
142%endif
Billy McFall28cf3b72018-01-15 17:54:52 -0500143
144%description selinux-policy
145This package contains a tailored VPP SELinux policy
146
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400147%prep
Dave Wallace27b50fe2020-09-16 21:04:24 +0000148%setup -q -c -T -n %{name}-%{_version}
149cd ..
150unxz --stdout ./SOURCES/%{name}-%{_version}-%{_release}.tar.xz | tar --extract --touch
151cd -
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400152
Ed Warnickeec6290a2016-06-08 17:15:08 -0500153%pre
154# Add the vpp group
Ed Warnickeb10427e2016-06-08 19:49:40 -0500155groupadd -f -r vpp
Ed Warnickeec6290a2016-06-08 17:15:08 -0500156
Ole Troanc60f5572017-03-17 09:54:51 +0100157%build
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -0600158%if 0%{rhel} < 8
Damjan Marion162330f2020-04-29 21:28:15 +0200159. /opt/rh/devtoolset-9/enable
Thomas F Herbert6eb61632018-11-27 15:57:30 -0500160%endif
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400161%if %{with aesni}
Dave Wallace27b50fe2020-09-16 21:04:24 +0000162 make install-dep
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400163 make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
164%else
165 make bootstrap AESNI=n
166 make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
167%endif
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400168cd %{_mu_build_dir}/../src/vpp-api/python && %py3_build
Billy McFall28cf3b72018-01-15 17:54:52 -0500169cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
Ole Troanc60f5572017-03-17 09:54:51 +0100170
Ed Warnickecb9cada2015-12-08 15:45:58 -0700171%install
172#
173# binaries
174#
175mkdir -p -m755 %{buildroot}%{_bindir}
176mkdir -p -m755 %{buildroot}%{_unitdir}
Gabriel Ganne714968b2017-01-26 15:42:39 +0100177install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir}
Ole Troanf14e3bf2016-12-01 21:49:03 +0100178
Damjan Marion7cd468a2016-12-19 23:05:39 +0100179# api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100180mkdir -p -m755 %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100181
Ed Warnickecb9cada2015-12-08 15:45:58 -0700182#
183# configs
184#
185mkdir -p -m755 %{buildroot}/etc/vpp
Miroslav Miklus8e08e742016-10-11 13:35:26 +0200186mkdir -p -m755 %{buildroot}/etc/sysctl.d
Thomas F Herbert5b75b6b2017-07-23 17:21:46 -0400187install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
Damjan Mariond0f673e2017-01-31 17:29:33 +0100188install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf
Damjan Marion7cd468a2016-12-19 23:05:39 +0100189install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
Ed Warnickecb9cada2015-12-08 15:45:58 -0700190#
191# libraries
192#
193mkdir -p -m755 %{buildroot}%{_libdir}
Padraig Connolly69915cb2017-01-10 17:10:39 +0000194mkdir -p -m755 %{buildroot}/etc/bash_completion.d
195mkdir -p -m755 %{buildroot}/usr/share/vpp
Matthew Smithd790c7e2018-09-06 10:59:49 -0500196for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700197do
198 install -p -m 755 $file %{buildroot}%{_libdir}
199done
200for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
201do
202 # make lib symlinks
203 ( cd %{buildroot}%{_libdir} &&
204 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
Ed Warnickef5a0e732016-09-07 17:12:52 +0000205 ( cd %{buildroot}%{_libdir} &&
206 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700207done
Damjan Marion7cd468a2016-12-19 23:05:39 +0100208for 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 +0100209do
210 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
211done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700212
Damjan Marioncb034b92016-12-28 18:38:59 +0100213# Lua bindings
214mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli
215mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400216# for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
217for 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 +0100218do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400219 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \
220 %{buildroot}/usr/share/doc/vpp/examples/lua/$file )
Damjan Marioncb034b92016-12-28 18:38:59 +0100221done
222
Ole Troan57c3d662016-09-12 22:00:32 +0200223# Python bindings
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400224cd %{_mu_build_dir}/../src/vpp-api/python && %py3_install
Ole Troan57c3d662016-09-12 22:00:32 +0200225
Billy McFall28cf3b72018-01-15 17:54:52 -0500226# SELinux Policy
227# Install SELinux interfaces
228%_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if
229install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
230install -p -m 644 $INTERFACES \
231 %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
232
233# Install policy modules
234%_format MODULES %{_mu_build_dir}/../extras/selinux/$x.pp
235install -d %{buildroot}%{_datadir}/selinux/packages
236install -m 0644 $MODULES \
237 %{buildroot}%{_datadir}/selinux/packages
238
Ed Warnickecb9cada2015-12-08 15:45:58 -0700239#
240# devel
241#
Damjan Marion8c1afb52020-10-16 15:28:47 +0200242for dir in %{_mu_build_dir}/%{_vpp_install_dir}/vpp/include/
Ed Warnickecb9cada2015-12-08 15:45:58 -0700243do
244 for subdir in $(cd ${dir} && find . -type d -print)
245 do
246 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
247 done
248 for file in $(cd ${dir} && find . -type f -print)
249 do
250 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
251 done
252done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700253
Paul Vinciguerra9ce6a212018-09-12 13:40:13 -0700254install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_c.py %{buildroot}/usr/share/vpp
255install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_json.py %{buildroot}/usr/share/vpp
Jon Loeliger190282c2018-01-31 09:45:11 -0600256
Ed Warnickecb9cada2015-12-08 15:45:58 -0700257# sample plugin
258mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400259#for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .)
260for 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 -0700261do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400262 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \
263 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700264done
265
Billy McFall28cf3b72018-01-15 17:54:52 -0500266# vppctl sockfile directory
267mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp
268# vpp.log directory
269mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp
Ed Warnickef5a14362016-09-12 20:40:24 +0000270
271#
272# vpp-plugins
Damjan Marion79dcbc72018-09-12 14:01:10 +0200273#
Huawei LIabf81c32022-11-11 13:50:26 +0800274mkdir -p -m755 %{buildroot}/usr/%{_lib}/vpp_plugins
275mkdir -p -m755 %{buildroot}/usr/%{_lib}/vpp_api_test_plugins
276mkdir -p -m755 %{buildroot}/usr/%{_lib}/vat2_plugins
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800277for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins && find -type f -print)
Damjan Marion7cd468a2016-12-19 23:05:39 +0100278do
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800279 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins/$file \
Huawei LIabf81c32022-11-11 13:50:26 +0800280 %{buildroot}/usr/%{_lib}/vpp_plugins/$file
Damjan Marion7cd468a2016-12-19 23:05:39 +0100281done
282
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800283for 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 +0100284do
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800285 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_api_test_plugins/$file \
Huawei LIabf81c32022-11-11 13:50:26 +0800286 %{buildroot}/usr/%{_lib}/vpp_api_test_plugins/$file
287done
288
289for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vat2_plugins && find -type f -print)
290do
291 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vat2_plugins/$file \
292 %{buildroot}/usr/%{_lib}/vat2_plugins/$file
Damjan Marion7cd468a2016-12-19 23:05:39 +0100293done
294
Mohsin Kazmi7b2017d2018-09-26 10:49:41 +0200295for 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 +0100296do
Matthew Smith4ed00392019-03-05 09:28:48 -0600297 install -p -m 755 $file %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100298done
299
Damjan Mariona1bd0232016-12-19 19:08:11 +0100300#
301# remove RPATH from ELF binaries
302#
303%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
304
Ed Warnickecb9cada2015-12-08 15:45:58 -0700305%post
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200306if [ $1 -eq 1 ] ; then
307 sysctl --system
308fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700309%systemd_post vpp.service
310
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300311%preun
312%systemd_preun vpp.service
313
Billy McFall28cf3b72018-01-15 17:54:52 -0500314%post selinux-policy
315%_format MODULES %{_datadir}/selinux/packages/$x.pp
Billy McFall28cf3b72018-01-15 17:54:52 -0500316if %{_sbindir}/selinuxenabled ; then
Matthew Smith7c172cb2018-02-22 21:12:11 -0600317 %{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES
Billy McFall28cf3b72018-01-15 17:54:52 -0500318 %{_sbindir}/load_policy
319 %relabel_files
320fi
321
322
Ed Warnickecb9cada2015-12-08 15:45:58 -0700323%postun
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300324%systemd_postun
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200325if [ $1 -eq 0 ] ; then
326 echo "Uninstalling, unbind user-mode PCI drivers"
327 # Unbind user-mode PCI drivers
328 removed=
329 pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
330 for d in $pci_dirs; do
331 for f in ${d}/*; do
332 [ -e "${f}/config" ] || continue
333 echo ${f##*/} > ${d}/unbind
334 basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
335 removed=y
336 done
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300337 done
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200338 if [ -n "${removed}" ]; then
339 echo "There are changes in PCI drivers, rescaning"
340 echo 1 > /sys/bus/pci/rescan
341 else
342 echo "There weren't PCI devices binded"
343 fi
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300344else
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200345 echo "Upgrading package, dont' unbind interfaces"
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300346fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700347
Billy McFall28cf3b72018-01-15 17:54:52 -0500348%postun selinux-policy
349if [ $1 -eq 0 ]; then
350 %{_sbindir}/semodule -n -r %{modulenames}
351 if %{_sbindir}/selinuxenabled ; then
352 %{_sbindir}/load_policy
353 %relabel_files
354 fi
355fi
356
Ed Warnickecb9cada2015-12-08 15:45:58 -0700357%files
358%defattr(-,bin,bin)
359%{_unitdir}/vpp.service
Matthew Smith48a13f32021-08-19 15:47:06 -0500360/usr/bin/vat2
Damjan Marion08ff7e02016-01-20 13:45:36 +0100361/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700362/usr/bin/svm*
Billy McFallce41a5c2017-09-08 20:11:58 +0000363%config(noreplace) /etc/sysctl.d/80-vpp.conf
364%config(noreplace) /etc/vpp/startup.conf
Ole Troanf14e3bf2016-12-01 21:49:03 +0100365/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700366
Billy McFall28cf3b72018-01-15 17:54:52 -0500367%defattr(-,root,vpp)
368%{_localstatedir}/run/vpp*
369
370%defattr(-,root,root)
371%{_localstatedir}/log/vpp*
372
Ed Warnickecb9cada2015-12-08 15:45:58 -0700373%files lib
374%defattr(-,bin,bin)
Igor Mikhailov (imichail)3b854a52018-05-18 20:08:26 -0700375%global __requires_exclude_from %{_libdir}/librte_pmd_mlx[45]_glue\\.so.*$
Ed Warnickef5a14362016-09-12 20:40:24 +0000376%exclude %{_libdir}/vpp_plugins
377%exclude %{_libdir}/vpp_api_test_plugins
Huawei LIabf81c32022-11-11 13:50:26 +0800378%exclude %{_libdir}/vat2_plugins
Ed Warnickecb9cada2015-12-08 15:45:58 -0700379%{_libdir}/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100380/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700381
Damjan Marioncb034b92016-12-28 18:38:59 +0100382%files api-lua
Gabriel Gannef3854e92017-01-17 10:00:54 +0100383%defattr(644,root,root,644)
Damjan Marioncb034b92016-12-28 18:38:59 +0100384/usr/share/doc/vpp/examples/lua
385
Ian Wells13cef0c2019-08-09 17:27:19 -0700386%files api-python3
387%defattr(644,root,root,755)
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400388%{python3_sitelib}/vpp_*
Ole Troan57c3d662016-09-12 22:00:32 +0200389
Billy McFall28cf3b72018-01-15 17:54:52 -0500390%files selinux-policy
391%defattr(-,root,root,0755)
392%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
393%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
394
Ed Warnickecb9cada2015-12-08 15:45:58 -0700395%files devel
396%defattr(-,bin,bin)
397/usr/bin/vppapigen
Oliver Gilesdc203712019-12-05 23:37:36 +0200398/usr/bin/vapi_c_gen.py
399/usr/bin/vapi_cpp_gen.py
400/usr/bin/vapi_json_parser.py
Ed Warnickecb9cada2015-12-08 15:45:58 -0700401%{_includedir}/*
402/usr/share/doc/vpp/examples/sample-plugin
Ole Troan9d420872017-10-12 13:06:35 +0200403/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700404
Ed Warnickef5a14362016-09-12 20:40:24 +0000405%files plugins
406%defattr(-,bin,bin)
Huawei LIabf81c32022-11-11 13:50:26 +0800407/usr/%{_lib}/vpp_plugins/*
408/usr/%{_lib}/vpp_api_test_plugins/*
409/usr/%{_lib}/vat2_plugins/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100410/usr/share/vpp/api/*