Thomas F Herbert | 4b0ac82 | 2017-08-29 16:07:51 -0400 | [diff] [blame] | 1 | %bcond_without aesni |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 2 | %define _vpp_build_dir build-tool-native |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 3 | %define _unitdir /lib/systemd/system |
| 4 | %define _topdir %(pwd) |
| 5 | %define _builddir %{_topdir} |
Thomas F Herbert | 5349f94 | 2017-09-13 15:26:46 -0400 | [diff] [blame] | 6 | %define _tmp_build_dir %{name}-%{_version}.0 |
| 7 | %define _mu_build_dir %{_topdir}/%{_tmp_build_dir}/build-root |
Igor Mikhailov (imichail) | c442e61 | 2017-05-18 19:46:17 -0700 | [diff] [blame] | 8 | %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 Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 13 | |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 14 | # 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 Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 25 | %{?systemd_requires} |
| 26 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 27 | Name: vpp |
| 28 | Summary: Vector Packet Processing |
Billy McFall | f6e3ad0 | 2017-07-05 09:33:30 -0400 | [diff] [blame] | 29 | License: ASL 2.0 |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 30 | Version: %{_version} |
| 31 | Release: %{_release} |
Padraig | b21b676 | 2016-09-21 14:59:02 +0100 | [diff] [blame] | 32 | Requires: vpp-lib = %{_version}-%{_release}, net-tools, pciutils, python |
Damjan Marion | a1bd023 | 2016-12-19 19:08:11 +0100 | [diff] [blame] | 33 | BuildRequires: systemd, chrpath |
Thomas F Herbert | e412891 | 2017-10-09 15:03:55 -0400 | [diff] [blame] | 34 | BuildRequires: check, check-devel |
| 35 | %if 0%{?fedora} >= 25 |
| 36 | BuildRequires: subunit, subunit-devel |
| 37 | %endif |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 38 | %if 0%{?fedora} >= 26 |
Thomas F Herbert | 440751b | 2017-09-11 08:58:23 -0400 | [diff] [blame] | 39 | BuildRequires: compat-openssl10-devel |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 40 | BuildRequires: python2-devel, python2-virtualenv |
| 41 | %else |
| 42 | %if 0%{?fedora} == 25 |
Thomas F Herbert | 440751b | 2017-09-11 08:58:23 -0400 | [diff] [blame] | 43 | BuildRequires: openssl-devel |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 44 | BuildRequires: python-devel, python2-virtualenv |
| 45 | %else |
Thomas F Herbert | 440751b | 2017-09-11 08:58:23 -0400 | [diff] [blame] | 46 | BuildREquires: openssl-devel |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 47 | BuildRequires: python-devel, python-virtualenv |
| 48 | %endif |
| 49 | %endif |
Thomas F Herbert | 440751b | 2017-09-11 08:58:23 -0400 | [diff] [blame] | 50 | BuildRequires: libffi-devel |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 51 | BuildRequires: glibc-static, java-1.8.0-openjdk, java-1.8.0-openjdk-devel yum-utils, redhat-lsb |
| 52 | BuildRequires: apr-devel |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 53 | BuildRequires: numactl-devel |
| 54 | BuildRequires: autoconf automake libtool byacc bison flex |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 55 | |
Thomas F Herbert | b60f496 | 2017-07-19 19:17:15 -0400 | [diff] [blame] | 56 | Source: %{name}-%{_version}-%{_release}.tar.xz |
| 57 | # Source: vpp-latest.tar.xz |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 58 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 59 | %description |
Damjan Marion | 08ff7e0 | 2016-01-20 13:45:36 +0100 | [diff] [blame] | 60 | This package provides VPP executables: vpp, vpp_api_test, vpp_json_test |
| 61 | vpp - the vector packet engine |
| 62 | vpp_api_test - vector packet engine API test tool |
| 63 | vpp_json_test - vector packet engine JSON test tool |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 64 | |
| 65 | %package lib |
| 66 | Summary: VPP libraries |
| 67 | Group: System Environment/Libraries |
| 68 | |
| 69 | %description lib |
| 70 | This package contains the VPP shared libraries, including: |
| 71 | vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting. |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 72 | svm - vm library |
| 73 | vlib - vector processing library |
| 74 | vlib-api - binary API library |
| 75 | vnet - network stack library |
| 76 | |
| 77 | %package devel |
| 78 | Summary: VPP header files, static libraries |
| 79 | Group: Development/Libraries |
| 80 | Requires: vpp-lib |
| 81 | |
| 82 | %description devel |
Thomas F Herbert | 3977a21 | 2016-10-01 18:09:33 -0400 | [diff] [blame] | 83 | This package contains the header files for VPP. |
| 84 | Install this package if you want to write a |
| 85 | program for compilation and linking with vpp lib. |
| 86 | vlib |
| 87 | vlibmemory |
| 88 | vnet - devices, classify, dhcp, ethernet flow, gre, ip, etc. |
| 89 | vpp-api |
| 90 | vppinfra |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 91 | |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 92 | %package plugins |
| 93 | Summary: Vector Packet Processing--runtime plugins |
| 94 | Group: System Environment/Libraries |
| 95 | Requires: vpp = %{_version}-%{_release} |
| 96 | %description plugins |
| 97 | This package contains VPP plugins |
| 98 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 99 | %package api-lua |
| 100 | Summary: VPP api lua bindings |
| 101 | Group: Development/Libraries |
| 102 | Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release} |
| 103 | |
| 104 | %description api-lua |
| 105 | This package contains the lua bindings for the vpp api |
| 106 | |
| 107 | %package api-java |
| 108 | Summary: VPP api java bindings |
| 109 | Group: Development/Libraries |
| 110 | Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release} |
| 111 | |
| 112 | %description api-java |
| 113 | This package contains the java bindings for the vpp api |
| 114 | |
| 115 | %package api-python |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 116 | Summary: VPP api python bindings |
| 117 | Group: Development/Libraries |
Ole Troan | c60f557 | 2017-03-17 09:54:51 +0100 | [diff] [blame] | 118 | Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, python-setuptools libffi-devel |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 119 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 120 | %description api-python |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 121 | This package contains the python bindings for the vpp api |
| 122 | |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 123 | %prep |
Thomas F Herbert | 5349f94 | 2017-09-13 15:26:46 -0400 | [diff] [blame] | 124 | # Unpack into dir with longer name as work around of debugedit bug in in rpm-build 4.13 |
| 125 | rm -rf %{name}-%{_version} |
Thomas F Herbert | 41988e5 | 2017-10-09 14:50:08 -0400 | [diff] [blame] | 126 | rm -rf %{_tmp_build_dir} |
Thomas F Herbert | 5349f94 | 2017-09-13 15:26:46 -0400 | [diff] [blame] | 127 | /usr/bin/xz -dc '%{_sourcedir}/%{name}-%{_version}-%{_release}.tar.xz' | /usr/bin/tar -xf - |
| 128 | mv %{name}-%{_version} %{_tmp_build_dir} |
| 129 | cd '%{_tmp_build_dir}' |
| 130 | /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 131 | |
Ed Warnicke | ec6290a | 2016-06-08 17:15:08 -0500 | [diff] [blame] | 132 | %pre |
| 133 | # Add the vpp group |
Ed Warnicke | b10427e | 2016-06-08 19:49:40 -0500 | [diff] [blame] | 134 | groupadd -f -r vpp |
Ed Warnicke | ec6290a | 2016-06-08 17:15:08 -0500 | [diff] [blame] | 135 | |
Ole Troan | c60f557 | 2017-03-17 09:54:51 +0100 | [diff] [blame] | 136 | %build |
Thomas F Herbert | 5349f94 | 2017-09-13 15:26:46 -0400 | [diff] [blame] | 137 | cd '%{_tmp_build_dir}' |
Thomas F Herbert | 4b0ac82 | 2017-08-29 16:07:51 -0400 | [diff] [blame] | 138 | %if %{with aesni} |
| 139 | make bootstrap |
| 140 | make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages |
| 141 | %else |
| 142 | make bootstrap AESNI=n |
| 143 | make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages |
| 144 | %endif |
Ole Troan | c60f557 | 2017-03-17 09:54:51 +0100 | [diff] [blame] | 145 | cd %{_mu_build_dir}/../src/vpp-api/python && %py2_build |
| 146 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 147 | %install |
| 148 | # |
| 149 | # binaries |
| 150 | # |
| 151 | mkdir -p -m755 %{buildroot}%{_bindir} |
| 152 | mkdir -p -m755 %{buildroot}%{_unitdir} |
Gabriel Ganne | 714968b | 2017-01-26 15:42:39 +0100 | [diff] [blame] | 153 | 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] | 154 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 155 | # api |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 156 | mkdir -p -m755 %{buildroot}/usr/share/vpp/api |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 157 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 158 | # |
| 159 | # configs |
| 160 | # |
| 161 | mkdir -p -m755 %{buildroot}/etc/vpp |
Miroslav Miklus | 8e08e74 | 2016-10-11 13:35:26 +0200 | [diff] [blame] | 162 | mkdir -p -m755 %{buildroot}/etc/sysctl.d |
Thomas F Herbert | 5b75b6b | 2017-07-23 17:21:46 -0400 | [diff] [blame] | 163 | 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] | 164 | 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] | 165 | 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] | 166 | # |
| 167 | # libraries |
| 168 | # |
| 169 | mkdir -p -m755 %{buildroot}%{_libdir} |
Padraig Connolly | 69915cb | 2017-01-10 17:10:39 +0000 | [diff] [blame] | 170 | mkdir -p -m755 %{buildroot}/etc/bash_completion.d |
| 171 | mkdir -p -m755 %{buildroot}/usr/share/vpp |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 172 | 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] | 173 | do |
| 174 | install -p -m 755 $file %{buildroot}%{_libdir} |
| 175 | done |
| 176 | for file in $(cd %{buildroot}%{_libdir} && find . -type f -print | sed -e 's/^\.\///') |
| 177 | do |
| 178 | # make lib symlinks |
| 179 | ( cd %{buildroot}%{_libdir} && |
| 180 | ln -fs $file $(echo $file | sed -e 's/\(\.so\.[0-9]\+\).*/\1/') ) |
Ed Warnicke | f5a0e73 | 2016-09-07 17:12:52 +0000 | [diff] [blame] | 181 | ( cd %{buildroot}%{_libdir} && |
| 182 | ln -fs $file $(echo $file | sed -e 's/\(\.so\)\.[0-9]\+.*/\1/') ) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 183 | done |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 184 | 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] | 185 | do |
| 186 | install -p -m 644 $file %{buildroot}/usr/share/vpp/api |
| 187 | done |
Padraig Connolly | 69915cb | 2017-01-10 17:10:39 +0000 | [diff] [blame] | 188 | install -p -m 644 %{_mu_build_dir}/../src/scripts/vppctl_completion %{buildroot}/etc/bash_completion.d |
| 189 | install -p -m 644 %{_mu_build_dir}/../src/scripts/vppctl-cmd-list %{buildroot}/usr/share/vpp |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 190 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 191 | # Lua bindings |
| 192 | mkdir -p -m755 %{buildroot}/usr/share/doc/vpp/examples/lua/examples/cli |
| 193 | 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] | 194 | # for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && git ls-files .) |
| 195 | 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] | 196 | do |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 197 | ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/vpp-api/lua && install -p -m 644 $file \ |
| 198 | %{buildroot}/usr/share/doc/vpp/examples/lua/$file ) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 199 | done |
| 200 | |
| 201 | # Java bindings |
| 202 | mkdir -p -m755 %{buildroot}/usr/share/java |
| 203 | for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/vpp/share/java -type f -name '*.jar' -print ) |
| 204 | do |
| 205 | install -p -m 644 $file %{buildroot}/usr/share/java |
| 206 | done |
| 207 | |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 208 | # Python bindings |
Ole Troan | c60f557 | 2017-03-17 09:54:51 +0100 | [diff] [blame] | 209 | cd %{_mu_build_dir}/../src/vpp-api/python && %py2_install |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 210 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 211 | # |
| 212 | # devel |
| 213 | # |
Thomas F Herbert | 20a29c7 | 2016-10-13 18:36:50 -0400 | [diff] [blame] | 214 | for dir in $(find %{_mu_build_dir}/%{_vpp_install_dir}/*/include/ -maxdepth 0 -type d -print | grep -v dpdk) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 215 | do |
| 216 | for subdir in $(cd ${dir} && find . -type d -print) |
| 217 | do |
| 218 | mkdir -p -m755 %{buildroot}/usr/include/${subdir} |
| 219 | done |
| 220 | for file in $(cd ${dir} && find . -type f -print) |
| 221 | do |
| 222 | install -p -m 644 $dir/$file %{buildroot}%{_includedir}/$file |
| 223 | done |
| 224 | done |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 225 | |
| 226 | mkdir -p -m755 %{buildroot}%{python2_sitelib}/jvppgen |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 227 | install -p -m755 %{_mu_build_dir}/../src/vpp-api/java/jvpp/gen/jvpp_gen.py %{buildroot}/usr/bin |
| 228 | for i in $(ls %{_mu_build_dir}/../src/vpp-api/java/jvpp/gen/jvppgen/*.py); do |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 229 | install -p -m666 ${i} %{buildroot}%{python2_sitelib}/jvppgen |
| 230 | done; |
| 231 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 232 | # sample plugin |
| 233 | 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] | 234 | #for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && git ls-files .) |
| 235 | 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] | 236 | do |
Thomas F Herbert | bd8e242 | 2017-08-03 11:04:24 -0400 | [diff] [blame] | 237 | ( cd %{_mu_build_dir}/%{_vpp_install_dir}/../../src/examples/sample-plugin && install -p -m 644 $file \ |
| 238 | %{buildroot}/usr/share/doc/vpp/examples/sample-plugin/$file ) |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 239 | done |
| 240 | |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 241 | |
| 242 | # |
| 243 | # vpp-plugins |
| 244 | # |
Ed Warnicke | e7637e7 | 2016-09-14 16:58:33 -0700 | [diff] [blame] | 245 | mkdir -p -m755 %{buildroot}/usr/lib/vpp_plugins |
| 246 | mkdir -p -m755 %{buildroot}/usr/lib/vpp_api_test_plugins |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 247 | for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_plugins && find -type f -print) |
| 248 | do |
| 249 | install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_plugins/$file \ |
| 250 | %{buildroot}/usr/lib/vpp_plugins/$file |
| 251 | done |
| 252 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 253 | for file in $(cd %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_api_test_plugins && find -type f -print) |
| 254 | do |
| 255 | install -p -m 644 %{_mu_build_dir}/%{_vpp_install_dir}/vpp/lib64/vpp_api_test_plugins/$file \ |
| 256 | %{buildroot}/usr/lib/vpp_api_test_plugins/$file |
| 257 | done |
| 258 | |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 259 | for file in $(find %{_mu_build_dir}/%{_vpp_install_dir}/plugins -type f -name '*.api.json' -print ) |
| 260 | do |
| 261 | install -p -m 644 $file %{buildroot}/usr/share/vpp/api |
| 262 | done |
| 263 | |
Damjan Marion | a1bd023 | 2016-12-19 19:08:11 +0100 | [diff] [blame] | 264 | # |
| 265 | # remove RPATH from ELF binaries |
| 266 | # |
| 267 | %{_mu_build_dir}/scripts/remove-rpath %{buildroot} |
| 268 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 269 | %post |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 270 | if [ $1 -eq 1 ] ; then |
| 271 | sysctl --system |
| 272 | fi |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 273 | %systemd_post vpp.service |
| 274 | |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 275 | %preun |
| 276 | %systemd_preun vpp.service |
| 277 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 278 | %postun |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 279 | %systemd_postun |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 280 | if [ $1 -eq 0 ] ; then |
| 281 | echo "Uninstalling, unbind user-mode PCI drivers" |
| 282 | # Unbind user-mode PCI drivers |
| 283 | removed= |
| 284 | pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci` |
| 285 | for d in $pci_dirs; do |
| 286 | for f in ${d}/*; do |
| 287 | [ -e "${f}/config" ] || continue |
| 288 | echo ${f##*/} > ${d}/unbind |
| 289 | basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}` |
| 290 | removed=y |
| 291 | done |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 292 | done |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 293 | if [ -n "${removed}" ]; then |
| 294 | echo "There are changes in PCI drivers, rescaning" |
| 295 | echo 1 > /sys/bus/pci/rescan |
| 296 | else |
| 297 | echo "There weren't PCI devices binded" |
| 298 | fi |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 299 | else |
Kristina Nevolnikova | 8ae1873 | 2017-06-21 14:20:42 +0200 | [diff] [blame] | 300 | echo "Upgrading package, dont' unbind interfaces" |
Peter Ginchev | dfa9c5b | 2016-10-11 15:34:24 +0300 | [diff] [blame] | 301 | fi |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 302 | |
| 303 | %files |
| 304 | %defattr(-,bin,bin) |
| 305 | %{_unitdir}/vpp.service |
Damjan Marion | 08ff7e0 | 2016-01-20 13:45:36 +0100 | [diff] [blame] | 306 | /usr/bin/vpp* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 307 | /usr/bin/svm* |
Dave Barach | 0e5e3c3 | 2016-01-25 08:28:22 -0500 | [diff] [blame] | 308 | /usr/bin/elftool |
Billy McFall | ce41a5c | 2017-09-08 20:11:58 +0000 | [diff] [blame] | 309 | %config(noreplace) /etc/sysctl.d/80-vpp.conf |
| 310 | %config(noreplace) /etc/vpp/startup.conf |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 311 | /usr/share/vpp/api/* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 312 | |
| 313 | %files lib |
| 314 | %defattr(-,bin,bin) |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 315 | %exclude %{_libdir}/vpp_plugins |
| 316 | %exclude %{_libdir}/vpp_api_test_plugins |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 317 | %{_libdir}/* |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 318 | /usr/share/vpp/api/* |
Padraig Connolly | 69915cb | 2017-01-10 17:10:39 +0000 | [diff] [blame] | 319 | /etc/bash_completion.d/vppctl_completion |
| 320 | /usr/share/vpp/vppctl-cmd-list |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 321 | |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 322 | %files api-lua |
Gabriel Ganne | f3854e9 | 2017-01-17 10:00:54 +0100 | [diff] [blame] | 323 | %defattr(644,root,root,644) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 324 | /usr/share/doc/vpp/examples/lua |
| 325 | |
| 326 | %files api-java |
| 327 | %defattr(644,root,root) |
| 328 | /usr/share/java/* |
| 329 | |
| 330 | %files api-python |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 331 | %defattr(644,root,root) |
Ole Troan | c60f557 | 2017-03-17 09:54:51 +0100 | [diff] [blame] | 332 | %{python2_sitelib}/vpp_papi* |
Ole Troan | 57c3d66 | 2016-09-12 22:00:32 +0200 | [diff] [blame] | 333 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 334 | %files devel |
| 335 | %defattr(-,bin,bin) |
| 336 | /usr/bin/vppapigen |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 337 | /usr/bin/jvpp_gen.py |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 338 | %{_includedir}/* |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 339 | %{python2_sitelib}/jvppgen/* |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 340 | /usr/share/doc/vpp/examples/sample-plugin |
Ed Warnicke | 406ab9d | 2016-08-31 18:48:47 -0700 | [diff] [blame] | 341 | |
Ed Warnicke | f5a1436 | 2016-09-12 20:40:24 +0000 | [diff] [blame] | 342 | %files plugins |
| 343 | %defattr(-,bin,bin) |
Ed Warnicke | e7637e7 | 2016-09-14 16:58:33 -0700 | [diff] [blame] | 344 | /usr/lib/vpp_plugins/* |
| 345 | /usr/lib/vpp_api_test_plugins/* |
Ole Troan | f14e3bf | 2016-12-01 21:49:03 +0100 | [diff] [blame] | 346 | /usr/share/vpp/api/* |