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