diff mbox series

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

Message ID 75156b0669563aecaa07dcc01ca3cb7fafafc81a.1525965701.git.tredaelli@redhat.com
State Accepted
Headers show
Series [ovs-dev] rhel: openvswitch-fedora.spec.in: Specify PYTHON and PYTHON3 | expand

Commit Message

Timothy Redaelli May 10, 2018, 3:21 p.m. UTC
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@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/346796.html
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 rhel/openvswitch-fedora.spec.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Ansis May 10, 2018, 7:02 p.m. UTC | #1
On Thu, 10 May 2018 at 08:21, Timothy Redaelli <tredaelli@redhat.com> wrote:

> 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@gmail.com>
> Reported-at:
https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/346796.html
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Thanks for the fix. Will push to master branch.

Acked-by: Ansis Atteka <aatteka@ovn.org>

> ---
>   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
diff mbox series

Patch

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}