blob: 69d4d6b1cb162b4f5cf8085dbde58180623c3676 [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
Ole Troan57c3d662016-09-12 22:00:32 +020013# Failsafe backport of Python2-macros for RHEL <= 6
14%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
15%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
16%{!?python_version: %global python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}
17%{!?__python2: %global __python2 %{__python}}
18%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
19%{!?python2_sitearch: %global python2_sitearch %{python_sitearch}}
20%{!?python2_version: %global python2_version %{python_version}}
21
22%{!?python2_minor_version: %define python2_minor_version %(%{__python} -c "import sys ; print sys.version[2:3]")}
23
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +030024%{?systemd_requires}
25
Billy McFall28cf3b72018-01-15 17:54:52 -050026
27# SELinux Related definitions
28%global selinuxtype targeted
29%global moduletype services
30%global modulenames vpp-custom
31
32# Usage: _format var format
33# Expand 'modulenames' into various formats as needed
34# Format must contain '$x' somewhere to do anything useful
35%global _format() export %1=""; for x in %{modulenames}; do %1+=%2; %1+=" "; done;
36
37# Relabel files
38%global relabel_files() \ # ADD files in *.fc file
39
40# Version of distribution SELinux policy package
41%global selinux_policyver 3.13.1-128.6.fc22
42
43
Ed Warnickecb9cada2015-12-08 15:45:58 -070044Name: vpp
45Summary: Vector Packet Processing
Billy McFallf6e3ad02017-07-05 09:33:30 -040046License: ASL 2.0
Ed Warnickecb9cada2015-12-08 15:45:58 -070047Version: %{_version}
48Release: %{_release}
Billy McFall28cf3b72018-01-15 17:54:52 -050049Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python
Damjan Mariona1bd0232016-12-19 19:08:11 +010050BuildRequires: systemd, chrpath
Thomas F Herberte4128912017-10-09 15:03:55 -040051BuildRequires: check, check-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040052%if 0%{?fedora} >= 26
Thomas F Herbert66731782018-03-05 17:21:56 -050053BuildRequires: subunit, subunit-devel
Thomas F Herbert440751b2017-09-11 08:58:23 -040054BuildRequires: compat-openssl10-devel
Thomas F Herbert61686232018-05-03 19:17:13 -040055BuildRequires: python2-devel, python2-virtualenv, python2-ply
Thomas F Herbert5f56c092018-04-05 16:09:58 -040056BuildRequires: mbedtls-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040057%else
58%if 0%{?fedora} == 25
Thomas F Herbert66731782018-03-05 17:21:56 -050059BuildRequires: subunit, subunit-devel
Thomas F Herbert440751b2017-09-11 08:58:23 -040060BuildRequires: openssl-devel
Thomas F Herbert61686232018-05-03 19:17:13 -040061BuildRequires: python-devel, python2-virtualenv, python2-ply
Thomas F Herbert5f56c092018-04-05 16:09:58 -040062BuildRequires: mbedtls-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040063%else
Thomas F Herbert440751b2017-09-11 08:58:23 -040064BuildREquires: openssl-devel
Thomas F Herbert61686232018-05-03 19:17:13 -040065BuildRequires: python-devel, python-virtualenv, python-ply
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040066%endif
67%endif
Thomas F Herbert440751b2017-09-11 08:58:23 -040068BuildRequires: libffi-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040069BuildRequires: glibc-static, java-1.8.0-openjdk, java-1.8.0-openjdk-devel yum-utils, redhat-lsb
70BuildRequires: apr-devel
Thomas F Herbertbd8e2422017-08-03 11:04:24 -040071BuildRequires: numactl-devel
72BuildRequires: autoconf automake libtool byacc bison flex
Neale Ranns2ea2e422017-11-07 05:20:16 -080073BuildRequires: boost boost-devel
Billy McFall28cf3b72018-01-15 17:54:52 -050074BuildRequires: selinux-policy selinux-policy-devel
Ed Warnickecb9cada2015-12-08 15:45:58 -070075
Thomas F Herbertb60f4962017-07-19 19:17:15 -040076Source: %{name}-%{_version}-%{_release}.tar.xz
77# Source: vpp-latest.tar.xz
Thomas F Herbert20a29c72016-10-13 18:36:50 -040078
Ed Warnickecb9cada2015-12-08 15:45:58 -070079%description
Damjan Marion08ff7e02016-01-20 13:45:36 +010080This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
81vpp - the vector packet engine
82vpp_api_test - vector packet engine API test tool
83vpp_json_test - vector packet engine JSON test tool
Ed Warnickecb9cada2015-12-08 15:45:58 -070084
85%package lib
86Summary: VPP libraries
87Group: System Environment/Libraries
Billy McFall28cf3b72018-01-15 17:54:52 -050088Requires: vpp-selinux-policy = %{_version}-%{_release}
Ed Warnickecb9cada2015-12-08 15:45:58 -070089
90%description lib
91This package contains the VPP shared libraries, including:
92vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
Ed Warnickecb9cada2015-12-08 15:45:58 -070093svm - vm library
94vlib - vector processing library
95vlib-api - binary API library
96vnet - network stack library
97
98%package devel
99Summary: VPP header files, static libraries
100Group: Development/Libraries
101Requires: vpp-lib
102
103%description devel
Thomas F Herbert3977a212016-10-01 18:09:33 -0400104This package contains the header files for VPP.
105Install this package if you want to write a
106program for compilation and linking with vpp lib.
107vlib
108vlibmemory
109vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc.
110vpp-api
111vppinfra
Ed Warnickecb9cada2015-12-08 15:45:58 -0700112
Ed Warnickef5a14362016-09-12 20:40:24 +0000113%package plugins
114Summary: Vector Packet Processing--runtime plugins
115Group: System Environment/Libraries
Gabriel Gannebf246df2018-01-18 11:00:17 +0100116Requires: vpp = %{_version}-%{_release} numactl-libs
Ed Warnickef5a14362016-09-12 20:40:24 +0000117%description plugins
118This package contains VPP plugins
119
Damjan Marioncb034b92016-12-28 18:38:59 +0100120%package api-lua
121Summary: VPP api lua bindings
122Group: Development/Libraries
123Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
124
125%description api-lua
126This package contains the lua bindings for the vpp api
127
128%package api-java
129Summary: VPP api java bindings
130Group: Development/Libraries
131Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}
132
133%description api-java
134This package contains the java bindings for the vpp api
135
136%package api-python
Ole Troan57c3d662016-09-12 22:00:32 +0200137Summary: VPP api python bindings
138Group: Development/Libraries
Ole Troanc60f5572017-03-17 09:54:51 +0100139Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, python-setuptools libffi-devel
Ole Troan57c3d662016-09-12 22:00:32 +0200140
Damjan Marioncb034b92016-12-28 18:38:59 +0100141%description api-python
Ole Troan57c3d662016-09-12 22:00:32 +0200142This package contains the python bindings for the vpp api
143
Billy McFall28cf3b72018-01-15 17:54:52 -0500144%package selinux-policy
145Summary: VPP Security-Enhanced Linux (SELinux) policy
146Group: System Environment/Base
147Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, policycoreutils-python libselinux-utils
148
149%description selinux-policy
150This package contains a tailored VPP SELinux policy
151
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400152%prep
Thomas F Herbertb42b77b2018-04-06 15:13:41 -0400153%setup -q -n %{name}-%{_version}
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
Thomas F Herbert4b0ac822017-08-29 16:07:51 -0400160%if %{with aesni}
161 make bootstrap
162 make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
163%else
164 make bootstrap AESNI=n
165 make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
166%endif
Ole Troanc60f5572017-03-17 09:54:51 +0100167cd %{_mu_build_dir}/../src/vpp-api/python && %py2_build
Billy McFall28cf3b72018-01-15 17:54:52 -0500168cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile
Ole Troanc60f5572017-03-17 09:54:51 +0100169
Ed Warnickecb9cada2015-12-08 15:45:58 -0700170%install
171#
172# binaries
173#
174mkdir -p -m755 %{buildroot}%{_bindir}
175mkdir -p -m755 %{buildroot}%{_unitdir}
Gabriel Ganne714968b2017-01-26 15:42:39 +0100176install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir}
Ole Troanf14e3bf2016-12-01 21:49:03 +0100177
Damjan Marion7cd468a2016-12-19 23:05:39 +0100178# api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100179mkdir -p -m755 %{buildroot}/usr/share/vpp/api
Ole Troanf14e3bf2016-12-01 21:49:03 +0100180
Ed Warnickecb9cada2015-12-08 15:45:58 -0700181#
182# configs
183#
184mkdir -p -m755 %{buildroot}/etc/vpp
Miroslav Miklus8e08e742016-10-11 13:35:26 +0200185mkdir -p -m755 %{buildroot}/etc/sysctl.d
Thomas F Herbert5b75b6b2017-07-23 17:21:46 -0400186install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir}
Damjan Mariond0f673e2017-01-31 17:29:33 +0100187install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf
Damjan Marion7cd468a2016-12-19 23:05:39 +0100188install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d
Ed Warnickecb9cada2015-12-08 15:45:58 -0700189#
190# libraries
191#
192mkdir -p -m755 %{buildroot}%{_libdir}
Padraig Connolly69915cb2017-01-10 17:10:39 +0000193mkdir -p -m755 %{buildroot}/etc/bash_completion.d
194mkdir -p -m755 %{buildroot}/usr/share/vpp
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400195for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*.*' -print )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700196do
197 install -p -m 755 $file %{buildroot}%{_libdir}
198done
199for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///')
200do
201 # make lib symlinks
202 ( cd %{buildroot}%{_libdir} &&
203 ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') )
Ed Warnickef5a0e732016-09-07 17:12:52 +0000204 ( cd %{buildroot}%{_libdir} &&
205 ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700206done
Damjan Marion7cd468a2016-12-19 23:05:39 +0100207for 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 +0100208do
209 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
210done
Padraig Connolly69915cb2017-01-10 17:10:39 +0000211install -p -m 644 %{_mu_build_dir}/../src/scripts/vppctl_completion %{buildroot}/etc/bash_completion.d
212install -p -m 644 %{_mu_build_dir}/../src/scripts/vppctl-cmd-list %{buildroot}/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700213
Damjan Marioncb034b92016-12-28 18:38:59 +0100214# Lua bindings
215mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli
216mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400217# for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .)
218for 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 +0100219do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400220 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \
221 %{buildroot}/usr/share/doc/vpp/examples/lua/$file )
Damjan Marioncb034b92016-12-28 18:38:59 +0100222done
223
224# Java bindings
225mkdir -p -m755 %{buildroot}/usr/share/java
Damjan Marioncc4a5e82018-07-30 16:10:14 +0200226for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/japi/share/java -type f -name '*.jar' -print )
Damjan Marioncb034b92016-12-28 18:38:59 +0100227do
228 install -p -m 644 $file %{buildroot}/usr/share/java
229done
230
Ole Troan57c3d662016-09-12 22:00:32 +0200231# Python bindings
Ole Troanc60f5572017-03-17 09:54:51 +0100232cd %{_mu_build_dir}/../src/vpp-api/python && %py2_install
Ole Troan57c3d662016-09-12 22:00:32 +0200233
Billy McFall28cf3b72018-01-15 17:54:52 -0500234# SELinux Policy
235# Install SELinux interfaces
236%_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if
237install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
238install -p -m 644 $INTERFACES \
239 %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
240
241# Install policy modules
242%_format MODULES %{_mu_build_dir}/../extras/selinux/$x.pp
243install -d %{buildroot}%{_datadir}/selinux/packages
244install -m 0644 $MODULES \
245 %{buildroot}%{_datadir}/selinux/packages
246
Ed Warnickecb9cada2015-12-08 15:45:58 -0700247#
248# devel
249#
Thomas F Herbert20a29c72016-10-13 18:36:50 -0400250for 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 -0700251do
252 for subdir in $(cd ${dir} && find . -type d -print)
253 do
254 mkdir -p -m755 %{buildroot}/usr/include/${subdir}
255 done
256 for file in $(cd ${dir} && find . -type f -print)
257 do
258 install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file
259 done
260done
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700261
262mkdir -p -m755 %{buildroot}%{python2_sitelib}/jvppgen
Damjan Marioncc4a5e82018-07-30 16:10:14 +0200263install -p -m755 %{_mu_build_dir}/../extras/japi/java/jvpp/gen/jvpp_gen.py %{buildroot}/usr/bin
264for i in $(ls %{_mu_build_dir}/../extras/japi/java/jvpp/gen/jvppgen/*.py); do
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700265 install -p -m666 ${i} %{buildroot}%{python2_sitelib}/jvppgen
266done;
267
Jon Loeliger190282c2018-01-31 09:45:11 -0600268install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/C.py %{buildroot}/usr/share/vpp
269install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/JSON.py %{buildroot}/usr/share/vpp
270
Ed Warnickecb9cada2015-12-08 15:45:58 -0700271# sample plugin
272mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400273#for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .)
274for 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 -0700275do
Thomas F Herbertbd8e2422017-08-03 11:04:24 -0400276 ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \
277 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file )
Ed Warnickecb9cada2015-12-08 15:45:58 -0700278done
279
Billy McFall28cf3b72018-01-15 17:54:52 -0500280# vppctl sockfile directory
281mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp
282# vpp.log directory
283mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp
Ed Warnickef5a14362016-09-12 20:40:24 +0000284
285#
286# vpp-plugins
287#
Ed Warnickee7637e72016-09-14 16:58:33 -0700288mkdir -p -m755 %{buildroot}/usr/lib/vpp_plugins
289mkdir -p -m755 %{buildroot}/usr/lib/vpp_api_test_plugins
Damjan Marion7cd468a2016-12-19 23:05:39 +0100290for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_plugins && find -type f -print)
291do
292 install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_plugins/$file \
293 %{buildroot}/usr/lib/vpp_plugins/$file
294done
295
Damjan Marion7cd468a2016-12-19 23:05:39 +0100296for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_api_test_plugins && find -type f -print)
297do
298 install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_api_test_plugins/$file \
299 %{buildroot}/usr/lib/vpp_api_test_plugins/$file
300done
301
Ole Troanf14e3bf2016-12-01 21:49:03 +0100302for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/plugins -type f -name '*.api.json' -print )
303do
304 install -p -m 644 $file %{buildroot}/usr/share/vpp/api
305done
306
Damjan Mariona1bd0232016-12-19 19:08:11 +0100307#
308# remove RPATH from ELF binaries
309#
310%{_mu_build_dir}/scripts/remove-rpath %{buildroot}
311
Ed Warnickecb9cada2015-12-08 15:45:58 -0700312%post
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200313if [ $1 -eq 1 ] ; then
314 sysctl --system
315fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700316%systemd_post vpp.service
317
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300318%preun
319%systemd_preun vpp.service
320
Billy McFall28cf3b72018-01-15 17:54:52 -0500321%post selinux-policy
322%_format MODULES %{_datadir}/selinux/packages/$x.pp
Billy McFall28cf3b72018-01-15 17:54:52 -0500323if %{_sbindir}/selinuxenabled ; then
Matthew Smith7c172cb2018-02-22 21:12:11 -0600324 %{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES
Billy McFall28cf3b72018-01-15 17:54:52 -0500325 %{_sbindir}/load_policy
326 %relabel_files
327fi
328
329
Ed Warnickecb9cada2015-12-08 15:45:58 -0700330%postun
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300331%systemd_postun
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200332if [ $1 -eq 0 ] ; then
333 echo "Uninstalling, unbind user-mode PCI drivers"
334 # Unbind user-mode PCI drivers
335 removed=
336 pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
337 for d in $pci_dirs; do
338 for f in ${d}/*; do
339 [ -e "${f}/config" ] || continue
340 echo ${f##*/} > ${d}/unbind
341 basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
342 removed=y
343 done
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300344 done
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200345 if [ -n "${removed}" ]; then
346 echo "There are changes in PCI drivers, rescaning"
347 echo 1 > /sys/bus/pci/rescan
348 else
349 echo "There weren't PCI devices binded"
350 fi
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300351else
Kristina Nevolnikova8ae18732017-06-21 14:20:42 +0200352 echo "Upgrading package, dont' unbind interfaces"
Peter Ginchevdfa9c5b2016-10-11 15:34:24 +0300353fi
Ed Warnickecb9cada2015-12-08 15:45:58 -0700354
Billy McFall28cf3b72018-01-15 17:54:52 -0500355%postun selinux-policy
356if [ $1 -eq 0 ]; then
357 %{_sbindir}/semodule -n -r %{modulenames}
358 if %{_sbindir}/selinuxenabled ; then
359 %{_sbindir}/load_policy
360 %relabel_files
361 fi
362fi
363
Ed Warnickecb9cada2015-12-08 15:45:58 -0700364%files
365%defattr(-,bin,bin)
366%{_unitdir}/vpp.service
Damjan Marion08ff7e02016-01-20 13:45:36 +0100367/usr/bin/vpp*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700368/usr/bin/svm*
Dave Barach0e5e3c32016-01-25 08:28:22 -0500369/usr/bin/elftool
Billy McFallce41a5c2017-09-08 20:11:58 +0000370%config(noreplace) /etc/sysctl.d/80-vpp.conf
371%config(noreplace) /etc/vpp/startup.conf
Ole Troanf14e3bf2016-12-01 21:49:03 +0100372/usr/share/vpp/api/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700373
Billy McFall28cf3b72018-01-15 17:54:52 -0500374%defattr(-,root,vpp)
375%{_localstatedir}/run/vpp*
376
377%defattr(-,root,root)
378%{_localstatedir}/log/vpp*
379
Ed Warnickecb9cada2015-12-08 15:45:58 -0700380%files lib
381%defattr(-,bin,bin)
Igor Mikhailov (imichail)3b854a52018-05-18 20:08:26 -0700382%global __requires_exclude_from %{_libdir}/librte_pmd_mlx[45]_glue\\.so.*$
Ed Warnickef5a14362016-09-12 20:40:24 +0000383%exclude %{_libdir}/vpp_plugins
384%exclude %{_libdir}/vpp_api_test_plugins
Ed Warnickecb9cada2015-12-08 15:45:58 -0700385%{_libdir}/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100386/usr/share/vpp/api/*
Padraig Connolly69915cb2017-01-10 17:10:39 +0000387/etc/bash_completion.d/vppctl_completion
388/usr/share/vpp/vppctl-cmd-list
Ed Warnickecb9cada2015-12-08 15:45:58 -0700389
Damjan Marioncb034b92016-12-28 18:38:59 +0100390%files api-lua
Gabriel Gannef3854e92017-01-17 10:00:54 +0100391%defattr(644,root,root,644)
Damjan Marioncb034b92016-12-28 18:38:59 +0100392/usr/share/doc/vpp/examples/lua
393
394%files api-java
395%defattr(644,root,root)
396/usr/share/java/*
397
398%files api-python
Ole Troan57c3d662016-09-12 22:00:32 +0200399%defattr(644,root,root)
Ole Troana7564e82018-06-12 21:06:44 +0200400%{python2_sitelib}/vpp_*
Ole Troan57c3d662016-09-12 22:00:32 +0200401
Billy McFall28cf3b72018-01-15 17:54:52 -0500402%files selinux-policy
403%defattr(-,root,root,0755)
404%attr(0644,root,root) %{_datadir}/selinux/packages/*.pp
405%attr(0644,root,root) %{_datadir}/selinux/devel/include/%{moduletype}/*.if
406
Ed Warnickecb9cada2015-12-08 15:45:58 -0700407%files devel
408%defattr(-,bin,bin)
409/usr/bin/vppapigen
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700410/usr/bin/jvpp_gen.py
Ed Warnickecb9cada2015-12-08 15:45:58 -0700411%{_includedir}/*
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700412%{python2_sitelib}/jvppgen/*
Ed Warnickecb9cada2015-12-08 15:45:58 -0700413/usr/share/doc/vpp/examples/sample-plugin
Ole Troan9d420872017-10-12 13:06:35 +0200414/usr/share/vpp
Ed Warnicke406ab9d2016-08-31 18:48:47 -0700415
Ed Warnickef5a14362016-09-12 20:40:24 +0000416%files plugins
417%defattr(-,bin,bin)
Ed Warnickee7637e72016-09-14 16:58:33 -0700418/usr/lib/vpp_plugins/*
419/usr/lib/vpp_api_test_plugins/*
Ole Troanf14e3bf2016-12-01 21:49:03 +0100420/usr/share/vpp/api/*