2017-08-29 16:07:51 -04:00
|
|
|
%bcond_without aesni
|
2017-11-30 15:41:22 -06:00
|
|
|
%{!?_topdir:%define _topdir %(pwd)}
|
2016-10-13 18:36:50 -04:00
|
|
|
%define _vpp_build_dir build-tool-native
|
2015-12-08 15:45:58 -07:00
|
|
|
%define _unitdir /lib/systemd/system
|
|
|
|
%define _builddir %{_topdir}
|
2018-04-06 15:13:41 -04:00
|
|
|
%define _mu_build_dir %{_topdir}/%{name}-%{_version}/build-root
|
2017-05-18 19:46:17 -07:00
|
|
|
%define _vpp_tag %{getenv:TAG}
|
|
|
|
%if "%{_vpp_tag}" == ""
|
|
|
|
%define _vpp_tag vpp
|
|
|
|
%endif
|
|
|
|
%define _vpp_install_dir install-%{_vpp_tag}-native
|
2015-12-08 15:45:58 -07:00
|
|
|
|
2016-10-11 15:34:24 +03:00
|
|
|
%{?systemd_requires}
|
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
|
|
|
|
# SELinux Related definitions
|
|
|
|
%global selinuxtype targeted
|
|
|
|
%global moduletype services
|
|
|
|
%global modulenames vpp-custom
|
|
|
|
|
|
|
|
# Usage: _format var format
|
|
|
|
# Expand 'modulenames' into various formats as needed
|
|
|
|
# Format must contain '$x' somewhere to do anything useful
|
|
|
|
%global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done;
|
|
|
|
|
|
|
|
# Relabel files
|
|
|
|
%global relabel_files() \ # ADD files in *.fc file
|
|
|
|
|
|
|
|
# Version of distribution SELinux policy package
|
|
|
|
%global selinux_policyver 3.13.1-128.6.fc22
|
|
|
|
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
Name: vpp
|
|
|
|
Summary: Vector Packet Processing
|
2017-07-05 09:33:30 -04:00
|
|
|
License: ASL 2.0
|
2015-12-08 15:45:58 -07:00
|
|
|
Version: %{_version}
|
|
|
|
Release: %{_release}
|
2016-12-19 19:08:11 +01:00
|
|
|
BuildRequires: systemd, chrpath
|
2017-10-09 15:03:55 -04:00
|
|
|
BuildRequires: check, check-devel
|
2018-11-27 15:57:30 -05:00
|
|
|
%if 0%{?fedora}
|
2019-08-09 17:27:19 -07:00
|
|
|
Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
|
2019-04-22 17:35:03 -04:00
|
|
|
Requires: compat-openssl10
|
2022-04-18 09:29:59 -07:00
|
|
|
Requires: libffi-devel
|
2018-03-05 17:21:56 -05:00
|
|
|
BuildRequires: subunit, subunit-devel
|
2017-09-11 08:58:23 -04:00
|
|
|
BuildRequires: compat-openssl10-devel
|
2019-08-09 17:27:19 -07:00
|
|
|
BuildRequires: python, python-devel, python-virtualenv, python-ply
|
|
|
|
BuildRequires: python3, python36-devel, python3-virtualenv
|
2018-11-27 15:57:30 -05:00
|
|
|
BuildRequires: cmake
|
2017-08-03 11:04:24 -04:00
|
|
|
%else
|
2019-11-07 06:10:34 -06:00
|
|
|
%if 0%{rhel} >= 7
|
2023-02-06 17:25:16 +01:00
|
|
|
Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
|
2022-04-18 09:29:59 -07:00
|
|
|
Requires: libffi-devel
|
2019-04-22 17:35:03 -04:00
|
|
|
BuildRequires: epel-release
|
2017-09-11 08:58:23 -04:00
|
|
|
BuildREquires: openssl-devel
|
2019-11-07 06:10:34 -06:00
|
|
|
%if 0%{rhel} == 7
|
2023-02-06 17:25:16 +01:00
|
|
|
Requires: python36
|
2020-04-29 21:28:15 +02:00
|
|
|
BuildRequires: devtoolset-9-toolchain
|
2018-11-27 15:57:30 -05:00
|
|
|
BuildRequires: cmake3
|
2019-11-07 06:10:34 -06:00
|
|
|
BuildRequires: glibc-static, yum-utils
|
2023-02-06 17:25:16 +01:00
|
|
|
BuildRequires: python36-devel
|
|
|
|
%else
|
|
|
|
%if 0%{rhel} == 8
|
|
|
|
Requires: python36
|
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: dnf-utils
|
|
|
|
BuildRequires: python36-devel
|
2019-11-07 06:10:34 -06:00
|
|
|
%else
|
2023-02-06 17:25:16 +01:00
|
|
|
Requires: python3
|
2019-11-07 06:10:34 -06:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: dnf-utils
|
2023-02-06 17:25:16 +01:00
|
|
|
BuildRequires: python3-devel
|
|
|
|
%endif
|
2019-11-07 06:10:34 -06:00
|
|
|
%endif
|
2017-08-03 11:04:24 -04:00
|
|
|
%endif
|
|
|
|
%endif
|
2017-09-11 08:58:23 -04:00
|
|
|
BuildRequires: libffi-devel
|
2017-08-03 11:04:24 -04:00
|
|
|
BuildRequires: apr-devel
|
|
|
|
BuildRequires: numactl-devel
|
|
|
|
BuildRequires: autoconf automake libtool byacc bison flex
|
2018-01-15 17:54:52 -05:00
|
|
|
BuildRequires: selinux-policy selinux-policy-devel
|
2015-12-08 15:45:58 -07:00
|
|
|
|
2017-07-19 19:17:15 -04:00
|
|
|
Source: %{name}-%{_version}-%{_release}.tar.xz
|
|
|
|
# Source: vpp-latest.tar.xz
|
2016-10-13 18:36:50 -04:00
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
%description
|
2016-01-20 13:45:36 +01:00
|
|
|
This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
|
|
|
|
vpp - the vector packet engine
|
|
|
|
vpp_api_test - vector packet engine API test tool
|
|
|
|
vpp_json_test - vector packet engine JSON test tool
|
2015-12-08 15:45:58 -07:00
|
|
|
|
|
|
|
%package lib
|
|
|
|
Summary: VPP libraries
|
|
|
|
Group: System Environment/Libraries
|
2018-01-15 17:54:52 -05:00
|
|
|
Requires: vpp-selinux-policy = %{_version}-%{_release}
|
2015-12-08 15:45:58 -07:00
|
|
|
|
|
|
|
%description lib
|
|
|
|
This package contains the VPP shared libraries, including:
|
|
|
|
vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
|
|
|
|
svm - vm library
|
|
|
|
vlib - vector processing library
|
|
|
|
vlib-api - binary API library
|
|
|
|
vnet - network stack library
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: VPP header files, static libraries
|
|
|
|
Group: Development/Libraries
|
|
|
|
Requires: vpp-lib
|
|
|
|
|
|
|
|
%description devel
|
2016-10-01 18:09:33 -04:00
|
|
|
This package contains the header files for VPP.
|
|
|
|
Install this package if you want to write a
|
|
|
|
program for compilation and linking with vpp lib.
|
|
|
|
vlib
|
|
|
|
vlibmemory
|
|
|
|
vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
|
|
|
|
vpp-api
|
|
|
|
vppinfra
|
2015-12-08 15:45:58 -07:00
|
|
|
|
2016-09-12 20:40:24 +00:00
|
|
|
%package plugins
|
|
|
|
Summary: Vector Packet Processing--runtime plugins
|
|
|
|
Group: System Environment/Libraries
|
2018-01-18 11:00:17 +01:00
|
|
|
Requires: vpp = %{_version}-%{_release} numactl-libs
|
2016-09-12 20:40:24 +00:00
|
|
|
%description plugins
|
|
|
|
This package contains VPP plugins
|
|
|
|
|
2016-12-28 18:38:59 +01:00
|
|
|
%package api-lua
|
|
|
|
Summary: VPP api lua bindings
|
|
|
|
Group: Development/Libraries
|
|
|
|
Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
|
|
|
|
|
|
|
|
%description api-lua
|
|
|
|
This package contains the lua bindings for the vpp api
|
|
|
|
|
2019-08-09 17:27:19 -07:00
|
|
|
%package api-python3
|
|
|
|
Summary: VPP api python3 bindings
|
|
|
|
Group: Development/Libraries
|
|
|
|
Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel
|
2020-06-30 23:14:23 -07:00
|
|
|
Requires: python3-setuptools
|
2019-08-09 17:27:19 -07:00
|
|
|
|
|
|
|
%description api-python3
|
|
|
|
This package contains the python3 bindings for the vpp api
|
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
%package selinux-policy
|
|
|
|
Summary: VPP Security-Enhanced Linux (SELinux) policy
|
|
|
|
Group: System Environment/Base
|
2020-03-06 13:42:22 -06:00
|
|
|
Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, libselinux-utils
|
|
|
|
%if 0%{rhel} < 8
|
|
|
|
Requires(post): policycoreutils-python
|
|
|
|
%else
|
|
|
|
Requires(post): python3-policycoreutils
|
|
|
|
%endif
|
2018-01-15 17:54:52 -05:00
|
|
|
|
|
|
|
%description selinux-policy
|
|
|
|
This package contains a tailored VPP SELinux policy
|
|
|
|
|
2016-10-13 18:36:50 -04:00
|
|
|
%prep
|
2020-09-16 21:04:24 +00:00
|
|
|
%setup -q -c -T -n %{name}-%{_version}
|
|
|
|
cd ..
|
|
|
|
unxz --stdout ./SOURCES/%{name}-%{_version}-%{_release}.tar.xz | tar --extract --touch
|
|
|
|
cd -
|
2016-10-13 18:36:50 -04:00
|
|
|
|
2016-06-08 17:15:08 -05:00
|
|
|
%pre
|
|
|
|
# Add the vpp group
|
2016-06-08 19:49:40 -05:00
|
|
|
groupadd -f -r vpp
|
2016-06-08 17:15:08 -05:00
|
|
|
|
2017-03-17 09:54:51 +01:00
|
|
|
%build
|
2019-11-07 06:10:34 -06:00
|
|
|
%if 0%{rhel} < 8
|
2020-04-29 21:28:15 +02:00
|
|
|
. /opt/rh/devtoolset-9/enable
|
2018-11-27 15:57:30 -05:00
|
|
|
%endif
|
2017-08-29 16:07:51 -04:00
|
|
|
%if %{with aesni}
|
2020-09-16 21:04:24 +00:00
|
|
|
make install-dep
|
2017-08-29 16:07:51 -04:00
|
|
|
make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
|
|
|
|
%else
|
|
|
|
make bootstrap AESNI=n
|
|
|
|
make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
|
|
|
|
%endif
|
2019-04-22 17:35:03 -04:00
|
|
|
cd %{_mu_build_dir}/../src/vpp-api/python && %py3_build
|
2018-01-15 17:54:52 -05:00
|
|
|
cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
|
2017-03-17 09:54:51 +01:00
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
%install
|
|
|
|
#
|
|
|
|
# binaries
|
|
|
|
#
|
|
|
|
mkdir -p -m755 %{buildroot}%{_bindir}
|
|
|
|
mkdir -p -m755 %{buildroot}%{_unitdir}
|
2017-01-26 15:42:39 +01:00
|
|
|
install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir}
|
2016-12-01 21:49:03 +01:00
|
|
|
|
2016-12-19 23:05:39 +01:00
|
|
|
# api
|
2016-12-01 21:49:03 +01:00
|
|
|
mkdir -p -m755 %{buildroot}/usr/share/vpp/api
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
#
|
|
|
|
# configs
|
|
|
|
#
|
|
|
|
mkdir -p -m755 %{buildroot}/etc/vpp
|
2016-10-11 13:35:26 +02:00
|
|
|
mkdir -p -m755 %{buildroot}/etc/sysctl.d
|
2017-07-23 17:21:46 -04:00
|
|
|
install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
|
2017-01-31 17:29:33 +01:00
|
|
|
install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf
|
2016-12-19 23:05:39 +01:00
|
|
|
install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
|
2015-12-08 15:45:58 -07:00
|
|
|
#
|
|
|
|
# libraries
|
|
|
|
#
|
|
|
|
mkdir -p -m755 %{buildroot}%{_libdir}
|
2017-01-10 17:10:39 +00:00
|
|
|
mkdir -p -m755 %{buildroot}/etc/bash_completion.d
|
|
|
|
mkdir -p -m755 %{buildroot}/usr/share/vpp
|
2018-09-06 10:59:49 -05:00
|
|
|
for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print )
|
2015-12-08 15:45:58 -07:00
|
|
|
do
|
|
|
|
install -p -m 755 $file %{buildroot}%{_libdir}
|
|
|
|
done
|
|
|
|
for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
|
|
|
|
do
|
|
|
|
# make lib symlinks
|
|
|
|
( cd %{buildroot}%{_libdir} &&
|
|
|
|
ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
|
2016-09-07 17:12:52 +00:00
|
|
|
( cd %{buildroot}%{_libdir} &&
|
|
|
|
ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
|
2015-12-08 15:45:58 -07:00
|
|
|
done
|
2016-12-19 23:05:39 +01:00
|
|
|
for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/vpp/api -type f -name '*.api.json' -print )
|
2016-12-01 21:49:03 +01:00
|
|
|
do
|
|
|
|
install -p -m 644 $file %{buildroot}/usr/share/vpp/api
|
|
|
|
done
|
2016-08-31 18:48:47 -07:00
|
|
|
|
2016-12-28 18:38:59 +01:00
|
|
|
# Lua bindings
|
|
|
|
mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli
|
|
|
|
mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute
|
2017-08-03 11:04:24 -04:00
|
|
|
# for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
|
|
|
|
for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && find . -type f -regex '.*/*.[luteamd]' -print | sed -e 's/^\.\///')
|
2016-12-28 18:38:59 +01:00
|
|
|
do
|
2017-08-03 11:04:24 -04:00
|
|
|
( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \
|
|
|
|
%{buildroot}/usr/share/doc/vpp/examples/lua/$file )
|
2016-12-28 18:38:59 +01:00
|
|
|
done
|
|
|
|
|
2016-09-12 22:00:32 +02:00
|
|
|
# Python bindings
|
2019-04-22 17:35:03 -04:00
|
|
|
cd %{_mu_build_dir}/../src/vpp-api/python && %py3_install
|
2016-09-12 22:00:32 +02:00
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
# SELinux Policy
|
|
|
|
# Install SELinux interfaces
|
|
|
|
%_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if
|
|
|
|
install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
|
|
|
|
install -p -m 644 $INTERFACES \
|
|
|
|
%{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
|
|
|
|
|
|
|
|
# Install policy modules
|
|
|
|
%_format MODULES %{_mu_build_dir}/../extras/selinux/$x.pp
|
|
|
|
install -d %{buildroot}%{_datadir}/selinux/packages
|
|
|
|
install -m 0644 $MODULES \
|
|
|
|
%{buildroot}%{_datadir}/selinux/packages
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
#
|
|
|
|
# devel
|
|
|
|
#
|
2020-10-16 15:28:47 +02:00
|
|
|
for dir in %{_mu_build_dir}/%{_vpp_install_dir}/vpp/include/
|
2015-12-08 15:45:58 -07:00
|
|
|
do
|
|
|
|
for subdir in $(cd ${dir} && find . -type d -print)
|
|
|
|
do
|
|
|
|
mkdir -p -m755 %{buildroot}/usr/include/${subdir}
|
|
|
|
done
|
|
|
|
for file in $(cd ${dir} && find . -type f -print)
|
|
|
|
do
|
|
|
|
install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
|
|
|
|
done
|
|
|
|
done
|
2016-08-31 18:48:47 -07:00
|
|
|
|
2018-09-12 13:40:13 -07:00
|
|
|
install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_c.py %{buildroot}/usr/share/vpp
|
|
|
|
install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_json.py %{buildroot}/usr/share/vpp
|
2018-01-31 09:45:11 -06:00
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
# sample plugin
|
|
|
|
mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
|
2017-08-03 11:04:24 -04:00
|
|
|
#for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .)
|
|
|
|
for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && find . -type f -regex '.*/*.[acdhimp]' -print | sed -e 's/^\.\///')
|
2015-12-08 15:45:58 -07:00
|
|
|
do
|
2017-08-03 11:04:24 -04:00
|
|
|
( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \
|
|
|
|
%{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file )
|
2015-12-08 15:45:58 -07:00
|
|
|
done
|
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
# vppctl sockfile directory
|
|
|
|
mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp
|
|
|
|
# vpp.log directory
|
|
|
|
mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp
|
2016-09-12 20:40:24 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# vpp-plugins
|
2018-09-12 14:01:10 +02:00
|
|
|
#
|
2022-11-11 13:50:26 +08:00
|
|
|
mkdir -p -m755 %{buildroot}/usr/%{_lib}/vpp_plugins
|
|
|
|
mkdir -p -m755 %{buildroot}/usr/%{_lib}/vpp_api_test_plugins
|
|
|
|
mkdir -p -m755 %{buildroot}/usr/%{_lib}/vat2_plugins
|
2021-09-28 13:00:16 +08:00
|
|
|
for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins && find -type f -print)
|
2016-12-19 23:05:39 +01:00
|
|
|
do
|
2021-09-28 13:00:16 +08:00
|
|
|
install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins/$file \
|
2022-11-11 13:50:26 +08:00
|
|
|
%{buildroot}/usr/%{_lib}/vpp_plugins/$file
|
2016-12-19 23:05:39 +01:00
|
|
|
done
|
|
|
|
|
2021-09-28 13:00:16 +08:00
|
|
|
for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_api_test_plugins && find -type f -print)
|
2016-12-19 23:05:39 +01:00
|
|
|
do
|
2021-09-28 13:00:16 +08:00
|
|
|
install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_api_test_plugins/$file \
|
2022-11-11 13:50:26 +08:00
|
|
|
%{buildroot}/usr/%{_lib}/vpp_api_test_plugins/$file
|
|
|
|
done
|
|
|
|
|
|
|
|
for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vat2_plugins && find -type f -print)
|
|
|
|
do
|
|
|
|
install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vat2_plugins/$file \
|
|
|
|
%{buildroot}/usr/%{_lib}/vat2_plugins/$file
|
2016-12-19 23:05:39 +01:00
|
|
|
done
|
|
|
|
|
2018-09-26 10:49:41 +02:00
|
|
|
for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/vpp/api/plugins -type f -name '*.api.json' -print )
|
2016-12-01 21:49:03 +01:00
|
|
|
do
|
2019-03-05 09:28:48 -06:00
|
|
|
install -p -m 755 $file %{buildroot}/usr/share/vpp/api
|
2016-12-01 21:49:03 +01:00
|
|
|
done
|
|
|
|
|
2016-12-19 19:08:11 +01:00
|
|
|
#
|
|
|
|
# remove RPATH from ELF binaries
|
|
|
|
#
|
|
|
|
%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
%post
|
2017-06-21 14:20:42 +02:00
|
|
|
if [ $1 -eq 1 ] ; then
|
|
|
|
sysctl --system
|
|
|
|
fi
|
2015-12-08 15:45:58 -07:00
|
|
|
%systemd_post vpp.service
|
|
|
|
|
2016-10-11 15:34:24 +03:00
|
|
|
%preun
|
|
|
|
%systemd_preun vpp.service
|
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
%post selinux-policy
|
|
|
|
%_format MODULES %{_datadir}/selinux/packages/$x.pp
|
|
|
|
if %{_sbindir}/selinuxenabled ; then
|
2018-02-22 21:12:11 -06:00
|
|
|
%{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES
|
2018-01-15 17:54:52 -05:00
|
|
|
%{_sbindir}/load_policy
|
|
|
|
%relabel_files
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
%postun
|
2023-02-06 17:25:16 +01:00
|
|
|
%systemd_postun vpp.service
|
2017-06-21 14:20:42 +02:00
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
echo "Uninstalling, unbind user-mode PCI drivers"
|
|
|
|
# Unbind user-mode PCI drivers
|
|
|
|
removed=
|
|
|
|
pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
|
|
|
|
for d in $pci_dirs; do
|
|
|
|
for f in ${d}/*; do
|
|
|
|
[ -e "${f}/config" ] || continue
|
|
|
|
echo ${f##*/} > ${d}/unbind
|
|
|
|
basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
|
|
|
|
removed=y
|
|
|
|
done
|
2016-10-11 15:34:24 +03:00
|
|
|
done
|
2017-06-21 14:20:42 +02:00
|
|
|
if [ -n "${removed}" ]; then
|
|
|
|
echo "There are changes in PCI drivers, rescaning"
|
|
|
|
echo 1 > /sys/bus/pci/rescan
|
|
|
|
else
|
|
|
|
echo "There weren't PCI devices binded"
|
|
|
|
fi
|
2016-10-11 15:34:24 +03:00
|
|
|
else
|
2017-06-21 14:20:42 +02:00
|
|
|
echo "Upgrading package, dont' unbind interfaces"
|
2016-10-11 15:34:24 +03:00
|
|
|
fi
|
2015-12-08 15:45:58 -07:00
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
%postun selinux-policy
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
%{_sbindir}/semodule -n -r %{modulenames}
|
|
|
|
if %{_sbindir}/selinuxenabled ; then
|
|
|
|
%{_sbindir}/load_policy
|
|
|
|
%relabel_files
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
%files
|
|
|
|
%defattr(-,bin,bin)
|
|
|
|
%{_unitdir}/vpp.service
|
2021-08-19 15:47:06 -05:00
|
|
|
/usr/bin/vat2
|
2016-01-20 13:45:36 +01:00
|
|
|
/usr/bin/vpp*
|
2015-12-08 15:45:58 -07:00
|
|
|
/usr/bin/svm*
|
2017-09-08 20:11:58 +00:00
|
|
|
%config(noreplace) /etc/sysctl.d/80-vpp.conf
|
|
|
|
%config(noreplace) /etc/vpp/startup.conf
|
2016-12-01 21:49:03 +01:00
|
|
|
/usr/share/vpp/api/*
|
2015-12-08 15:45:58 -07:00
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
%defattr(-,root,vpp)
|
|
|
|
%{_localstatedir}/run/vpp*
|
|
|
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_localstatedir}/log/vpp*
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
%files lib
|
|
|
|
%defattr(-,bin,bin)
|
2018-05-18 20:08:26 -07:00
|
|
|
%global __requires_exclude_from %{_libdir}/librte_pmd_mlx[45]_glue\\.so.*$
|
2016-09-12 20:40:24 +00:00
|
|
|
%exclude %{_libdir}/vpp_plugins
|
|
|
|
%exclude %{_libdir}/vpp_api_test_plugins
|
2022-11-11 13:50:26 +08:00
|
|
|
%exclude %{_libdir}/vat2_plugins
|
2015-12-08 15:45:58 -07:00
|
|
|
%{_libdir}/*
|
2016-12-01 21:49:03 +01:00
|
|
|
/usr/share/vpp/api/*
|
2015-12-08 15:45:58 -07:00
|
|
|
|
2016-12-28 18:38:59 +01:00
|
|
|
%files api-lua
|
2017-01-17 10:00:54 +01:00
|
|
|
%defattr(644,root,root,644)
|
2016-12-28 18:38:59 +01:00
|
|
|
/usr/share/doc/vpp/examples/lua
|
|
|
|
|
2019-08-09 17:27:19 -07:00
|
|
|
%files api-python3
|
|
|
|
%defattr(644,root,root,755)
|
2019-04-22 17:35:03 -04:00
|
|
|
%{python3_sitelib}/vpp_*
|
2016-09-12 22:00:32 +02:00
|
|
|
|
2018-01-15 17:54:52 -05:00
|
|
|
%files selinux-policy
|
|
|
|
%defattr(-,root,root,0755)
|
|
|
|
%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
|
|
|
|
%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
|
|
|
|
|
2015-12-08 15:45:58 -07:00
|
|
|
%files devel
|
|
|
|
%defattr(-,bin,bin)
|
|
|
|
/usr/bin/vppapigen
|
2019-12-05 23:37:36 +02:00
|
|
|
/usr/bin/vapi_c_gen.py
|
|
|
|
/usr/bin/vapi_cpp_gen.py
|
|
|
|
/usr/bin/vapi_json_parser.py
|
2015-12-08 15:45:58 -07:00
|
|
|
%{_includedir}/*
|
|
|
|
/usr/share/doc/vpp/examples/sample-plugin
|
2017-10-12 13:06:35 +02:00
|
|
|
/usr/share/vpp
|
2016-08-31 18:48:47 -07:00
|
|
|
|
2016-09-12 20:40:24 +00:00
|
|
|
%files plugins
|
|
|
|
%defattr(-,bin,bin)
|
2022-11-11 13:50:26 +08:00
|
|
|
/usr/%{_lib}/vpp_plugins/*
|
|
|
|
/usr/%{_lib}/vpp_api_test_plugins/*
|
|
|
|
/usr/%{_lib}/vat2_plugins/*
|
2016-12-01 21:49:03 +01:00
|
|
|
/usr/share/vpp/api/*
|