[ovs-dev] [PATCH] rhel: openvswitch-fedora.spec.in: Specify PYTHON and PYTHON3

Timothy Redaelli tredaelli at redhat.com
Thu May 10 15:21:41 UTC 2018


Currently python2 and python3 binaries are searched by following the
PATHs, but, on Fedora, the python2 package does not provides /bin/python2
and so if the PATH contains /bin before /usr/bin (for example by using
the ansible poc) then the resulting RPM file will require /bin/python2
instead of /usr/bin/python2 and this breaks some tools (for example
createrepo).

This patch specify the full path of python2 interpreter and,
if python3-openvswitch package is built, the full path of python3
interpreter.

Reported-by: Ansis Atteka <ansisatteka at gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/346796.html
Signed-off-by: Timothy Redaelli <tredaelli at redhat.com>
---
 rhel/openvswitch-fedora.spec.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 6dbf20ce1..9462ce236 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -222,7 +222,13 @@ Docker network plugins for OVN.
 	--with-dpdk=$(dirname %{_datadir}/dpdk/*/.config) \
 %endif
 	--enable-ssl \
-	--with-pkidir=%{_sharedstatedir}/openvswitch/pki
+	--with-pkidir=%{_sharedstatedir}/openvswitch/pki \
+%if 0%{?fedora} > 22 || %{with build_python3}
+	PYTHON3=%{__python3} \
+	PYTHON=%{__python2}
+%else
+	PYTHON=%{__python}
+%endif
 
 build-aux/dpdkstrip.py \
 %if %{with dpdk}
-- 
2.17.0



More information about the dev mailing list