Thomas F Herbert | 4b0ac82 | 2017-08-29 16:07:51 -0400 | [diff] [blame] | 1 | %bcond_without aesni |
Renato Botelho do Couto | e266ea3 | 2017-11-30 15:41:22 -0600 | [diff] [blame] | 2 | %{!?_topdir:%define _topdir %(pwd)} |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 3 | %define _vpp_build_dir build-tool-native |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 4 | %define _unitdir /lib/systemd/system |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 5 | %define _builddir %{_topdir} |
Thomas F Herbert | b42b77b | 2018-04-06 15:13:41 -0400 | [diff] [blame] | 6 | %define _mu_build_dir %{_topdir}/%{name}-%{_version}/build-root |
Igor Mikhailov (imichail) | c442e61 | 2017-05-18 19:46:17 -0700 | [diff] [blame] | 7 | %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 Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 12 | |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 13 | %{?systemd_requires} |
| 14 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 15 | |
| 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 Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 33 | Name: vpp |
| 34 | Summary: Vector Packet Processing |
Billy McFall | f6e3ad0 | 2017-07-05 09:33:30 -0400 | [diff] [blame] | 35 | License: ASL 2.0 |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 36 | Version: %{_version} |
| 37 | Release: %{_release} |
Damjan Marion | a1bd023 | 2016-12-19 19:08:11 +0100 | [diff] [blame] | 38 | BuildRequires: systemd, chrpath |
Thomas F Herbert | e412891 | 2017-10-09 15:03:55 -0400 | [diff] [blame] | 39 | BuildRequires: check, check-devel |
Thomas F Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 40 | BuildRequires: mbedtls-devel mbedtls |
Thomas F Herbert | 6eb6163 | 2018-11-27 15:57:30 -0500 | [diff] [blame] | 41 | %if 0%{?fedora} |
Ian Wells | 13cef0c | 2019-08-09 17:27:19 -0700 | [diff] [blame] | 42 | Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils |
Thomas F Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 43 | Requires: compat-openssl10 |
Dave Wallace | bfcd239 | 2021-11-30 11:00:23 -0500 | [diff] [blame] | 44 | Requires: mbedtls libffi-devel |
Thomas F Herbert | 6673178 | 2018-03-05 17:21:56 -0500 | [diff] [blame] | 45 | BuildRequires: subunit, subunit-devel |
Thomas F Herbert | 440751b | 2017-09-11 08:58:23 -0400 | [diff] [blame] | 46 | BuildRequires: compat-openssl10-devel |
Ian Wells | 13cef0c | 2019-08-09 17:27:19 -0700 | [diff] [blame] | 47 | BuildRequires: python, python-devel, python-virtualenv, python-ply |
| 48 | BuildRequires: python3, python36-devel, python3-virtualenv |
Thomas F Herbert | 6eb6163 | 2018-11-27 15:57:30 -0500 | [diff] [blame] | 49 | BuildRequires: cmake |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 50 | %else |
Renato Botelho do Couto | c025329 | 2019-11-07 06:10:34 -0600 | [diff] [blame] | 51 | %if 0%{rhel} >= 7 |
Thomas F Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 52 | Requires: vpp-lib = %{_version}-%{_release}, vpp-selinux-policy = %{_version}-%{_release}, net-tools, pciutils, python36 |
Dave Wallace | bfcd239 | 2021-11-30 11:00:23 -0500 | [diff] [blame] | 53 | Requires: mbedtls libffi-devel |
Thomas F Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 54 | BuildRequires: epel-release |
| 55 | BuildRequires: mbedtls-devel mbedtls |
Thomas F Herbert | 440751b | 2017-09-11 08:58:23 -0400 | [diff] [blame] | 56 | BuildREquires: openssl-devel |
Thomas F Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 57 | BuildRequires: python36-devel |
Renato Botelho do Couto | c025329 | 2019-11-07 06:10:34 -0600 | [diff] [blame] | 58 | %if 0%{rhel} == 7 |
Damjan Marion | 162330f | 2020-04-29 21:28:15 +0200 | [diff] [blame] | 59 | BuildRequires: devtoolset-9-toolchain |
Thomas F Herbert | 6eb6163 | 2018-11-27 15:57:30 -0500 | [diff] [blame] | 60 | BuildRequires: cmake3 |
Renato Botelho do Couto | c025329 | 2019-11-07 06:10:34 -0600 | [diff] [blame] | 61 | BuildRequires: glibc-static, yum-utils |
| 62 | %else |
| 63 | BuildRequires: cmake |
| 64 | BuildRequires: dnf-utils |
| 65 | %endif |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 66 | %endif |
| 67 | %endif |
Thomas F Herbert | 440751b | 2017-09-11 08:58:23 -0400 | [diff] [blame] | 68 | BuildRequires: libffi-devel |
Renato Botelho do Couto | c025329 | 2019-11-07 06:10:34 -0600 | [diff] [blame] | 69 | BuildRequires: redhat-lsb |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 70 | BuildRequires: apr-devel |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 71 | BuildRequires: numactl-devel |
| 72 | BuildRequires: autoconf automake libtool byacc bison flex |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 73 | BuildRequires: selinux-policy selinux-policy-devel |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 74 | |
Thomas F Herbert | b60f496 | 2017-07-19 19:17:15 -0400 | [diff] [blame] | 75 | Source: %{name}-%{_version}-%{_release}.tar.xz |
| 76 | # Source: vpp-latest.tar.xz |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 77 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 78 | %description |
Damjan Marion | 08ff7e0 | 2016-01-20 13:45:36 +0100 | [diff] [blame] | 79 | This package provides VPP executables: vpp, vpp_api_test, vpp_json_test |
| 80 | vpp - the vector packet engine |
| 81 | vpp_api_test - vector packet engine API test tool |
| 82 | vpp_json_test - vector packet engine JSON test tool |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 83 | |
| 84 | %package lib |
| 85 | Summary: VPP libraries |
| 86 | Group: System Environment/Libraries |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 87 | Requires: vpp-selinux-policy = %{_version}-%{_release} |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 88 | |
| 89 | %description lib |
| 90 | This package contains the VPP shared libraries, including: |
| 91 | vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting. |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 92 | svm - vm library |
| 93 | vlib - vector processing library |
| 94 | vlib-api - binary API library |
| 95 | vnet - network stack library |
| 96 | |
| 97 | %package devel |
| 98 | Summary: VPP header files, static libraries |
| 99 | Group: Development/Libraries |
| 100 | Requires: vpp-lib |
| 101 | |
| 102 | %description devel |
Thomas F Herbert | 3977a21 | 2016-10-01 18:09:33 -0400 | [diff] [blame] | 103 | This package contains the header files for VPP. |
| 104 | Install this package if you want to write a |
| 105 | program for compilation and linking with vpp lib. |
| 106 | vlib |
| 107 | vlibmemory |
| 108 | vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc. |
| 109 | vpp-api |
| 110 | vppinfra |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 111 | |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 112 | %package plugins |
| 113 | Summary: Vector Packet Processing--runtime plugins |
| 114 | Group: System Environment/Libraries |
Gabriel Ganne | bf246df | 2018-01-18 11:00:17 +0100 | [diff] [blame] | 115 | Requires: vpp = %{_version}-%{_release} numactl-libs |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 116 | %description plugins |
| 117 | This package contains VPP plugins |
| 118 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 119 | %package api-lua |
| 120 | Summary: VPP api lua bindings |
| 121 | Group: Development/Libraries |
| 122 | Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release} |
| 123 | |
| 124 | %description api-lua |
| 125 | This package contains the lua bindings for the vpp api |
| 126 | |
Ian Wells | 13cef0c | 2019-08-09 17:27:19 -0700 | [diff] [blame] | 127 | %package api-python3 |
| 128 | Summary: VPP api python3 bindings |
| 129 | Group: Development/Libraries |
| 130 | Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, libffi-devel |
Yichen Wang | 466872f | 2020-06-30 23:14:23 -0700 | [diff] [blame] | 131 | Requires: python3-setuptools |
Ian Wells | 13cef0c | 2019-08-09 17:27:19 -0700 | [diff] [blame] | 132 | |
| 133 | %description api-python3 |
| 134 | This package contains the python3 bindings for the vpp api |
| 135 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 136 | %package selinux-policy |
| 137 | Summary: VPP Security-Enhanced Linux (SELinux) policy |
| 138 | Group: System Environment/Base |
Renato Botelho do Couto | 1d94ab5 | 2020-03-06 13:42:22 -0600 | [diff] [blame] | 139 | Requires(post): selinux-policy-base >= %{selinux_policyver}, selinux-policy-targeted >= %{selinux_policyver}, policycoreutils, libselinux-utils |
| 140 | %if 0%{rhel} < 8 |
| 141 | Requires(post): policycoreutils-python |
| 142 | %else |
| 143 | Requires(post): python3-policycoreutils |
| 144 | %endif |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 145 | |
| 146 | %description selinux-policy |
| 147 | This package contains a tailored VPP SELinux policy |
| 148 | |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 149 | %prep |
Dave Wallace | 27b50fe | 2020-09-16 21:04:24 +0000 | [diff] [blame] | 150 | %setup -q -c -T -n %{name}-%{_version} |
| 151 | cd .. |
| 152 | unxz --stdout ./SOURCES/%{name}-%{_version}-%{_release}.tar.xz | tar --extract --touch |
| 153 | cd - |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 154 | |
Ed Warnicke | ec6290a | 2016-06-08 17:15:08 -0500 | [diff] [blame] | 155 | %pre |
| 156 | # Add the vpp group |
Ed Warnicke | b10427e | 2016-06-08 19:49:40 -0500 | [diff] [blame] | 157 | groupadd -f -r vpp |
Ed Warnicke | ec6290a | 2016-06-08 17:15:08 -0500 | [diff] [blame] | 158 | |
Ole Troan | c60f557 | 2017-03-17 09:54:51 +0100 | [diff] [blame] | 159 | %build |
Renato Botelho do Couto | c025329 | 2019-11-07 06:10:34 -0600 | [diff] [blame] | 160 | %if 0%{rhel} < 8 |
Damjan Marion | 162330f | 2020-04-29 21:28:15 +0200 | [diff] [blame] | 161 | . /opt/rh/devtoolset-9/enable |
Thomas F Herbert | 6eb6163 | 2018-11-27 15:57:30 -0500 | [diff] [blame] | 162 | %endif |
Thomas F Herbert | 4b0ac82 | 2017-08-29 16:07:51 -0400 | [diff] [blame] | 163 | %if %{with aesni} |
Dave Wallace | 27b50fe | 2020-09-16 21:04:24 +0000 | [diff] [blame] | 164 | make install-dep |
Thomas F Herbert | 4b0ac82 | 2017-08-29 16:07:51 -0400 | [diff] [blame] | 165 | 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 Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 170 | cd %{_mu_build_dir}/../src/vpp-api/python && %py3_build |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 171 | cd %{_mu_build_dir}/../extras/selinux && make -f %{_datadir}/selinux/devel/Makefile |
Ole Troan | c60f557 | 2017-03-17 09:54:51 +0100 | [diff] [blame] | 172 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 173 | %install |
| 174 | # |
| 175 | # binaries |
| 176 | # |
| 177 | mkdir -p -m755 %{buildroot}%{_bindir} |
| 178 | mkdir -p -m755 %{buildroot}%{_unitdir} |
Gabriel Ganne | 714968b | 2017-01-26 15:42:39 +0100 | [diff] [blame] | 179 | install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/bin/* %{buildroot}%{_bindir} |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 180 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 181 | # api |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 182 | mkdir -p -m755 %{buildroot}/usr/share/vpp/api |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 183 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 184 | # |
| 185 | # configs |
| 186 | # |
| 187 | mkdir -p -m755 %{buildroot}/etc/vpp |
Miroslav Miklus | 8e08e74 | 2016-10-11 13:35:26 +0200 | [diff] [blame] | 188 | mkdir -p -m755 %{buildroot}/etc/sysctl.d |
Thomas F Herbert | 5b75b6b | 2017-07-23 17:21:46 -0400 | [diff] [blame] | 189 | install -p -m 644 %{_mu_build_dir}/../extras/rpm/vpp.service %{buildroot}%{_unitdir} |
Damjan Marion | d0f673e | 2017-01-31 17:29:33 +0100 | [diff] [blame] | 190 | install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/startup.conf %{buildroot}/etc/vpp/startup.conf |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 191 | install -p -m 644 %{_mu_build_dir}/../src/vpp/conf/80-vpp.conf %{buildroot}/etc/sysctl.d |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 192 | # |
| 193 | # libraries |
| 194 | # |
| 195 | mkdir -p -m755 %{buildroot}%{_libdir} |
Padraig Connolly | 69915cb | 2017-01-10 17:10:39 +0000 | [diff] [blame] | 196 | mkdir -p -m755 %{buildroot}/etc/bash_completion.d |
| 197 | mkdir -p -m755 %{buildroot}/usr/share/vpp |
Matthew Smith | d790c7e | 2018-09-06 10:59:49 -0500 | [diff] [blame] | 198 | for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/lib* -type f -name '*.so.*.*' -print ) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 199 | do |
| 200 | install -p -m 755 $file %{buildroot}%{_libdir} |
| 201 | done |
| 202 | for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///') |
| 203 | do |
| 204 | # make lib symlinks |
| 205 | ( cd %{buildroot}%{_libdir} && |
| 206 | ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') ) |
Ed Warnicke | f5a0e73 | 2016-09-07 17:12:52 +0000 | [diff] [blame] | 207 | ( cd %{buildroot}%{_libdir} && |
| 208 | ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') ) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 209 | done |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 210 | for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/vpp/api -type f -name '*.api.json' -print ) |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 211 | do |
| 212 | install -p -m 644 $file %{buildroot}/usr/share/vpp/api |
| 213 | done |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 214 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 215 | # Lua bindings |
| 216 | mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli |
| 217 | mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/lute |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 218 | # for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .) |
| 219 | for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && find . -type f -regex '.*/*.[luteamd]' -print | sed -e 's/^\.\///') |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 220 | do |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 221 | ( 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 Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 223 | done |
| 224 | |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 225 | # Python bindings |
Thomas F Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 226 | cd %{_mu_build_dir}/../src/vpp-api/python && %py3_install |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 227 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 228 | # SELinux Policy |
| 229 | # Install SELinux interfaces |
| 230 | %_format INTERFACES %{_mu_build_dir}/../extras/selinux/$x.if |
| 231 | install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype} |
| 232 | install -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 |
| 237 | install -d %{buildroot}%{_datadir}/selinux/packages |
| 238 | install -m 0644 $MODULES \ |
| 239 | %{buildroot}%{_datadir}/selinux/packages |
| 240 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 241 | # |
| 242 | # devel |
| 243 | # |
Damjan Marion | 8c1afb5 | 2020-10-16 15:28:47 +0200 | [diff] [blame] | 244 | for dir in %{_mu_build_dir}/%{_vpp_install_dir}/vpp/include/ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 245 | do |
| 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 |
| 254 | done |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 255 | |
Paul Vinciguerra | 9ce6a21 | 2018-09-12 13:40:13 -0700 | [diff] [blame] | 256 | install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_c.py %{buildroot}/usr/share/vpp |
| 257 | install -p -m 644 %{_mu_build_dir}/../src/tools/vppapigen/vppapigen_json.py %{buildroot}/usr/share/vpp |
Jon Loeliger | 190282c | 2018-01-31 09:45:11 -0600 | [diff] [blame] | 258 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 259 | # sample plugin |
| 260 | mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/sample |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 261 | #for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .) |
| 262 | for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && find . -type f -regex '.*/*.[acdhimp]' -print | sed -e 's/^\.\///') |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 263 | do |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 264 | ( 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 Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 266 | done |
| 267 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 268 | # vppctl sockfile directory |
| 269 | mkdir -p -m755 %{buildroot}%{_localstatedir}/run/vpp |
| 270 | # vpp.log directory |
| 271 | mkdir -p -m755 %{buildroot}%{_localstatedir}/log/vpp |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 272 | |
| 273 | # |
| 274 | # vpp-plugins |
Damjan Marion | 79dcbc7 | 2018-09-12 14:01:10 +0200 | [diff] [blame] | 275 | # |
Ed Warnicke | e7637e7 | 2016-09-14 16:58:33 -0700 | [diff] [blame] | 276 | mkdir -p -m755 %{buildroot}/usr/lib/vpp_plugins |
| 277 | mkdir -p -m755 %{buildroot}/usr/lib/vpp_api_test_plugins |
Tianyu Li | fa6e7aa | 2021-09-28 13:00:16 +0800 | [diff] [blame] | 278 | for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins && find -type f -print) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 279 | do |
Tianyu Li | fa6e7aa | 2021-09-28 13:00:16 +0800 | [diff] [blame] | 280 | install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_plugins/$file \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 281 | %{buildroot}/usr/lib/vpp_plugins/$file |
| 282 | done |
| 283 | |
Tianyu Li | fa6e7aa | 2021-09-28 13:00:16 +0800 | [diff] [blame] | 284 | for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_api_test_plugins && find -type f -print) |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 285 | do |
Tianyu Li | fa6e7aa | 2021-09-28 13:00:16 +0800 | [diff] [blame] | 286 | install -p -m 755 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/%{_lib}/vpp_api_test_plugins/$file \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 287 | %{buildroot}/usr/lib/vpp_api_test_plugins/$file |
| 288 | done |
| 289 | |
Mohsin Kazmi | 7b2017d | 2018-09-26 10:49:41 +0200 | [diff] [blame] | 290 | for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/vpp/api/plugins -type f -name '*.api.json' -print ) |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 291 | do |
Matthew Smith | 4ed0039 | 2019-03-05 09:28:48 -0600 | [diff] [blame] | 292 | install -p -m 755 $file %{buildroot}/usr/share/vpp/api |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 293 | done |
| 294 | |
Damjan Marion | a1bd023 | 2016-12-19 19:08:11 +0100 | [diff] [blame] | 295 | # |
| 296 | # remove RPATH from ELF binaries |
| 297 | # |
| 298 | %{_mu_build_dir}/scripts/remove-rpath %{buildroot} |
| 299 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 300 | %post |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 301 | if [ $1 -eq 1 ] ; then |
| 302 | sysctl --system |
| 303 | fi |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 304 | %systemd_post vpp.service |
| 305 | |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 306 | %preun |
| 307 | %systemd_preun vpp.service |
| 308 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 309 | %post selinux-policy |
| 310 | %_format MODULES %{_datadir}/selinux/packages/$x.pp |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 311 | if %{_sbindir}/selinuxenabled ; then |
Matthew Smith | 7c172cb | 2018-02-22 21:12:11 -0600 | [diff] [blame] | 312 | %{_sbindir}/semodule -n -X 400 -s %{selinuxtype} -i $MODULES |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 313 | %{_sbindir}/load_policy |
| 314 | %relabel_files |
| 315 | fi |
| 316 | |
| 317 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 318 | %postun |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 319 | %systemd_postun |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 320 | if [ $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 Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 332 | done |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 333 | 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 Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 339 | else |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 340 | echo "Upgrading package, dont' unbind interfaces" |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 341 | fi |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 342 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 343 | %postun selinux-policy |
| 344 | if [ $1 -eq 0 ]; then |
| 345 | %{_sbindir}/semodule -n -r %{modulenames} |
| 346 | if %{_sbindir}/selinuxenabled ; then |
| 347 | %{_sbindir}/load_policy |
| 348 | %relabel_files |
| 349 | fi |
| 350 | fi |
| 351 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 352 | %files |
| 353 | %defattr(-,bin,bin) |
| 354 | %{_unitdir}/vpp.service |
Matthew Smith | 48a13f3 | 2021-08-19 15:47:06 -0500 | [diff] [blame] | 355 | /usr/bin/vat2 |
Damjan Marion | 08ff7e0 | 2016-01-20 13:45:36 +0100 | [diff] [blame] | 356 | /usr/bin/vpp* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 357 | /usr/bin/svm* |
Billy McFall | ce41a5c | 2017-09-08 20:11:58 +0000 | [diff] [blame] | 358 | %config(noreplace) /etc/sysctl.d/80-vpp.conf |
| 359 | %config(noreplace) /etc/vpp/startup.conf |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 360 | /usr/share/vpp/api/* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 361 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 362 | %defattr(-,root,vpp) |
| 363 | %{_localstatedir}/run/vpp* |
| 364 | |
| 365 | %defattr(-,root,root) |
| 366 | %{_localstatedir}/log/vpp* |
| 367 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 368 | %files lib |
| 369 | %defattr(-,bin,bin) |
Igor Mikhailov (imichail) | 3b854a5 | 2018-05-18 20:08:26 -0700 | [diff] [blame] | 370 | %global __requires_exclude_from %{_libdir}/librte_pmd_mlx[45]_glue\\.so.*$ |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 371 | %exclude %{_libdir}/vpp_plugins |
| 372 | %exclude %{_libdir}/vpp_api_test_plugins |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 373 | %{_libdir}/* |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 374 | /usr/share/vpp/api/* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 375 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 376 | %files api-lua |
Gabriel Ganne | f3854e9 | 2017-01-17 10:00:54 +0100 | [diff] [blame] | 377 | %defattr(644,root,root,644) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 378 | /usr/share/doc/vpp/examples/lua |
| 379 | |
Ian Wells | 13cef0c | 2019-08-09 17:27:19 -0700 | [diff] [blame] | 380 | %files api-python3 |
| 381 | %defattr(644,root,root,755) |
Thomas F Herbert | ca3d38a | 2019-04-22 17:35:03 -0400 | [diff] [blame] | 382 | %{python3_sitelib}/vpp_* |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 383 | |
Billy McFall | 28cf3b7 | 2018-01-15 17:54:52 -0500 | [diff] [blame] | 384 | %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 Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 389 | %files devel |
| 390 | %defattr(-,bin,bin) |
| 391 | /usr/bin/vppapigen |
Oliver Giles | dc20371 | 2019-12-05 23:37:36 +0200 | [diff] [blame] | 392 | /usr/bin/vapi_c_gen.py |
| 393 | /usr/bin/vapi_cpp_gen.py |
| 394 | /usr/bin/vapi_json_parser.py |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 395 | %{_includedir}/* |
| 396 | /usr/share/doc/vpp/examples/sample-plugin |
Ole Troan | 9d42087 | 2017-10-12 13:06:35 +0200 | [diff] [blame] | 397 | /usr/share/vpp |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 398 | |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 399 | %files plugins |
| 400 | %defattr(-,bin,bin) |
Ed Warnicke | e7637e7 | 2016-09-14 16:58:33 -0700 | [diff] [blame] | 401 | /usr/lib/vpp_plugins/* |
| 402 | /usr/lib/vpp_api_test_plugins/* |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 403 | /usr/share/vpp/api/* |