diff options
author | Ben Pfaff <blp@ovn.org> | 2019-09-20 08:30:42 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-09-27 09:23:50 -0700 |
commit | 1ca0323e7c29dc7ef5a615c265df0460208f92de (patch) | |
tree | 377630fee2130b269cfe2fd348c9e8c6bc5a814a /rhel | |
parent | 187bb41fbf447acf9fb6ac117dc923bbe649e78c (diff) | |
download | openvswitch-1ca0323e7c29dc7ef5a615c265df0460208f92de.tar.gz |
Require Python 3 and remove support for Python 2.
Python 2 reaches end-of-life on January 1, 2020, which is only
a few months away. This means that OVS needs to stop depending
on in the next release that should occur roughly that same time.
Therefore, this commit removes all support for Python 2. It
also makes Python 3 a mandatory build dependency.
Some of the interesting consequences:
- HAVE_PYTHON, HAVE_PYTHON2, and HAVE_PYTHON3 conditionals have
been removed, since we now know that Python3 is available.
- $PYTHON and $PYTHON2 are removed, and $PYTHON3 is always
available.
- Many tests for Python 2 support have been removed, and the ones
that depended on Python 3 now run unconditionally. This allowed
several macros in the testsuite to be removed, making the code
clearer. This does make some of the changes to the testsuite
files large due to indentation level changes.
- #! lines for Python now use /usr/bin/python3 instead of
/usr/bin/python.
- Packaging depends on Python 3 packages.
Acked-by: Numan Siddique <nusiddiq@redhat.com>
Tested-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'rhel')
-rw-r--r-- | rhel/openvswitch-fedora.spec.in | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index 614c5f9f0..fc113c9f1 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -45,17 +45,6 @@ %define _rundir /run %endif -# define the python package prefix based on distribution version so that we can -# simultaneously support RHEL-based and later Fedora versions in this spec file. -%if 0%{?fedora} >= 25 -%define _py2 python2 -%endif - -%if 0%{?rhel} || 0%{?fedora} < 25 -%define _py2 python -%endif - - Name: openvswitch Summary: Open vSwitch Group: System Environment/Daemons @@ -72,7 +61,6 @@ Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz BuildRequires: gcc gcc-c++ BuildRequires: autoconf automake libtool BuildRequires: systemd-units openssl openssl-devel -BuildRequires: %{_py2}-devel %if 0%{?fedora} > 22 || %{with build_python3} BuildRequires: python3-devel %endif @@ -81,7 +69,6 @@ BuildRequires: groff graphviz BuildRequires: checkpolicy, selinux-policy-devel BuildRequires: /usr/bin/sphinx-build-3 # make check dependencies -BuildRequires: %{_py2}-twisted%{?rhel:-core} %{_py2}-zope-interface %{_py2}-six BuildRequires: procps-ng %if %{with libcapng} BuildRequires: libcap-ng libcap-ng-devel @@ -122,16 +109,6 @@ Requires: selinux-policy-targeted %description selinux-policy Tailored Open vSwitch SELinux policy -%package -n %{_py2}-openvswitch -Summary: Open vSwitch python2 bindings -License: ASL 2.0 -BuildArch: noarch -Requires: %{_py2} -Requires: %{_py2}-six -%{?python_provide:%python_provide python2-openvswitch = %{version}-%{release}} -%description -n %{_py2}-openvswitch -Python bindings for the Open vSwitch database - %if 0%{?fedora} > 22 || %{with build_python3} %package -n python3-openvswitch Summary: Open vSwitch python3 bindings @@ -149,8 +126,6 @@ Python bindings for the Open vSwitch database Summary: Open vSwitch testing utilities License: ASL 2.0 BuildArch: noarch -Requires: %{_py2}-openvswitch = %{version}-%{release} -Requires: %{_py2} %{_py2}-netifaces %{_py2}-twisted %description test Utilities that are useful to diagnose performance and connectivity @@ -179,7 +154,7 @@ service. %package ipsec Summary: Open vSwitch IPsec tunneling support License: ASL 2.0 -Requires: openvswitch %{_py2}-openvswitch libreswan +Requires: openvswitch python3-openvswitch libreswan %description ipsec This package provides IPsec tunneling support for OVS tunnels. @@ -201,12 +176,7 @@ This package provides IPsec tunneling support for OVS tunnels. --disable-static \ --enable-shared \ --with-pkidir=%{_sharedstatedir}/openvswitch/pki \ -%if 0%{?fedora} > 22 || %{with build_python3} - PYTHON3=%{__python3} \ - PYTHON=%{__python2} -%else - PYTHON=%{__python} -%endif + PYTHON3=%{__python3} build-aux/dpdkstrip.py \ %if %{with dpdk} @@ -274,13 +244,9 @@ install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifdown-ovs \ install -p -m 0755 rhel/etc_sysconfig_network-scripts_ifup-ovs \ $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifup-ovs -install -d -m 0755 $RPM_BUILD_ROOT%{python2_sitelib} -cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \ - $RPM_BUILD_ROOT%{python2_sitelib} - %if 0%{?fedora} > 22 || %{with build_python3} install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib} -cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovs \ +cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \ $RPM_BUILD_ROOT%{python3_sitelib} %endif @@ -435,9 +401,6 @@ fi %defattr(-,root,root) %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp -%files -n %{_py2}-openvswitch -%{python2_sitelib}/ovs - %if 0%{?fedora} > 22 || %{with build_python3} %files -n python3-openvswitch %{python3_sitelib}/ovs @@ -456,7 +419,7 @@ fi %{_mandir}/man1/ovs-pcap.1* %{_mandir}/man8/ovs-tcpdump.8* %{_mandir}/man1/ovs-tcpundump.1* -%{python2_sitelib}/ovstest +%{python3_sitelib}/ovstest %files devel %{_libdir}/lib*.so |