blob: fe4f3d8399989d3d7bc4322717147cb76bd27e85 [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 Herbert5349f942017-09-13 15:26:46 -04006%define _tmp_build_dir %{name}-%{_version}.0
7%define _mu_build_dir %{_topdir}/%{_tmp_build_dir}/build-root
Igor Mikhailov (imichail)c442e612017-05-18 19:46:17 -07008%define _vpp_tag %{getenv:TAG}
9%if "%{_vpp_tag}" == ""
10%define _vpp_tag vpp
11%endif
12%define _vpp_install_dir install-%{_vpp_tag}-native
Ed Warnickecb9cada2015-12-08 15:45:58 -070013
Ole Troan57c3d662016-09-12 22:00:32 +020014# Failsafe backport of Python2-macros for RHEL <= 6
15%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
16%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
17%{!?python_version: %global python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
18%{!?__python2: %global __python2 %{__python}}
19%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
20%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}}
21%{!?python2_version: %global python2_version %{python_version}}
22
23%{!?python2_minor_version: %define python2_minor_version %(%{__python} -c "import sys ; print sys.version[2:3]")}
24
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +030025%{?systemd_requires}
26
Billy McFall28cf3b72018-01-15 17:54:52 -050027
28# SELinux Related definitions
29%global selinuxtype targeted
30%global moduletype services
31%global modulenames vpp-custom
32
33# Usage: _format var format
34# Expand 'modulenames' into various formats as needed
35# Format must contain '$x' somewhere to do anything useful
36%global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done;
37
38# Relabel files
39%global relabel_files() \ # ADD files in *.fc file
40
41# Version of distribution SELinux policy package
42%global selinux_policyver 3.13.1-128.6.fc22
43
44
Ed Warnickecb9cada2015-12-08 15:45:58 -070045Name: vpp
46Summary: Vector Packet Processing
Billy McFallf6e3ad02017-07-05 09:33:30 -040047License: ASL 2.0
Ed Warnickecb9cada2015-12-08 15:45:58 -070048Version: %{_version}
49Release: %{_release}
Billy McFall28cf3b72018-01-15 17:54:52 -050050Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python
Damjan Mariona1bd0232016-12-19 19:08:11 +010051BuildRequires: systemd, chrpath
Thomas F Herberte4128912017-10-09 15:03:55 -040052BuildRequires: check, check-devel
Thomas F Herberte4128912017-10-09 15:03:55 -040053BuildRequires: subunit, subunit-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040054%if 0%{?fedora} >= 26
Thomas F Herbert440751b2017-09-11 08:58:23 -040055BuildRequires: compat-openssl10-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040056BuildRequires: python2-devel, python2-virtualenv
57%else
58%if 0%{?fedora} == 25
Thomas F Herbert440751b2017-09-11 08:58:23 -040059BuildRequires: openssl-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040060BuildRequires: python-devel, python2-virtualenv
61%else
Thomas F Herbert440751b2017-09-11 08:58:23 -040062BuildREquires: openssl-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040063BuildRequires: python-devel, python-virtualenv
64%endif
65%endif
Thomas F Herbert440751b2017-09-11 08:58:23 -040066BuildRequires: libffi-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040067BuildRequires: glibc-static, java-1.8.0-openjdk, java-1.8.0-openjdk-devel yum-utils, redhat-lsb
68BuildRequires: apr-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040069BuildRequires: numactl-devel
70BuildRequires: autoconf automake libtool byacc bison flex
Neale Ranns2ea2e422017-11-07 05:20:16 -080071BuildRequires: boost boost-devel
Billy McFall28cf3b72018-01-15 17:54:52 -050072BuildRequires: selinux-policy selinux-policy-devel
Matthew Smith30ec8212018-03-02 08:39:17 -060073BuildRequires: mbedtls-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
127%package api-java
128Summary: VPP api java bindings
129Group: Development/Libraries
130Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
131
132%description api-java
133This package contains the java bindings for the vpp api
134
135%package api-python
Ole Troan57c3d662016-09-12 22:00:32 +0200136Summary: VPP api python bindings
137Group: Development/Libraries
Ole Troanc60f5572017-03-17 09:54:51 +0100138Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, python-setuptools libffi-devel
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
Billy McFall28cf3b72018-01-15 17:54:52 -0500143%package selinux-policy
144Summary: VPP Security-Enhanced Linux (SELinux) policy
145Group: System Environment/Base
146Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, policycoreutils-python libselinux-utils
147
148%description selinux-policy
149This package contains a tailored VPP SELinux policy
150
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400151%prep
Thomas F Herbert5349f942017-09-13 15:26:46 -0400152# Unpack into dir with longer name as work around of debugedit bug in in rpm-build 4.13
153rm -rf %{name}-%{_version}
Thomas F Herbert41988e52017-10-09 14:50:08 -0400154rm -rf %{_tmp_build_dir}
Thomas F Herbert5349f942017-09-13 15:26:46 -0400155/usr/bin/xz -dc '%{_sourcedir}/%{name}-%{_version}-%{_release}.tar.xz' | /usr/bin/tar -xf -
156mv %{name}-%{_version} %{_tmp_build_dir}
157cd '%{_tmp_build_dir}'
158/usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400159
Ed Warnickeec6290a2016-06-08 17:15:08 -0500160%pre
161# Add the vpp group
Ed Warnickeb10427e2016-06-08 19:49:40 -0500162groupadd -f -r vpp
Ed Warnickeec6290a2016-06-08 17:15:08 -0500163
Ole Troanc60f5572017-03-17 09:54:51 +0100164%build
Thomas F Herbert5349f942017-09-13 15:26:46 -0400165cd '%{_tmp_build_dir}'
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400166%if %{with aesni}
167 make bootstrap
168 make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
169%else
170 make bootstrap AESNI=n
171 make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
172%endif
Ole Troanc60f5572017-03-17 09:54:51 +0100173cd %{_mu_build_dir}/../src/vpp-api/python && %py2_build
Billy McFall28cf3b72018-01-15 17:54:52 -0500174cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
Ole Troanc60f5572017-03-17 09:54:51 +0100175
Ed Warnickecb9cada2015-12-08 15:45:58 -0700176%install
177#
178# binaries
179#
180mkdir -p -m755 %{buildroot}%{_bindir}
181mkdir -p -m755 %{buildroot}%{_unitdir}
Gabriel Ganne714968b2017-01-26 15:42:39 +0100182install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir}
Ole Troanf14e3bf2016-12-01 21:49:03 +0100183
Damjan Marion7cd468a2016-12-19 23:05:39 +0100184# api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100185mkdir -p -m755 %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100186
Ed Warnickecb9cada2015-12-08 15:45:58 -0700187#
188# configs
189#
190mkdir -p -m755 %{buildroot}/etc/vpp
Miroslav Miklus8e08e742016-10-11 13:35:26 +0200191mkdir -p -m755 %{buildroot}/etc/sysctl.d
Thomas F Herbert5b75b6b2017-07-23 17:21:46 -0400192install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
Damjan Mariond0f673e2017-01-31 17:29:33 +0100193install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf
Damjan Marion7cd468a2016-12-19 23:05:39 +0100194install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
Ed Warnickecb9cada2015-12-08 15:45:58 -0700195#
196# libraries
197#
198mkdir -p -m755 %{buildroot}%{_libdir}
Padraig Connolly69915cb2017-01-10 17:10:39 +0000199mkdir -p -m755 %{buildroot}/etc/bash_completion.d
200mkdir -p -m755 %{buildroot}/usr/share/vpp
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400201for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700202do
203 install -p -m 755 $file %{buildroot}%{_libdir}
204done
205for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
206do
207 # make lib symlinks
208 ( cd %{buildroot}%{_libdir} &&
209 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
Ed Warnickef5a0e732016-09-07 17:12:52 +0000210 ( cd %{buildroot}%{_libdir} &&
211 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700212done
Damjan Marion7cd468a2016-12-19 23:05:39 +0100213for 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 +0100214do
215 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
216done
Padraig Connolly69915cb2017-01-10 17:10:39 +0000217install -p -m 644 %{_mu_build_dir}/../src/scripts/vppctl_completion %{buildroot}/etc/bash_completion.d
218install -p -m 644 %{_mu_build_dir}/../src/scripts/vppctl-cmd-list %{buildroot}/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700219
Damjan Marioncb034b92016-12-28 18:38:59 +0100220# Lua bindings
221mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli
222mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400223# for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
224for 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 +0100225do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400226 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \
227 %{buildroot}/usr/share/doc/vpp/examples/lua/$file )
Damjan Marioncb034b92016-12-28 18:38:59 +0100228done
229
230# Java bindings
231mkdir -p -m755 %{buildroot}/usr/share/java
232for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/java -type f -name '*.jar' -print )
233do
234 install -p -m 644 $file %{buildroot}/usr/share/java
235done
236
Ole Troan57c3d662016-09-12 22:00:32 +0200237# Python bindings
Ole Troanc60f5572017-03-17 09:54:51 +0100238cd %{_mu_build_dir}/../src/vpp-api/python && %py2_install
Ole Troan57c3d662016-09-12 22:00:32 +0200239
Billy McFall28cf3b72018-01-15 17:54:52 -0500240# SELinux Policy
241# Install SELinux interfaces
242%_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if
243install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
244install -p -m 644 $INTERFACES \
245 %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
246
247# Install policy modules
248%_format MODULES %{_mu_build_dir}/../extras/selinux/$x.pp
249install -d %{buildroot}%{_datadir}/selinux/packages
250install -m 0644 $MODULES \
251 %{buildroot}%{_datadir}/selinux/packages
252
Ed Warnickecb9cada2015-12-08 15:45:58 -0700253#
254# devel
255#
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400256for dir in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk)
Ed Warnickecb9cada2015-12-08 15:45:58 -0700257do
258 for subdir in $(cd ${dir} && find . -type d -print)
259 do
260 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
261 done
262 for file in $(cd ${dir} && find . -type f -print)
263 do
264 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
265 done
266done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700267
268mkdir -p -m755 %{buildroot}%{python2_sitelib}/jvppgen
Damjan Marioncb034b92016-12-28 18:38:59 +0100269install -p -m755 %{_mu_build_dir}/../src/vpp-api/java/jvpp/gen/jvpp_gen.py %{buildroot}/usr/bin
270for i in $(ls %{_mu_build_dir}/../src/vpp-api/java/jvpp/gen/jvppgen/*.py); do
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700271 install -p -m666 ${i} %{buildroot}%{python2_sitelib}/jvppgen
272done;
273
Jon Loeliger190282c2018-01-31 09:45:11 -0600274install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/C.py %{buildroot}/usr/share/vpp
275install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/JSON.py %{buildroot}/usr/share/vpp
276
Ed Warnickecb9cada2015-12-08 15:45:58 -0700277# sample plugin
278mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400279#for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .)
280for 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 -0700281do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400282 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \
283 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700284done
285
Billy McFall28cf3b72018-01-15 17:54:52 -0500286# vppctl sockfile directory
287mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp
288# vpp.log directory
289mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp
Ed Warnickef5a14362016-09-12 20:40:24 +0000290
291#
292# vpp-plugins
293#
Ed Warnickee7637e72016-09-14 16:58:33 -0700294mkdir -p -m755 %{buildroot}/usr/lib/vpp_plugins
295mkdir -p -m755 %{buildroot}/usr/lib/vpp_api_test_plugins
Damjan Marion7cd468a2016-12-19 23:05:39 +0100296for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_plugins && find -type f -print)
297do
298 install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_plugins/$file \
299 %{buildroot}/usr/lib/vpp_plugins/$file
300done
301
Damjan Marion7cd468a2016-12-19 23:05:39 +0100302for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_api_test_plugins && find -type f -print)
303do
304 install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_api_test_plugins/$file \
305 %{buildroot}/usr/lib/vpp_api_test_plugins/$file
306done
307
Ole Troanf14e3bf2016-12-01 21:49:03 +0100308for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/plugins -type f -name '*.api.json' -print )
309do
310 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
311done
312
Damjan Mariona1bd0232016-12-19 19:08:11 +0100313#
314# remove RPATH from ELF binaries
315#
316%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
317
Ed Warnickecb9cada2015-12-08 15:45:58 -0700318%post
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200319if [ $1 -eq 1 ] ; then
320 sysctl --system
321fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700322%systemd_post vpp.service
323
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300324%preun
325%systemd_preun vpp.service
326
Billy McFall28cf3b72018-01-15 17:54:52 -0500327%post selinux-policy
328%_format MODULES %{_datadir}/selinux/packages/$x.pp
Billy McFall28cf3b72018-01-15 17:54:52 -0500329if %{_sbindir}/selinuxenabled ; then
Matthew Smith7c172cb2018-02-22 21:12:11 -0600330 %{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES
Billy McFall28cf3b72018-01-15 17:54:52 -0500331 %{_sbindir}/load_policy
332 %relabel_files
333fi
334
335
Ed Warnickecb9cada2015-12-08 15:45:58 -0700336%postun
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300337%systemd_postun
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200338if [ $1 -eq 0 ] ; then
339 echo "Uninstalling, unbind user-mode PCI drivers"
340 # Unbind user-mode PCI drivers
341 removed=
342 pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
343 for d in $pci_dirs; do
344 for f in ${d}/*; do
345 [ -e "${f}/config" ] || continue
346 echo ${f##*/} > ${d}/unbind
347 basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
348 removed=y
349 done
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300350 done
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200351 if [ -n "${removed}" ]; then
352 echo "There are changes in PCI drivers, rescaning"
353 echo 1 > /sys/bus/pci/rescan
354 else
355 echo "There weren't PCI devices binded"
356 fi
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300357else
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200358 echo "Upgrading package, dont' unbind interfaces"
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300359fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700360
Billy McFall28cf3b72018-01-15 17:54:52 -0500361%postun selinux-policy
362if [ $1 -eq 0 ]; then
363 %{_sbindir}/semodule -n -r %{modulenames}
364 if %{_sbindir}/selinuxenabled ; then
365 %{_sbindir}/load_policy
366 %relabel_files
367 fi
368fi
369
Ed Warnickecb9cada2015-12-08 15:45:58 -0700370%files
371%defattr(-,bin,bin)
372%{_unitdir}/vpp.service
Damjan Marion08ff7e02016-01-20 13:45:36 +0100373/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700374/usr/bin/svm*
Dave Barach0e5e3c32016-01-25 08:28:22 -0500375/usr/bin/elftool
Billy McFallce41a5c2017-09-08 20:11:58 +0000376%config(noreplace) /etc/sysctl.d/80-vpp.conf
377%config(noreplace) /etc/vpp/startup.conf
Ole Troanf14e3bf2016-12-01 21:49:03 +0100378/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700379
Billy McFall28cf3b72018-01-15 17:54:52 -0500380%defattr(-,root,vpp)
381%{_localstatedir}/run/vpp*
382
383%defattr(-,root,root)
384%{_localstatedir}/log/vpp*
385
Ed Warnickecb9cada2015-12-08 15:45:58 -0700386%files lib
387%defattr(-,bin,bin)
Ed Warnickef5a14362016-09-12 20:40:24 +0000388%exclude %{_libdir}/vpp_plugins
389%exclude %{_libdir}/vpp_api_test_plugins
Ed Warnickecb9cada2015-12-08 15:45:58 -0700390%{_libdir}/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100391/usr/share/vpp/api/*
Padraig Connolly69915cb2017-01-10 17:10:39 +0000392/etc/bash_completion.d/vppctl_completion
393/usr/share/vpp/vppctl-cmd-list
Ed Warnickecb9cada2015-12-08 15:45:58 -0700394
Damjan Marioncb034b92016-12-28 18:38:59 +0100395%files api-lua
Gabriel Gannef3854e92017-01-17 10:00:54 +0100396%defattr(644,root,root,644)
Damjan Marioncb034b92016-12-28 18:38:59 +0100397/usr/share/doc/vpp/examples/lua
398
399%files api-java
400%defattr(644,root,root)
401/usr/share/java/*
402
403%files api-python
Ole Troan57c3d662016-09-12 22:00:32 +0200404%defattr(644,root,root)
Ole Troanc60f5572017-03-17 09:54:51 +0100405%{python2_sitelib}/vpp_papi*
Ole Troan57c3d662016-09-12 22:00:32 +0200406
Billy McFall28cf3b72018-01-15 17:54:52 -0500407%files selinux-policy
408%defattr(-,root,root,0755)
409%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
410%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
411
Ed Warnickecb9cada2015-12-08 15:45:58 -0700412%files devel
413%defattr(-,bin,bin)
414/usr/bin/vppapigen
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700415/usr/bin/jvpp_gen.py
Ed Warnickecb9cada2015-12-08 15:45:58 -0700416%{_includedir}/*
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700417%{python2_sitelib}/jvppgen/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700418/usr/share/doc/vpp/examples/sample-plugin
Ole Troan9d420872017-10-12 13:06:35 +0200419/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700420
Ed Warnickef5a14362016-09-12 20:40:24 +0000421%files plugins
422%defattr(-,bin,bin)
Ed Warnickee7637e72016-09-14 16:58:33 -0700423/usr/lib/vpp_plugins/*
424/usr/lib/vpp_api_test_plugins/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100425/usr/share/vpp/api/*