From 8c31c1ea26978e57132fe3a239a61f14f218f0a4 Mon Sep 17 00:00:00 2001 From: openeuler-netdev Date: Mon, 4 Jan 2021 21:37:12 +0800 Subject: [PATCH] add py3 rpmbuild --- openvswitch.spec | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openvswitch.spec b/openvswitch.spec index 986aa43..6ae3e60 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -1,3 +1,8 @@ +# Enable Python 3 by specifying '--with build_python3'. +# This is enabled by default for versions of the distribution that +# have Python 3 by default. +%bcond_with build_python3 + Name: openvswitch Summary: Production Quality, Multilayer Open Virtual Switch URL: http://www.openvswitch.org/ @@ -12,6 +17,9 @@ Patch0002: 0002-Remove-unsupported-permission-names.patch Patch0003: 0003-Fallback-to-read-proc-net-dev-on-linux.patch Requires: logrotate hostname python >= 3.8 python3-six selinux-policy-targeted BuildRequires: python3-six, openssl-devel checkpolicy selinux-policy-devel autoconf automake libtool python-sphinx unbound-devel +%if %{with build_python3} +BuildRequires: python3-devel +%endif Provides: openvswitch-selinux-policy = %{version}-%{release} Obsoletes: openvswitch-selinux-policy < %{version}-%{release} @@ -34,6 +42,19 @@ Summary: Helpful information for Open vSwitch %description help Documents and helpful information for Open vSwitch. +%if %{with build_python3} +%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 + %prep %autosetup -p1 @@ -188,6 +209,11 @@ exit 0 /var/log/openvswitch %{_datadir}/selinux/packages/%{name}/openvswitch-custom.pp +%if %{with build_python3} +%files -n python3-openvswitch +%{python3_sitelib}/ovs +%endif + %files devel %{_libdir}/lib*.so %{_libdir}/lib*.a -- Gitee