blob: b5d5fd362b54f6e08a64662a17a4c6636ce3f52d [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 Herbertca3d38a2019-04-22 17:35:03 -040040BuildRequires: mbedtls-devel mbedtls
Thomas F Herbert6eb61632018-11-27 15:57:30 -050041%if 0%{?fedora}
Ian Wells13cef0c2019-08-09 17:27:19 -070042Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040043Requires: compat-openssl10
Dave Wallacebfcd2392021-11-30 11:00:23 -050044Requires: mbedtls libffi-devel
Thomas F Herbert66731782018-03-05 17:21:56 -050045BuildRequires: subunit, subunit-devel
Thomas F Herbert440751b2017-09-11 08:58:23 -040046BuildRequires: compat-openssl10-devel
Ian Wells13cef0c2019-08-09 17:27:19 -070047BuildRequires: python, python-devel, python-virtualenv, python-ply
48BuildRequires: python3, python36-devel, python3-virtualenv
Thomas F Herbert6eb61632018-11-27 15:57:30 -050049BuildRequires: cmake
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040050%else
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060051%if 0%{rhel} >= 7
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040052Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python36
Dave Wallacebfcd2392021-11-30 11:00:23 -050053Requires: mbedtls libffi-devel
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040054BuildRequires: epel-release
55BuildRequires: mbedtls-devel mbedtls
Thomas F Herbert440751b2017-09-11 08:58:23 -040056BuildREquires: openssl-devel
Thomas F Herbertca3d38a2019-04-22 17:35:03 -040057BuildRequires: python36-devel
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060058%if 0%{rhel} == 7
Damjan Marion162330f2020-04-29 21:28:15 +020059BuildRequires: devtoolset-9-toolchain
Thomas F Herbert6eb61632018-11-27 15:57:30 -050060BuildRequires: cmake3
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060061BuildRequires: glibc-static, yum-utils
62%else
63BuildRequires: cmake
64BuildRequires: dnf-utils
65%endif
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040066%endif
67%endif
Thomas F Herbert440751b2017-09-11 08:58:23 -040068BuildRequires: libffi-devel
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -060069BuildRequires: redhat-lsb
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040070BuildRequires: apr-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040071BuildRequires: numactl-devel
72BuildRequires: autoconf automake libtool byacc bison flex
Billy McFall28cf3b72018-01-15 17:54:52 -050073BuildRequires: selinux-policy selinux-policy-devel
Ed Warnickecb9cada2015-12-08 15:45:58 -070074
Thomas F Herbertb60f4962017-07-19 19:17:15 -040075Source: %{name}-%{_version}-%{_release}.tar.xz
76# Source: vpp-latest.tar.xz
Thomas F Herbert20a29c72016-10-13 18:36:50 -040077
Ed Warnickecb9cada2015-12-08 15:45:58 -070078%description
Damjan Marion08ff7e02016-01-20 13:45:36 +010079This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
80vpp - the vector packet engine
81vpp_api_test - vector packet engine API test tool
82vpp_json_test - vector packet engine JSON test tool
Ed Warnickecb9cada2015-12-08 15:45:58 -070083
84%package lib
85Summary: VPP libraries
86Group: System Environment/Libraries
Billy McFall28cf3b72018-01-15 17:54:52 -050087Requires: vpp-selinux-policy = %{_version}-%{_release}
Ed Warnickecb9cada2015-12-08 15:45:58 -070088
89%description lib
90This package contains the VPP shared libraries, including:
91vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
Ed Warnickecb9cada2015-12-08 15:45:58 -070092svm - vm library
93vlib - vector processing library
94vlib-api - binary API library
95vnet - network stack library
96
97%package devel
98Summary: VPP header files, static libraries
99Group: Development/Libraries
100Requires: vpp-lib
101
102%description devel
Thomas F Herbert3977a212016-10-01 18:09:33 -0400103This package contains the header files for VPP.
104Install this package if you want to write a
105program for compilation and linking with vpp lib.
106vlib
107vlibmemory
108vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
109vpp-api
110vppinfra
Ed Warnickecb9cada2015-12-08 15:45:58 -0700111
Ed Warnickef5a14362016-09-12 20:40:24 +0000112%package plugins
113Summary: Vector Packet Processing--runtime plugins
114Group: System Environment/Libraries
Gabriel Gannebf246df2018-01-18 11:00:17 +0100115Requires: vpp = %{_version}-%{_release} numactl-libs
Ed Warnickef5a14362016-09-12 20:40:24 +0000116%description plugins
117This package contains VPP plugins
118
Damjan Marioncb034b92016-12-28 18:38:59 +0100119%package api-lua
120Summary: VPP api lua bindings
121Group: Development/Libraries
122Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
123
124%description api-lua
125This package contains the lua bindings for the vpp api
126
Ian Wells13cef0c2019-08-09 17:27:19 -0700127%package api-python3
128Summary: VPP api python3 bindings
129Group: Development/Libraries
130Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel
Yichen Wang466872f2020-06-30 23:14:23 -0700131Requires: python3-setuptools
Ian Wells13cef0c2019-08-09 17:27:19 -0700132
133%description api-python3
134This package contains the python3 bindings for the vpp api
135
Billy McFall28cf3b72018-01-15 17:54:52 -0500136%package selinux-policy
137Summary: VPP Security-Enhanced Linux (SELinux) policy
138Group: System Environment/Base
Renato Botelho do Couto1d94ab52020-03-06 13:42:22 -0600139Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, libselinux-utils
140%if 0%{rhel} < 8
141Requires(post): policycoreutils-python
142%else
143Requires(post): python3-policycoreutils
144%endif
Billy McFall28cf3b72018-01-15 17:54:52 -0500145
146%description selinux-policy
147This package contains a tailored VPP SELinux policy
148
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400149%prep
Dave Wallace27b50fe2020-09-16 21:04:24 +0000150%setup -q -c -T -n %{name}-%{_version}
151cd ..
152unxz --stdout ./SOURCES/%{name}-%{_version}-%{_release}.tar.xz | tar --extract --touch
153cd -
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400154
Ed Warnickeec6290a2016-06-08 17:15:08 -0500155%pre
156# Add the vpp group
Ed Warnickeb10427e2016-06-08 19:49:40 -0500157groupadd -f -r vpp
Ed Warnickeec6290a2016-06-08 17:15:08 -0500158
Ole Troanc60f5572017-03-17 09:54:51 +0100159%build
Renato Botelho do Coutoc0253292019-11-07 06:10:34 -0600160%if 0%{rhel} < 8
Damjan Marion162330f2020-04-29 21:28:15 +0200161. /opt/rh/devtoolset-9/enable
Thomas F Herbert6eb61632018-11-27 15:57:30 -0500162%endif
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400163%if %{with aesni}
Dave Wallace27b50fe2020-09-16 21:04:24 +0000164 make install-dep
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400165 make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
166%else
167 make bootstrap AESNI=n
168 make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
169%endif
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400170cd %{_mu_build_dir}/../src/vpp-api/python && %py3_build
Billy McFall28cf3b72018-01-15 17:54:52 -0500171cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
Ole Troanc60f5572017-03-17 09:54:51 +0100172
Ed Warnickecb9cada2015-12-08 15:45:58 -0700173%install
174#
175# binaries
176#
177mkdir -p -m755 %{buildroot}%{_bindir}
178mkdir -p -m755 %{buildroot}%{_unitdir}
Gabriel Ganne714968b2017-01-26 15:42:39 +0100179install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir}
Ole Troanf14e3bf2016-12-01 21:49:03 +0100180
Damjan Marion7cd468a2016-12-19 23:05:39 +0100181# api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100182mkdir -p -m755 %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100183
Ed Warnickecb9cada2015-12-08 15:45:58 -0700184#
185# configs
186#
187mkdir -p -m755 %{buildroot}/etc/vpp
Miroslav Miklus8e08e742016-10-11 13:35:26 +0200188mkdir -p -m755 %{buildroot}/etc/sysctl.d
Thomas F Herbert5b75b6b2017-07-23 17:21:46 -0400189install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
Damjan Mariond0f673e2017-01-31 17:29:33 +0100190install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf
Damjan Marion7cd468a2016-12-19 23:05:39 +0100191install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
Ed Warnickecb9cada2015-12-08 15:45:58 -0700192#
193# libraries
194#
195mkdir -p -m755 %{buildroot}%{_libdir}
Padraig Connolly69915cb2017-01-10 17:10:39 +0000196mkdir -p -m755 %{buildroot}/etc/bash_completion.d
197mkdir -p -m755 %{buildroot}/usr/share/vpp
Matthew Smithd790c7e2018-09-06 10:59:49 -0500198for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700199do
200 install -p -m 755 $file %{buildroot}%{_libdir}
201done
202for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
203do
204 # make lib symlinks
205 ( cd %{buildroot}%{_libdir} &&
206 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
Ed Warnickef5a0e732016-09-07 17:12:52 +0000207 ( cd %{buildroot}%{_libdir} &&
208 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700209done
Damjan Marion7cd468a2016-12-19 23:05:39 +0100210for 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 +0100211do
212 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
213done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700214
Damjan Marioncb034b92016-12-28 18:38:59 +0100215# Lua bindings
216mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli
217mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400218# for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
219for 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 +0100220do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400221 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \
222 %{buildroot}/usr/share/doc/vpp/examples/lua/$file )
Damjan Marioncb034b92016-12-28 18:38:59 +0100223done
224
Ole Troan57c3d662016-09-12 22:00:32 +0200225# Python bindings
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400226cd %{_mu_build_dir}/../src/vpp-api/python && %py3_install
Ole Troan57c3d662016-09-12 22:00:32 +0200227
Billy McFall28cf3b72018-01-15 17:54:52 -0500228# SELinux Policy
229# Install SELinux interfaces
230%_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if
231install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
232install -p -m 644 $INTERFACES \
233 %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
234
235# Install policy modules
236%_format MODULES %{_mu_build_dir}/../extras/selinux/$x.pp
237install -d %{buildroot}%{_datadir}/selinux/packages
238install -m 0644 $MODULES \
239 %{buildroot}%{_datadir}/selinux/packages
240
Ed Warnickecb9cada2015-12-08 15:45:58 -0700241#
242# devel
243#
Damjan Marion8c1afb52020-10-16 15:28:47 +0200244for dir in %{_mu_build_dir}/%{_vpp_install_dir}/vpp/include/
Ed Warnickecb9cada2015-12-08 15:45:58 -0700245do
246 for subdir in $(cd ${dir} && find . -type d -print)
247 do
248 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
249 done
250 for file in $(cd ${dir} && find . -type f -print)
251 do
252 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
253 done
254done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700255
Paul Vinciguerra9ce6a212018-09-12 13:40:13 -0700256install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_c.py %{buildroot}/usr/share/vpp
257install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_json.py %{buildroot}/usr/share/vpp
Jon Loeliger190282c2018-01-31 09:45:11 -0600258
Ed Warnickecb9cada2015-12-08 15:45:58 -0700259# sample plugin
260mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400261#for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .)
262for 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 -0700263do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400264 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \
265 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700266done
267
Billy McFall28cf3b72018-01-15 17:54:52 -0500268# vppctl sockfile directory
269mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp
270# vpp.log directory
271mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp
Ed Warnickef5a14362016-09-12 20:40:24 +0000272
273#
274# vpp-plugins
Damjan Marion79dcbc72018-09-12 14:01:10 +0200275#
Ed Warnickee7637e72016-09-14 16:58:33 -0700276mkdir -p -m755 %{buildroot}/usr/lib/vpp_plugins
277mkdir -p -m755 %{buildroot}/usr/lib/vpp_api_test_plugins
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800278for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins && find -type f -print)
Damjan Marion7cd468a2016-12-19 23:05:39 +0100279do
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800280 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins/$file \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100281 %{buildroot}/usr/lib/vpp_plugins/$file
282done
283
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800284for 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 +0100285do
Tianyu Lifa6e7aa2021-09-28 13:00:16 +0800286 install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_api_test_plugins/$file \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100287 %{buildroot}/usr/lib/vpp_api_test_plugins/$file
288done
289
Mohsin Kazmi7b2017d2018-09-26 10:49:41 +0200290for 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 +0100291do
Matthew Smith4ed00392019-03-05 09:28:48 -0600292 install -p -m 755 $file %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100293done
294
Damjan Mariona1bd0232016-12-19 19:08:11 +0100295#
296# remove RPATH from ELF binaries
297#
298%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
299
Ed Warnickecb9cada2015-12-08 15:45:58 -0700300%post
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200301if [ $1 -eq 1 ] ; then
302 sysctl --system
303fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700304%systemd_post vpp.service
305
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300306%preun
307%systemd_preun vpp.service
308
Billy McFall28cf3b72018-01-15 17:54:52 -0500309%post selinux-policy
310%_format MODULES %{_datadir}/selinux/packages/$x.pp
Billy McFall28cf3b72018-01-15 17:54:52 -0500311if %{_sbindir}/selinuxenabled ; then
Matthew Smith7c172cb2018-02-22 21:12:11 -0600312 %{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES
Billy McFall28cf3b72018-01-15 17:54:52 -0500313 %{_sbindir}/load_policy
314 %relabel_files
315fi
316
317
Ed Warnickecb9cada2015-12-08 15:45:58 -0700318%postun
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300319%systemd_postun
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200320if [ $1 -eq 0 ] ; then
321 echo "Uninstalling, unbind user-mode PCI drivers"
322 # Unbind user-mode PCI drivers
323 removed=
324 pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
325 for d in $pci_dirs; do
326 for f in ${d}/*; do
327 [ -e "${f}/config" ] || continue
328 echo ${f##*/} > ${d}/unbind
329 basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
330 removed=y
331 done
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300332 done
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200333 if [ -n "${removed}" ]; then
334 echo "There are changes in PCI drivers, rescaning"
335 echo 1 > /sys/bus/pci/rescan
336 else
337 echo "There weren't PCI devices binded"
338 fi
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300339else
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200340 echo "Upgrading package, dont' unbind interfaces"
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300341fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700342
Billy McFall28cf3b72018-01-15 17:54:52 -0500343%postun selinux-policy
344if [ $1 -eq 0 ]; then
345 %{_sbindir}/semodule -n -r %{modulenames}
346 if %{_sbindir}/selinuxenabled ; then
347 %{_sbindir}/load_policy
348 %relabel_files
349 fi
350fi
351
Ed Warnickecb9cada2015-12-08 15:45:58 -0700352%files
353%defattr(-,bin,bin)
354%{_unitdir}/vpp.service
Matthew Smith48a13f32021-08-19 15:47:06 -0500355/usr/bin/vat2
Damjan Marion08ff7e02016-01-20 13:45:36 +0100356/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700357/usr/bin/svm*
Billy McFallce41a5c2017-09-08 20:11:58 +0000358%config(noreplace) /etc/sysctl.d/80-vpp.conf
359%config(noreplace) /etc/vpp/startup.conf
Ole Troanf14e3bf2016-12-01 21:49:03 +0100360/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700361
Billy McFall28cf3b72018-01-15 17:54:52 -0500362%defattr(-,root,vpp)
363%{_localstatedir}/run/vpp*
364
365%defattr(-,root,root)
366%{_localstatedir}/log/vpp*
367
Ed Warnickecb9cada2015-12-08 15:45:58 -0700368%files lib
369%defattr(-,bin,bin)
Igor Mikhailov (imichail)3b854a52018-05-18 20:08:26 -0700370%global __requires_exclude_from %{_libdir}/librte_pmd_mlx[45]_glue\\.so.*$
Ed Warnickef5a14362016-09-12 20:40:24 +0000371%exclude %{_libdir}/vpp_plugins
372%exclude %{_libdir}/vpp_api_test_plugins
Ed Warnickecb9cada2015-12-08 15:45:58 -0700373%{_libdir}/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100374/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700375
Damjan Marioncb034b92016-12-28 18:38:59 +0100376%files api-lua
Gabriel Gannef3854e92017-01-17 10:00:54 +0100377%defattr(644,root,root,644)
Damjan Marioncb034b92016-12-28 18:38:59 +0100378/usr/share/doc/vpp/examples/lua
379
Ian Wells13cef0c2019-08-09 17:27:19 -0700380%files api-python3
381%defattr(644,root,root,755)
Thomas F Herbertca3d38a2019-04-22 17:35:03 -0400382%{python3_sitelib}/vpp_*
Ole Troan57c3d662016-09-12 22:00:32 +0200383
Billy McFall28cf3b72018-01-15 17:54:52 -0500384%files selinux-policy
385%defattr(-,root,root,0755)
386%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
387%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
388
Ed Warnickecb9cada2015-12-08 15:45:58 -0700389%files devel
390%defattr(-,bin,bin)
391/usr/bin/vppapigen
Oliver Gilesdc203712019-12-05 23:37:36 +0200392/usr/bin/vapi_c_gen.py
393/usr/bin/vapi_cpp_gen.py
394/usr/bin/vapi_json_parser.py
Ed Warnickecb9cada2015-12-08 15:45:58 -0700395%{_includedir}/*
396/usr/share/doc/vpp/examples/sample-plugin
Ole Troan9d420872017-10-12 13:06:35 +0200397/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700398
Ed Warnickef5a14362016-09-12 20:40:24 +0000399%files plugins
400%defattr(-,bin,bin)
Ed Warnickee7637e72016-09-14 16:58:33 -0700401/usr/lib/vpp_plugins/*
402/usr/lib/vpp_api_test_plugins/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100403/usr/share/vpp/api/*