Summary: Protocol Buffers for Python Name: python-protobuf Version: 5.27.0 Release: %autorelease # The protobuf versioning scheme is unusual. Each release is tagged vA.B, but # different components have their own major version numbers in front of that. # We want to keep this package aligned with that of the protobuf package. See # https://github.com/protocolbuffers/protobuf/blob/v%%{version_pb}/version.json. %global version_pb %(echo '%{version}' | cut -d . -f 2-) # The entire source is BSD-3-Clause, except the contents of utf8_range/ which # are MIT. License: BSD-3-Clause AND MIT URL: https://pypi.org/project/protobuf Source: %{pypi_source protobuf} BuildRequires: python3-devel BuildRequires: gcc-c++ %global _description %{expand: This package contains the Protobuf library for Python.} %description %{_description} %package -n python3-protobuf Summary: %{summary} # Since 26.0, upstream *only* supports building this from the PyPI sdist, # unless using Bazel. Thus we must package this separately from the protobuf # package, with some of the protobuf code bundled rather than linked. Provides: bundled(protobuf) = %{version_pb} # We document the contents of third_party/utf8_range/ as a bundled library, as # it was historically a separate library. However, it is now maintained as part # of protobuf, so unbundling is not appropriate. The version number is taken # from the corresponding protobuf source tree: # # https://github.com/protocolbuffers/protobuf/blob/v%%{version_pb}/ # third_party/utf8_range/cmake/utf8_range.pc.cmake Provides: bundled(utf8_range) = 1.0 # For compatibility with historical packaging: Provides: protobuf-python3 = %{version}-%{release} %description -n python3-protobuf %{_description} %prep %autosetup -n protobuf-%{version} # This file is executable on GitHub, but will be installed as a non-executable # library file in this package; we therefore remove the useless shebang. sed -r -i '1{/^#!/d}' google/protobuf/internal/_parameterized.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l google %check # Upstream does not provide any tests for the Python bindings in the sdist. %pyproject_check_import %files -n python3-protobuf -f %{pyproject_files} %doc README.md %{python3_sitearch}/protobuf-%{version}-py%{python3_version}-nspkg.pth %changelog %autochangelog