From cf85ecfc62021683e4b5babb1d5ce0ece81e02d9fab674eaadece18cf2d5e8c3 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Tue, 24 Nov 2020 07:31:34 +0000 Subject: [PATCH] Accepting request 849909 from home:bnavigator:branches:devel:tools:building - Fix the python subpackage generation gh#openSUSE/python-rpm-macros#79 - Support multiple python3 flavors gh#openSUSE/python-rpm-macros#66 OBS-URL: https://build.opensuse.org/request/show/849909 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/protobuf?expand=0&rev=97 --- protobuf.changes | 11 +++++++++++ protobuf.spec | 29 +++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/protobuf.changes b/protobuf.changes index 49b57de..539c5ff 100644 --- a/protobuf.changes +++ b/protobuf.changes @@ -136,6 +136,17 @@ Sun Nov 22 00:56:06 UTC 2020 - John Vandenberg performance (the legacy generated code will still work, but might incur a slight performance penalty). +------------------------------------------------------------------- +Sun Nov 22 00:21:40 UTC 2020 - Benjamin Greiner + +- Fix the python subpackage generation + gh#openSUSE/python-rpm-macros#79 + +------------------------------------------------------------------- +Sat Nov 14 23:33:17 UTC 2020 - Benjamin Greiner + +- Support multiple python3 flavors gh#openSUSE/python-rpm-macros#66 + ------------------------------------------------------------------- Tue Jun 30 08:48:59 UTC 2020 - marec diff --git a/protobuf.spec b/protobuf.spec index 493b159..cb648ee 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -57,6 +57,16 @@ BuildRequires: java-devel >= 1.6.0 BuildRequires: javapackages-local %endif +%if 0%{?python38_version_nodots} +# if python multiflavor is in place yet, use it to generate subpackages +%define python_subpackage_only 1 +%python_subpackages +%else +# same "defaults" for all distributions, used in files section +%define python_files() -n python3-%{**} +%define python_sitelib %{python3_sitelib} +%endif + %description Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. Google uses Protocol Buffers for almost all of its internal @@ -124,6 +134,16 @@ Requires: java >= 1.6.0 %description -n %{name}-java This package contains the Java bindings for Google Protocol Buffers. +%if 0%{?python_subpackage_only} +%package -n python-%{name} +Summary: Python Bindings for Google Protocol Buffers +Group: Development/Libraries/Python +Requires: python-six >= 1.9 + +%description -n python-%{name} +This package contains the Python bindings for Google Protocol Buffers. + +%else %package -n python2-%{name} Summary: Python2 Bindings for Google Protocol Buffers Group: Development/Libraries/Python @@ -141,6 +161,7 @@ Requires: python3-six >= 1.9 %description -n python3-%{name} This package contains the Python bindings for Google Protocol Buffers. +%endif %prep %autosetup -n %{tarname}-%{version} @@ -259,16 +280,16 @@ find %{buildroot}%{src_install_dir} -type f -name ".gitignore" -exec rm -f "{}" %{_javadir}/%{name}.jar %endif -%if %{with python2} +%if %{with python2} && ! 0%{?python_subpackage_only} %files -n python2-%{name} %license LICENSE %{python2_sitelib}/* %endif -%if %{with python3} -%files -n python3-%{name} +%if %{with python3} || ( %{with python2} && 0%{?python_subpackage_only} ) +%files %{python_files %{name}} %license LICENSE -%{python3_sitelib}/* +%{python_sitelib}/* %endif %changelog