On CentOS, the package names aren't prefixed with python2, but rather are prefixed with simply python. This change addresses that and fixes up some documentation that was outdated, and updates the Vagrantfile to use the proper spec file and package names.
Signed-off-by: Leif Madsen <lmad...@redhat.com> --- Documentation/intro/install/fedora.rst | 4 +-- Vagrantfile | 6 ++-- rhel/openvswitch-fedora.spec.in | 50 ++++++++++++++++++++++++---------- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/Documentation/intro/install/fedora.rst b/Documentation/intro/install/fedora.rst index 0ecd255..ffc77a4 100644 --- a/Documentation/intro/install/fedora.rst +++ b/Documentation/intro/install/fedora.rst @@ -42,8 +42,8 @@ in the :doc:`general`. Specific packages (by package name) include: - rpm-build - autoconf automake libtool - systemd-units openssl openssl-devel -- python-devel python3-devel -- python python-twisted-core python-zope-interface python-six +- python2-devel python3-devel +- python2 python2-twisted python2-zope-interface python2-six - desktop-file-utils - groff graphviz - procps-ng diff --git a/Vagrantfile b/Vagrantfile index 8439918..d2b7ecb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,7 +9,7 @@ $bootstrap_fedora = <<SCRIPT dnf -y update dnf -y install autoconf automake openssl-devel libtool \ python-devel python3-devel \ - python-twisted-core python-zope-interface \ + python-twisted python-zope-interface \ desktop-file-utils groff graphviz rpmdevtools nc curl \ wget python-six pyftpdlib checkpolicy selinux-policy-devel \ libcap-ng-devel kernel-devel-`uname -r` ethtool python-tftpy @@ -80,8 +80,8 @@ PACKAGE_VERSION=`autom4te -l Autoconf -t 'AC_INIT:$2' /vagrant/configure.ac` make && make dist rpmdev-setuptree cp openvswitch-$PACKAGE_VERSION.tar.gz $HOME/rpmbuild/SOURCES -rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-rhel6.spec -rpmbuild --bb --without check /vagrant/rhel/openvswitch.spec +rpmbuild --bb -D "kversion `uname -r`" /vagrant/rhel/openvswitch-kmod-fedora.spec +rpmbuild --bb --without check /vagrant/rhel/openvswitch-fedora.spec rpm -e openvswitch rpm -ivh $HOME/rpmbuild/RPMS/x86_64/openvswitch-$PACKAGE_VERSION-1.x86_64.rpm systemctl enable openvswitch diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index d100f49..bd7d79b 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -38,6 +38,17 @@ %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} >= 23 +%define _py2 python2 +%endif + +%if 0%{?rhel} || 0%{?fedora} < 23 +%define _py2 python +%endif + + Name: openvswitch Summary: Open vSwitch Group: System Environment/Daemons @@ -53,16 +64,16 @@ Source: http://openvswitch.org/releases/%{name}-%{version}.tar.gz BuildRequires: autoconf automake libtool BuildRequires: systemd-units openssl openssl-devel -BuildRequires: python2-devel +BuildRequires: %{_py2}-devel +%if 0%{?fedora} > 22 BuildRequires: python3-devel +%endif BuildRequires: desktop-file-utils BuildRequires: groff graphviz BuildRequires: checkpolicy, selinux-policy-devel # make check dependencies -%if %{with check} -BuildRequires: python2-twisted python2-zope-interface python2-six +BuildRequires: %{_py2}-twisted%{?rhel:-core} %{_py2}-zope-interface %{_py2}-six BuildRequires: procps-ng -%endif %if %{with libcapng} BuildRequires: libcap-ng libcap-ng-devel %endif @@ -81,6 +92,7 @@ Requires(preun): systemd-units Requires(postun): systemd-units Obsoletes: openvswitch-controller <= 0:2.1.0-1 +# to skip running checks, pass --without check %bcond_without check %bcond_with check_datapath_kernel @@ -98,33 +110,35 @@ Requires: selinux-policy-targeted %description selinux-policy Tailored Open vSwitch SELinux policy -%package -n python2-openvswitch +%package -n %{_py2}-openvswitch Summary: Open vSwitch python2 bindings License: ASL 2.0 BuildArch: noarch -Requires: python2 -Requires: python2-six -Provides: python-openvswitch = %{version}-%{release} - -%description -n python2-openvswitch +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 %package -n python3-openvswitch Summary: Open vSwitch python3 bindings License: ASL 2.0 BuildArch: noarch Requires: python3 Requires: python3-six +%{?python_provide:%python_provide python3-openvswitch = %{version}-%{release}} %description -n python3-openvswitch Python bindings for the Open vSwitch database +%endif %package test Summary: Open vSwitch testing utilities License: ASL 2.0 BuildArch: noarch -Requires: python2-openvswitch = %{version}-%{release} -Requires: python2 python2-twisted +Requires: %{_py2}-openvswitch = %{version}-%{release} +Requires: %{_py2} %{_py2}-twisted %description test Utilities that are useful to diagnose performance and connectivity @@ -182,7 +196,7 @@ Utilities that are use to diagnose and manage the OVN components. %package ovn-docker Summary: Open vSwitch - Open Virtual Network support License: ASL 2.0 -Requires: openvswitch openvswitch-ovn-common python2-openvswitch +Requires: openvswitch openvswitch-ovn-common %{_py2}-openvswitch %description ovn-docker Docker network plugins for OVN. @@ -238,11 +252,15 @@ 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} -install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib} cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/* \ $RPM_BUILD_ROOT%{python2_sitelib} + +%if 0%{?fedora} > 22 +install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib} cp -a $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ovs \ $RPM_BUILD_ROOT%{python3_sitelib} +%endif + rm -rf $RPM_BUILD_ROOT/%{_datadir}/openvswitch/python/ install -d -m 0755 $RPM_BUILD_ROOT/%{_sharedstatedir}/openvswitch @@ -429,13 +447,15 @@ fi %defattr(-,root,root) %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp -%files -n python2-openvswitch +%files -n %{_py2}-openvswitch %{python2_sitelib}/ovs %doc COPYING +%if 0%{?fedora} > 22 %files -n python3-openvswitch %{python3_sitelib}/ovs %doc COPYING +%endif %files test %{_bindir}/ovs-test -- 2.9.3 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev