dpdk plugin depends on numactl-libs
[vpp.git] / extras / rpm / vpp.spec
index 439e6bd..8487f06 100644 (file)
@@ -1,8 +1,10 @@
+%bcond_without aesni
+%{!?_topdir:%define _topdir %(pwd)}
 %define _vpp_build_dir   build-tool-native
 %define _unitdir         /lib/systemd/system
-%define _topdir          %(pwd)
 %define _builddir        %{_topdir}
-%define _mu_build_dir    %{_topdir}/%{name}-%{_version}/build-root
+%define _tmp_build_dir   %{name}-%{_version}.0
+%define _mu_build_dir    %{_topdir}/%{_tmp_build_dir}/build-root
 %define _vpp_tag        %{getenv:TAG}
 %if "%{_vpp_tag}" == ""
 %define _vpp_tag        vpp
@@ -29,21 +31,26 @@ Version: %{_version}
 Release: %{_release}
 Requires: vpp-lib = %{_version}-%{_release}, net-tools, pciutils, python
 BuildRequires: systemd, chrpath
-BuildRequires: libffi-devel, openssl-devel
+BuildRequires: check, check-devel
+BuildRequires: subunit, subunit-devel
 %if 0%{?fedora} >= 26
+BuildRequires: compat-openssl10-devel
 BuildRequires: python2-devel, python2-virtualenv
 %else
 %if 0%{?fedora} == 25
+BuildRequires: openssl-devel
 BuildRequires: python-devel, python2-virtualenv
 %else
+BuildREquires: openssl-devel
 BuildRequires: python-devel, python-virtualenv
 %endif
 %endif
+BuildRequires: libffi-devel
 BuildRequires: glibc-static, java-1.8.0-openjdk, java-1.8.0-openjdk-devel yum-utils, redhat-lsb
 BuildRequires: apr-devel
-BuildRequires: nasm
 BuildRequires: numactl-devel
 BuildRequires: autoconf automake libtool byacc bison flex
+BuildRequires: boost boost-devel
 
 Source: %{name}-%{_version}-%{_release}.tar.xz
 # Source: vpp-latest.tar.xz
@@ -84,7 +91,7 @@ vppinfra
 %package plugins
 Summary: Vector Packet Processing--runtime plugins
 Group: System Environment/Libraries
-Requires: vpp = %{_version}-%{_release}
+Requires: vpp = %{_version}-%{_release} numactl-libs
 %description plugins
 This package contains VPP plugins
 
@@ -113,15 +120,27 @@ Requires: vpp = %{_version}-%{_release}, vpp-lib = %{_version}-%{_release}, pyth
 This package contains the python bindings for the vpp api
 
 %prep
-%setup -q -n %{name}-%{_version}
+# Unpack into dir with longer name as work around of debugedit bug in in rpm-build 4.13
+rm -rf %{name}-%{_version}
+rm -rf %{_tmp_build_dir}
+/usr/bin/xz -dc '%{_sourcedir}/%{name}-%{_version}-%{_release}.tar.xz' | /usr/bin/tar -xf -
+mv %{name}-%{_version} %{_tmp_build_dir}
+cd '%{_tmp_build_dir}'
+/usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
 
 %pre
 # Add the vpp group
 groupadd -f -r vpp
 
 %build
-make bootstrap
-make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
+cd '%{_tmp_build_dir}'
+%if %{with aesni}
+    make bootstrap
+    make -C build-root PLATFORM=vpp TAG=%{_vpp_tag} install-packages
+%else
+    make bootstrap AESNI=n
+    make -C build-root PLATFORM=vpp AESNI=n TAG=%{_vpp_tag} install-packages
+%endif
 cd %{_mu_build_dir}/../src/vpp-api/python && %py2_build
 
 %install
@@ -286,8 +305,8 @@ fi
 /usr/bin/vpp*
 /usr/bin/svm*
 /usr/bin/elftool
-%config /etc/sysctl.d/80-vpp.conf
-%config /etc/vpp/startup.conf
+%config(noreplace) /etc/sysctl.d/80-vpp.conf
+%config(noreplace) /etc/vpp/startup.conf
 /usr/share/vpp/api/*
 
 %files lib