rhel: Add '--with dpdk' spec option to build DPDK-enabled packages
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 28 Jan 2016 12:23:52 +0000 (14:23 +0200)
committerBen Pfaff <blp@ovn.org>
Sat, 6 Feb 2016 00:40:11 +0000 (16:40 -0800)
Requires DPDK >= 2.2 as that is the first version to have a standard
install layout which we can discover without help from user.
Additionally document the option in INSTALL.Fedora.md.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
INSTALL.Fedora.md
rhel/openvswitch-fedora.spec.in

index af55feb..09defec 100644 (file)
@@ -62,6 +62,9 @@ $HOME/rpmbuild/SOURCES.
 
    This produces one RPM: "openvswitch".
 
+   To enable DPDK support in the resulting openvswitch package,
+   add `--with dpdk` to the build command.
+
    The above command automatically runs the Open vSwitch unit tests.
    To disable the unit tests, run:
 
index e655665..704b6bb 100644 (file)
@@ -16,6 +16,8 @@
 # If libcap-ng isn't available and there is no need for running OVS
 # as regular user, specify the '--without libcapng'
 %bcond_without libcapng
+# To enable DPDK support, specify '--with dpdk' when building
+%bcond_with dpdk
 
 # Enable PIE, bz#955181
 %global _hardened_build 1
@@ -49,6 +51,10 @@ BuildRequires: procps-ng
 %if %{with libcapng}
 BuildRequires: libcap-ng libcap-ng-devel
 %endif
+%if %{with dpdk}
+BuildRequires: dpdk-devel >= 2.2.0
+Provides: %{name}-dpdk = %{version}-%{release}
+%endif
 
 Requires: openssl iproute module-init-tools
 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
@@ -117,6 +123,9 @@ overlays and security groups.
        --enable-libcapng \
 %else
        --disable-libcapng \
+%endif
+%if %{with dpdk}
+       --with-dpdk=$(dirname %{_datadir}/dpdk/*/.config) \
 %endif
        --enable-ssl \
        --with-pkidir=%{_sharedstatedir}/openvswitch/pki