[ovs-dev] [PATCH] rhel: Add optional BuildRequires to libcap-ng

Flavio Leitner fbl at redhat.com
Thu Oct 1 22:31:09 UTC 2015

Commit e91b927d8 (lib/daemon: support --user option for all OVS daemon)
added optional usage of the libcap-ng library.  It's packaged in Fedora,
so go ahead and added it by default to the Fedora spec file.

Our default systemd unit files don't make use of the --user option that
requires this library, but conceivably someone may want to customize
them and use this option.

For those that don't want to use --user option, the Fedora package
offers an option (--without libcapng) to build the RPMs without it.

Signed-off-by: Flavio Leitner <fbl at redhat.com>
 rhel/openvswitch-fedora.spec.in | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 695f1d7..066086c 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -13,6 +13,10 @@
 #%define kernel
+# If libcap-ng isn't available and there is no need for running OVS
+# as regular user, specify the '--without libcapng'
+%bcond_without libcapng
 # Enable PIE, bz#955181
 %global _hardened_build 1
@@ -42,6 +46,9 @@ BuildRequires: desktop-file-utils
 BuildRequires: groff graphviz
 # make check dependencies
 BuildRequires: procps-ng
+%if %{with libcapng}
+BuildRequires: libcap-ng libcap-ng-devel
 Requires: openssl iproute module-init-tools
 #Upstream kernel commit 4f647e0a3c37b8d5086214128614a136064110c3
@@ -104,7 +111,15 @@ overlays and security groups.
 %setup -q
-%configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
+%configure \
+%if %{with libcapng}
+	--enable-libcapng \
+	--disable-libcapng \
+	--enable-ssl \
+	--with-pkidir=%{_sharedstatedir}/openvswitch/pki
 make %{?_smp_mflags}

More information about the dev mailing list