Sync from SUSE:SLFO:Main protobuf21 revision 5ab88dee17738f16f6dfea84c1dcacbb

This commit is contained in:
Adrian Schröter 2024-05-03 19:39:36 +02:00
commit 0f9d06e0c8
9 changed files with 2095 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

85
10355.patch Normal file
View File

@ -0,0 +1,85 @@
From 15daef3b7912b9434955a8614e018de00591aefb Mon Sep 17 00:00:00 2001
From: Deanna Garcia <deannagarcia@google.com>
Date: Wed, 3 Aug 2022 17:40:03 +0000
Subject: [PATCH 1/2] Use release version instead of libtool version
---
src/Makefile.am | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: protobuf-21.12/src/Makefile.am
===================================================================
--- protobuf-21.12.orig/src/Makefile.am
+++ protobuf-21.12/src/Makefile.am
@@ -18,7 +18,7 @@ else
PTHREAD_DEF =
endif
-PROTOBUF_VERSION = 32:12:0
+PROTOBUF_VERSION = 3.21.12
if GCC
# Turn on all warnings except for sign comparison (we ignore sign comparison
@@ -188,7 +188,7 @@ nobase_include_HEADERS =
lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
-libprotobuf_lite_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
+libprotobuf_lite_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
@@ -235,7 +235,7 @@ libprotobuf_lite_la_SOURCES =
google/protobuf/wire_format_lite.cc
libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
-libprotobuf_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
+libprotobuf_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
@@ -320,7 +320,7 @@ libprotobuf_la_SOURCES =
nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES)
libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
-libprotoc_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
+libprotoc_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
if HAVE_LD_VERSION_SCRIPT
libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
Index: protobuf-21.12/cmake/libprotobuf-lite.cmake
===================================================================
--- protobuf-21.12.orig/cmake/libprotobuf-lite.cmake
+++ protobuf-21.12/cmake/libprotobuf-lite.cmake
@@ -112,7 +112,6 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf-lite PROPERTIES
VERSION ${protobuf_VERSION}
- SOVERSION 32
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
Index: protobuf-21.12/cmake/libprotobuf.cmake
===================================================================
--- protobuf-21.12.orig/cmake/libprotobuf.cmake
+++ protobuf-21.12/cmake/libprotobuf.cmake
@@ -128,7 +128,6 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf PROPERTIES
VERSION ${protobuf_VERSION}
- SOVERSION 32
OUTPUT_NAME ${LIB_PREFIX}protobuf
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf ALIAS libprotobuf)
Index: protobuf-21.12/cmake/libprotoc.cmake
===================================================================
--- protobuf-21.12.orig/cmake/libprotoc.cmake
+++ protobuf-21.12/cmake/libprotoc.cmake
@@ -130,7 +130,6 @@ endif()
set_target_properties(libprotoc PROPERTIES
COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
VERSION ${protobuf_VERSION}
- SOVERSION 32
OUTPUT_NAME ${LIB_PREFIX}protoc
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotoc ALIAS libprotoc)

3
baselibs.conf Normal file
View File

@ -0,0 +1,3 @@
libprotobuf3_21_12
libprotoc3_21_12
libprotobuf-lite3_21_12

View File

@ -0,0 +1,16 @@
Index: protobuf-21.4/src/google/protobuf/port_def.inc
===================================================================
--- protobuf-21.4.orig/src/google/protobuf/port_def.inc
+++ protobuf-21.4/src/google/protobuf/port_def.inc
@@ -652,7 +652,11 @@
#define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
#define PROTOBUF_CONSTEXPR constexpr
#elif PROTOBUF_GNUC_MIN(12, 2)
+#if PROTOBUF_CPLUSPLUS_MIN(201703L)
#define PROTOBUF_CONSTINIT __constinit
+#else
+#define PROTOBUF_CONSTINIT
+#endif
#define PROTOBUF_CONSTEXPR constexpr
// MSVC 17 currently seems to raise an error about constant-initialized pointers.
#elif defined(_MSC_VER) && _MSC_VER >= 1930

9
manifest.txt.in Normal file
View File

@ -0,0 +1,9 @@
Manifest-Version: 1.0
Created-By: stick@gk2.sk
Name: com/google/protobuf/
Specification-Title: Google Protocol Buffers
Specification-Version: @VERSION@
Specification-Vendor: stick@gk2.sk
Implementation-Title: com.google.protobuf
Implementation-Version: @VERSION@
Implementation-Vendor: stick@gk2.sk

BIN
protobuf-21.12.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

3
protobuf21-rpmlintrc Normal file
View File

@ -0,0 +1,3 @@
addFilter("shlib-policy-name-error")
addFilter("env-script-interpreter")
addFilter("spurious-executable-perm")

1658
protobuf21.changes Normal file

File diff suppressed because it is too large Load Diff

295
protobuf21.spec Normal file
View File

@ -0,0 +1,295 @@
#
# spec file for package protobuf
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{!?make_build:%global make_build make %{?_smp_mflags}}
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define sover 3_21_12
%define tarname protobuf
%define src_install_dir %{_prefix}/src/%{name}
%define extra_java_flags -source 7 -target 7
# requires gmock, which is not yet in the distribution
%bcond_with check
%bcond_with java
%bcond_with python3
Name: protobuf21
Version: 21.12
Release: 0
Summary: Protocol Buffers - Google's data interchange format
License: BSD-3-Clause
Group: Development/Libraries/C and C++
URL: https://github.com/protocolbuffers/protobuf
Source0: https://github.com/protocolbuffers/protobuf/archive/v%{version}.tar.gz#/%{tarname}-%{version}.tar.gz
Source1: manifest.txt.in
Source2: baselibs.conf
Source1000: %{name}-rpmlintrc
Patch0: gcc12-disable-__constinit-with-c++-11.patch
# https://github.com/protocolbuffers/protobuf/pull/10355
Patch1: 10355.patch
Provides: protobuf = %{version}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module setuptools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(zlib)
%if %{with check}
BuildRequires: libgmock-devel >= 1.7.0
%endif
%if %{with java}
BuildRequires: java-devel >= 1.6.0
BuildRequires: javapackages-local
%endif
%if 0%{?suse_version} >= 1550
# TW: generate subpackages for every python3 flavor
%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
RPC protocols and file formats.
%package -n libprotobuf%{sover}
Summary: Protocol Buffers - Google's data interchange format
Group: System/Libraries
%description -n libprotobuf%{sover}
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
RPC protocols and file formats.
%package -n libprotoc%{sover}
Summary: Protocol Buffers - Google's data interchange format
Group: System/Libraries
%description -n libprotoc%{sover}
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
RPC protocols and file formats.
%package -n libprotobuf-lite%{sover}
Summary: Protocol Buffers - Google's data interchange format
Group: System/Libraries
%description -n libprotobuf-lite%{sover}
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
RPC protocols and file formats.
%package devel
Summary: Header files, libraries and development documentation for %{name}
Group: Development/Libraries/C and C++
Requires: gcc-c++
Requires: libprotobuf%{sover} = %{version}
Requires: libprotobuf-lite%{sover}
Requires: pkgconfig(zlib)
Conflicts: protobuf2-devel
Provides: libprotobuf-devel = %{version}
Provides: protobuf-devel = %{version}
Obsoletes: protobuf-devel <= 21.12
%description devel
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
RPC protocols and file formats.
%package source
Summary: Source code of protobuf
Group: Development/Sources
BuildArch: noarch
%description source
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
RPC protocols and file formats.
This package contains source code for Protocol Buffers.
%package -n %{name}-java
Summary: Java Bindings for Google Protocol Buffers
Group: Development/Libraries/Java
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 python3-%{name}
Summary: Python3 Bindings for Google Protocol Buffers
Group: Development/Libraries/Python
Requires: python3-six >= 1.9
%description -n python3-%{name}
This package contains the Python bindings for Google Protocol Buffers.
%endif
%prep
%autosetup -p1 -n %{tarname}-%{version}
# The previous blank line is crucial for older system being able
# to use the autosetup macro
mkdir gmock
%if %{with python3}
# only needed for test suite which we don't call anyways.
# googleapis is broken on sle12
sed -i '/apputils/d' python/setup.py
sed -i '/google_test_dir/d' python/setup.py
%endif
# kill shebang that we do not really want
sed -i -e '/env python/d' python/google/protobuf/internal/*.py
%build
autoreconf -fvi
%configure \
--disable-static
%make_build
%if %{with java}
pushd java
../src/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto
mkdir classes
javac %{extra_java_flags} -d classes core/src/main/java/com/google/protobuf/*.java
sed -e 's/@VERSION@/%{version}/' < %{SOURCE1} > manifest.txt
jar cfm %{name}-java-%{version}.jar manifest.txt -C classes com
popd
%endif
%if %{with python3}
pushd python
%python_build
popd
%endif
%if %{with check}
%check
%make_build check
%endif
%install
%make_install
install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim
# no need for that
find %{buildroot} -type f -name "*.la" -delete -print
%if %{with java}
pushd java
install -D -m 0644 %{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}-java.jar
ln -s %{name}-java.jar %{buildroot}%{_javadir}/%{name}.jar
install -D -m 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}-parent.pom
%add_maven_depmap %{name}-parent.pom
install -D -m 0644 bom/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-bom.pom
%add_maven_depmap %{name}-bom.pom
install -D -m 0644 core/pom.xml %{buildroot}%{_mavenpomdir}/%{name}-java.pom
%add_maven_depmap %{name}-java.pom %{name}-java.jar
popd
%endif
%if %{with python3}
pushd python
%python_install
popd
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
mkdir -p %{buildroot}%{src_install_dir}
tar -xzf %{SOURCE0} --strip-components=1 -C %{buildroot}%{src_install_dir}
%fdupes %{buildroot}%{src_install_dir}
# Fix env-script-interpreter rpmlint error
find %{buildroot}%{src_install_dir} -type f -name "*.js" -exec sed -i 's|#!.*%{_bindir}/env node|#!%{_bindir}/node|' "{}" +
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!.*%{_bindir}/env python2.7|#!%{_bindir}/python2.7|' "{}" +
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!.*%{_bindir}/env python|#!%{_bindir}/python|' "{}" +
find %{buildroot}%{src_install_dir} -type f -name "*.rb" -exec sed -i 's|#!.*%{_bindir}/env ruby|#!%{_bindir}/ruby|' "{}" +
find %{buildroot}%{src_install_dir} -type f -name "*.sh" -exec sed -i 's|#!.*%{_bindir}/env bash|#!/bin/bash|' "{}" +
# And stop requiring ridiculously old Python version
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!%{_bindir}/python2.4|#!%{_bindir}/python2.7|' "{}" +
# Fix spurious-executable-perm rpmlint error
chmod -x %{buildroot}%{src_install_dir}/src/google/protobuf/arenastring.h
chmod -x %{buildroot}%{src_install_dir}/src/google/protobuf/reflection.h
# Fix version-control-internal-file rpmlint warning
find %{buildroot}%{src_install_dir} -type f -name ".gitignore" -exec rm -f "{}" +
%fdupes %{buildroot}%{_prefix}
%post -n libprotobuf%{sover} -p /sbin/ldconfig
%postun -n libprotobuf%{sover} -p /sbin/ldconfig
%post -n libprotoc%{sover} -p /sbin/ldconfig
%postun -n libprotoc%{sover} -p /sbin/ldconfig
%post -n libprotobuf-lite%{sover} -p /sbin/ldconfig
%postun -n libprotobuf-lite%{sover} -p /sbin/ldconfig
%files -n libprotobuf%{sover}
%license LICENSE
%{_libdir}/libprotobuf-3.%{version}.so
%files -n libprotoc%{sover}
%{_libdir}/libprotoc-3.%{version}.so
%files -n libprotobuf-lite%{sover}
%{_libdir}/libprotobuf-lite-3.%{version}.so
%files devel
%doc CHANGES.txt CONTRIBUTORS.txt README.md
%{_bindir}/protoc
%{_includedir}/google
%{_libdir}/pkgconfig/*
%{_libdir}/libprotobuf-lite.so
%{_libdir}/libprotobuf.so
%{_libdir}/libprotoc.so
%{_datadir}/vim
%files source
%{src_install_dir}
%if %{with java}
%files -n %{name}-java -f java/.mfiles
%{_javadir}/%{name}.jar
%endif
%if %{with python3}
%files %{python_files %{name}}
%license LICENSE
%dir %{python_sitelib}/google
%{python_sitelib}/google/protobuf
%{python_sitelib}/protobuf*nspkg.pth
%{python_sitelib}/protobuf*info
%endif
%changelog