From f850461846bf845a2d81e44abef29b5268f10feedc488d7d7ddff15b026e5b59 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 9 Jan 2018 13:37:23 +0000 Subject: [PATCH] Accepting request 560283 from home:markoschandras:branches:network - Python fixes and improvements * Build Python3 subpackages for Open vSwitch python bindings * Switch build architecture to 'noarch' for python bindings. * Fix license for python subpackages * Build and ship python bytecode files. - Do not mark files in /usr/share/* as configuration files - Replace version macro with actual version number of Obsoletes tags. The DPDK packages have been merged with the regular OvS ones in the 2.7.0 release so make it more explicit which ones we are obsoleting. - spec-cleaner fixes OBS-URL: https://build.opensuse.org/request/show/560283 OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=133 --- openvswitch.changes | 14 +++++ openvswitch.spec | 138 +++++++++++++++++++++++++++++--------------- 2 files changed, 105 insertions(+), 47 deletions(-) diff --git a/openvswitch.changes b/openvswitch.changes index 14f8559..5d4aead 100644 --- a/openvswitch.changes +++ b/openvswitch.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Wed Dec 27 17:05:35 UTC 2017 - mchandras@suse.de + +- Python fixes and improvements + * Build Python3 subpackages for Open vSwitch python bindings + * Switch build architecture to 'noarch' for python bindings. + * Fix license for python subpackages + * Build and ship python bytecode files. +- Do not mark files in /usr/share/* as configuration files +- Replace version macro with actual version number of Obsoletes tags. + The DPDK packages have been merged with the regular OvS ones in the + 2.7.0 release so make it more explicit which ones we are obsoleting. +- spec-cleaner fixes + ------------------------------------------------------------------- Wed Dec 6 14:00:55 UTC 2017 - mchandras@suse.de diff --git a/openvswitch.spec b/openvswitch.spec index 98208ec..39e8d03 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -17,11 +17,11 @@ # needssslcertforbuild +%{?!python_module:%define python_module() python-%{**} python3-%{**}} #Compat macro for new _fillupdir macro introduced in Nov 2017 %if ! %{defined _fillupdir} - %define _fillupdir /var/adm/fillup-templates + %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif - %define lname libopenvswitch-2_8-0 %ifarch aarch64 x86_64 %{ix86} # DPDK enabled by default @@ -49,6 +49,10 @@ Source0: http://openvswitch.org/releases/openvswitch-%{version}.tar.gz Source1: preamble Source89: Module.supported.updates Patch99: 0001-utilities-Add-script-to-support-DPDK-option-migratio.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module six} +BuildRequires: %{python_module xml} +BuildRequires: %{pythons} BuildRequires: autoconf BuildRequires: automake BuildRequires: fdupes @@ -58,31 +62,27 @@ BuildRequires: libopenssl-devel BuildRequires: libtool BuildRequires: make BuildRequires: pkgconfig -BuildRequires: python-devel -BuildRequires: python-six -BuildRequires: python-xml +BuildRequires: python-rpm-macros BuildRequires: pkgconfig(openssl) Requires: logrotate Requires: modutils -Requires: python # ovs-ctl / ovs-pki use /usr/bin/uuidgen: Requires: util-linux Requires(post): %fillup_prereq Suggests: logrotate Provides: openvswitch-common = %{version} -Obsoletes: openvswitch-common < %{version} +Obsoletes: openvswitch-common < 2.7.0 Provides: openvswitch-controller = %{version} -Obsoletes: openvswitch-controller < %{version} +Obsoletes: openvswitch-controller < 2.7.0 # openvswitch-switch has been merged to the main package # so we need to provide a migration path Provides: %{name}-dpdk = %{version} Provides: %{name}-dpdk-switch = %{version} Provides: %{name}-switch = %{version} -Obsoletes: %{name}-dpdk < %{version} -Obsoletes: %{name}-dpdk-switch < %{version} -Obsoletes: %{name}-switch < %{version} +Obsoletes: %{name}-dpdk < 2.7.0 +Obsoletes: %{name}-dpdk-switch < 2.7.0 +Obsoletes: %{name}-switch < 2.7.0 %{?systemd_requires} -%py_requires %if %{with dpdk} Requires(post): shadow %endif @@ -145,7 +145,7 @@ License: Apache-2.0 Group: Development/Libraries/C and C++ Requires: %{lname} = %{version} Provides: %{name}-dpdk-devel = %{version} -Obsoletes: %{name}-dpdk-devel < %{version} +Obsoletes: %{name}-dpdk-devel < 2.7.0 %description devel Devel libraries and headers for Open vSwitch. @@ -200,8 +200,8 @@ Requires: %{name} = %{version} # openvswitch-ovn has been split into openvswitch-ovn-{central,common,docker,host,vtep} Provides: %{name}-dpdk-ovn = %{version} Provides: %{name}-ovn = %{version} -Obsoletes: %{name}-dpdk-ovn < %{version} -Obsoletes: %{name}-ovn < %{version} +Obsoletes: %{name}-dpdk-ovn < 2.7.0 +Obsoletes: %{name}-ovn < 2.7.0 %description ovn-common Utilities that are used to diagnose and manage the OVN components. @@ -226,7 +226,7 @@ License: Apache-2.0 Group: Productivity/Networking/System Requires: %{name} = %{version} Provides: %{name}-dpdk-pki = %{version} -Obsoletes: %{name}-dpdk-pki < %{version} +Obsoletes: %{name}-dpdk-pki < 2.7.0 %description pki openvswitch-pki provides PKI (public key infrastructure) support for @@ -244,7 +244,7 @@ Requires: %{name}-switch = %{version} # Since openvswitch/scripts/ovs-vtep requires various ovs python modules. Requires: python-openvswitch = %{version} Provides: %{name}-dpdk-vtep = %{version} -Obsoletes: %{name}-dpdk-vtep < %{version} +Obsoletes: %{name}-dpdk-vtep < 2.7.0 %description vtep A VTEP (VXLAN Tunnel EndPoint) emulator that uses Open vSwitch for @@ -252,40 +252,68 @@ forwarding. Open vSwitch is a full-featured software-based Ethernet switch. -%package -n python-openvswitch -Summary: Python bindings for Open vSwitch -License: Python-2.0 +%package -n python2-openvswitch +Summary: Python2 bindings for Open vSwitch +License: Apache-2.0 Group: Productivity/Networking/System Requires: openvswitch-common = %{version} -Requires: python -Requires: python-six +Requires: python3 +Requires: python3-six +Provides: python-openvswitch = %{version} +Obsoletes: python-openvswitch < 2.8.1 +BuildArch: noarch -%description -n python-openvswitch -This package contains the Python bindings for Open vSwitch database. +%description -n python2-openvswitch +This package contains the Python2 bindings for Open vSwitch database. -%package -n python-openvswitch-test -Summary: Python bindings for Open vSwitch -License: Python-2.0 +%package -n python2-openvswitch-test +Summary: Python2 bindings for Open vSwitch +License: Apache-2.0 Group: Productivity/Networking/System Requires: openvswitch-common = %{version} -Requires: python -Requires: python-openvswitch = %{version} -Requires: python-twisted +Requires: python2 +Requires: python2-openvswitch = %{version} +Requires: python2-twisted +Provides: python-openvswitch-test = %{version} +Obsoletes: python-openvswitch-test < 2.8.1 +BuildArch: noarch -%description -n python-openvswitch-test +%description -n python2-openvswitch-test This package contains the Python bindings for Open vSwitch database. +%package -n python3-openvswitch +Summary: Python3 bindings for Open vSwitch +License: Apache-2.0 +Group: Productivity/Networking/System +Requires: openvswitch-common = %{version} +Requires: python3 +Requires: python3-six +BuildArch: noarch + +%description -n python3-openvswitch +This package contains the Python3 bindings for Open vSwitch database. + +%package -n python3-openvswitch-test +Summary: Python3 bindings for Open vSwitch +License: Apache-2.0 +Group: Productivity/Networking/System +Requires: openvswitch-common = %{version} +Requires: python3 +Requires: python3-openvswitch = %{version} +Requires: python3-twisted +BuildArch: noarch + +%description -n python3-openvswitch-test +This package contains the Python3 bindings for Open vSwitch database. + %package test Summary: Open vSwitch test package License: Apache-2.0 Group: Productivity/Networking/System Requires: %{name} = %{version} -Requires: python -Requires: python-argparse -Requires: python-openvswitch-test = %{version} -Requires: python-twisted +Requires: python3-openvswitch-test = %{version} Provides: %{name}-dpdk-test = %{version} -Obsoletes: %{name}-dpdk-test < %{version} +Obsoletes: %{name}-dpdk-test < 2.7.0 %description test Open vSwitch is a software-based Ethernet switch. @@ -424,14 +452,24 @@ install -m 755 utilities/ovs-dpdk-migrate-2.6.sh %{buildroot}/%{_datadir}/openvs popd -mkdir -p %{buildroot}%{py_sitedir} -mv %{buildroot}%{_datadir}/openvswitch/python/* %{buildroot}%{py_sitedir} -rmdir %{buildroot}%{_datadir}/openvswitch/python +# python2 +mkdir -p %{buildroot}%{python2_sitelib} +cp -a %{buildroot}%{_datadir}/openvswitch/python/* %{buildroot}%{python2_sitelib} +# Build the byte compiled files +%py_compile %{buildroot}%{python2_sitelib} +%fdupes %{buildroot}%{python2_sitelib} + +# python3 +mkdir -p %{buildroot}%{python3_sitelib} +cp -a %{buildroot}%{_datadir}/openvswitch/python/* %{buildroot}%{python3_sitelib} +# Build the byte compiled files +%py3_compile %{buildroot}%{python3_sitelib} +%fdupes %{buildroot}%{python3_sitelib} + +rm -rf %{buildroot}%{_datadir}/openvswitch/python find %{buildroot} -type f -name "*.la" -delete -print -%fdupes %{buildroot}%{py_sitedir} - %post /sbin/ldconfig %{fillup_only -n openvswitch} @@ -638,11 +676,17 @@ export DISABLE_RESTART_ON_UPDATE=yes %{_datadir}/openvswitch/scripts/ovs-vtep %{_datadir}/openvswitch/vtep.ovsschema -%files -n python-openvswitch -%{py_sitedir}/ovs/ +%files -n python2-openvswitch +%{python2_sitelib}/ovs/ -%files -n python-openvswitch-test -%{py_sitedir}/ovstest/ +%files -n python2-openvswitch-test +%{python2_sitelib}/ovstest/ + +%files -n python3-openvswitch +%{python3_sitelib}/ovs/ + +%files -n python3-openvswitch-test +%{python3_sitelib}/ovstest/ %files ovn-docker %{_bindir}/ovn-docker-overlay-driver @@ -672,8 +716,8 @@ export DISABLE_RESTART_ON_UPDATE=yes %dir %{_libexecdir}/firewalld/services %{_bindir}/ovn-northd %{_mandir}/man8/ovn-northd.8%{ext_man} -%config %{_datadir}/openvswitch/ovn-nb.ovsschema -%config %{_datadir}/openvswitch/ovn-sb.ovsschema +%{_datadir}/openvswitch/ovn-nb.ovsschema +%{_datadir}/openvswitch/ovn-sb.ovsschema %{_unitdir}/ovn-northd.service %{_sbindir}/rcovn-northd %{_prefix}/lib/firewalld/services/ovn-central-firewall-service.xml