Compare commits

...

8 Commits

3 changed files with 187 additions and 77 deletions

View File

@ -0,0 +1,25 @@
From 2e62ef1eaa2e712afc5f87aa2c55d478fe96230d Mon Sep 17 00:00:00 2001
From: Antonio Rojas <arojas@archlinux.org>
Date: Wed, 5 Jul 2023 13:03:11 +0200
Subject: [PATCH] Handle BUILD_TYPE=None in protobuf-module.cmake
Fixes Protobuf_PROTOC_EXECUTABLE being undefined in that case.
---
cmake/protobuf-module.cmake.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in
index 0bb05e38fad..e5b2b2e4b3a 100644
--- a/cmake/protobuf-module.cmake.in
+++ b/cmake/protobuf-module.cmake.in
@@ -153,6 +153,10 @@ if(NOT Protobuf_PROTOC_EXECUTABLE AND TARGET protobuf::protoc)
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_NOCONFIG)
endif()
+ if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
+ get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
+ IMPORTED_LOCATION_NONE)
+ endif()
endif()
# Version info variable

View File

@ -0,0 +1,36 @@
diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake
index 9b1de677b4f..276c99c489e 100644
--- a/cmake/libprotobuf-lite.cmake
+++ b/cmake/libprotobuf-lite.cmake
@@ -30,6 +30,7 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf-lite PROPERTIES
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake
index aa3efc9a68a..0f34d20b97d 100644
--- a/cmake/libprotobuf.cmake
+++ b/cmake/libprotobuf.cmake
@@ -33,6 +33,7 @@ if(protobuf_BUILD_SHARED_LIBS)
endif()
set_target_properties(libprotobuf PROPERTIES
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protobuf
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotobuf ALIAS libprotobuf)
diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake
index 72b4a1abb92..91e8bbeb04e 100644
--- a/cmake/libprotoc.cmake
+++ b/cmake/libprotoc.cmake
@@ -24,6 +24,7 @@ endif()
set_target_properties(libprotoc PROPERTIES
COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
VERSION ${protobuf_VERSION}
+ SOVERSION ${protobuf_VERSION_MINOR}
OUTPUT_NAME ${LIB_PREFIX}protoc
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
add_library(protobuf::libprotoc ALIAS libprotoc)

View File

@ -1,23 +1,31 @@
Name: protobuf
Version: 21.12
Release: 2mamba
Version: 31.1
Release: 3mamba
Summary: A way of encoding structured data in an efficient yet extensible format
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/protocolbuffers/protobuf
Source: https://github.com/google/protobuf.git/v%{version}/protobuf-%{version}.tar.bz2
URL: https://protobuf.dev/
Source: https://github.com/protocolbuffers/protobuf.git/v%{version}/protobuf-%{version}.tar.bz2
Patch1: protobuf-24.3-upstream-fix-Protobuf_PROTOC_EXECUTABLE.patch
Patch2: protobuf-25.3-soversion.patch
License: BSD
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libabseil-cpp-devel
BuildRequires: libgcc
BuildRequires: libpython3-devel
BuildRequires: libpython310-devel
BuildRequires: libstdc++6-devel
BuildRequires: libz-devel
## AUTOBUILDREQ-END
BuildRequires: libabseil-cpp-devel >= 20250512.0
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Obsoletes: protobuf23 <= 3.12.4-3mamba
Obsoletes: protobuf25 <= 25.3-2mamba
Obsoletes: protobuf26 <= 26.1-2mamba
Obsoletes: protobuf28 <= 28.3-2mamba
Obsoletes: protobuf29 <= 3.17.3-2mamba
Obsoletes: protobuf32 <= 21.12-3mamba
%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.
@ -25,6 +33,12 @@ Protocol Buffers are a way of encoding structured data in an efficient yet exten
%package -n lib%{name}
Group: System/Libraries
Summary: Shared libraries for %{name}
Obsoletes: libprotobuf23 <= 3.12.4-3mamba
Obsoletes: libprotobuf25 <= 25.3-2mamba
Obsoletes: libprotobuf26 <= 26.1-2mamba
Obsoletes: libprotobuf28 <= 28.3-2mamba
Obsoletes: libprotobuf29 <= 3.17.3-2mamba
Obsoletes: libprotobuf32 <= 21.12-3mamba
%description -n lib%{name}
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.
@ -37,113 +51,148 @@ Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: protobuf-devel
Obsoletes: protobuf-devel < 3.17.0
Obsoletes: libprotobuf23-devel <= 3.12.4-3mamba
Obsoletes: libprotobuf25-devel <= 25.3-2mamba
Obsoletes: libprotobuf26-devel <= 26.1-2mamba
Obsoletes: libprotobuf28-devel <= 28.3-2mamba
Obsoletes: libprotobuf29-devel <= 3.17.3-2mamba
Obsoletes: libprotobuf32-devel <= 21.12-3mamba
%description -n lib%{name}-devel
This package contains static libraries and header files needed for development of Protocol Buffer
%package -n python-%{name}-py3
Summary: Python bindings for %{name}
Group: System/Libraries/Python
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: python-protobuf
Obsoletes: python-protobuf <= 21.12-1mamba
%description -n python-%{name}-py3
This package contains the python bindings to %{protobuf} library.
%package -n python-%{name}-py310
Summary: Python bindings for %{name}
Group: System/Libraries/Python
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description -n python-%{name}-py310
This package contains the python bindings to %{protobuf} library.
%debug_package
%global _lto_cflags %{nil}
%prep
%setup -q
#-D -T
#:<< _EOF
./autogen.sh
cp -a python python310
%patch 1 -p1 -F2 -b .upstream-fix-Protobuf_PROTOC_EXECUTABLE
%patch 2 -p1 -F2 -b .soversion
%build
%configure
%cmake \
-Dprotobuf_BUILD_SHARED_LIBS=ON \
-Dprotobuf_USE_EXTERNAL_GTEST=ON \
-Dprotobuf_ABSL_PROVIDER=package
%make \
%ifarch arm
LDFLAGS="-latomic"
%endif
cd python
CFLAGS="%{optflags}" %{__python3} setup.py build
cd ../python310
CFLAGS="%{optflags}" %{__python310} setup.py build
%cmake_build
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
cd python
%{__python3} setup.py install \
-O1 --skip-build \
--root="%{buildroot}" \
--install-headers=%{python3_inc} \
--install-lib=%{python3_sitearch} \
--record=%{name}.filelist
sed -i "\,\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist
cd ../python310
%{__python310} setup.py install \
-O1 --skip-build \
--root="%{buildroot}" \
--install-headers=%{python310_inc} \
--install-lib=%{python310_sitearch} \
--record=%{name}.filelist
sed -i "\,\.egg-info/,d;s,.*/man/.*,&.gz," %{name}.filelist
%cmake_install
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/protoc
%{_bindir}/protoc*
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/libprotobuf*.so.*
%{_libdir}/libprotoc.so.*
%{_libdir}/libutf8_range.so.*
%{_libdir}/libutf8_validity.so.*
%doc LICENSE
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/google/protobuf
%{_includedir}/google/protobuf/*
%{_libdir}/libprotobuf*.a
%dir %{_includedir}/upb
%{_includedir}/upb/*
%{_includedir}/utf8_range.h
%{_includedir}/utf8_validity.h
%{_libdir}/libupb.a
%{_libdir}/libprotobuf*.so
%{_libdir}/libprotoc.a
%{_libdir}/libprotoc.so
%{_libdir}/libutf8_range.so
%{_libdir}/libutf8_validity.so
%dir %{_libdir}/cmake/protobuf
%{_libdir}/cmake/protobuf/protobuf-*.cmake
%dir %{_libdir}/cmake/utf8_range
%{_libdir}/cmake/utf8_range/utf8_range-*.cmake
%{_libdir}/pkgconfig/protobuf*.pc
%files -n python-%{name}-py3 -f python/%{name}.filelist
%defattr(-,root,root)
%dir %{python3_sitearch}/protobuf-*-py*.egg-info
%{python3_sitearch}/protobuf-*-py*.egg-info/*
%files -n python-%{name}-py310 -f python310/%{name}.filelist
%defattr(-,root,root)
%dir %{python310_sitearch}/protobuf-*-py*.egg-info
%{python310_sitearch}/protobuf-*-py*.egg-info/*
%{_libdir}/pkgconfig/upb.pc
%{_libdir}/pkgconfig/utf8_range.pc
%changelog
* Sun Jun 15 2025 Automatic Build System <autodist@openmamba.org> 31.1-3mamba
- obsolete protobuf26
* Sat Jun 14 2025 Silvan Calarco <silvan.calarco@mambasoft.it> 31.1-2mamba
- rebuilt with abseil-cpp 20250512.0; obsolete protobuf28
* Thu May 29 2025 Automatic Build System <autodist@openmamba.org> 31.1-1mamba
- automatic version update by autodist
* Fri May 23 2025 Automatic Build System <autodist@openmamba.org> 31.0-1mamba
- automatic version update by autodist
* Thu Mar 27 2025 Automatic Build System <autodist@openmamba.org> 30.2-1mamba
- automatic version update by autodist
* Sat Mar 15 2025 Automatic Build System <autodist@openmamba.org> 30.1-1mamba
- automatic version update by autodist
* Sun Mar 09 2025 Automatic Build System <autodist@openmamba.org> 30.0-1mamba
- automatic version update by autodist
* Wed Feb 12 2025 Silvan Calarco <silvan.calarco@mambasoft.it> 29.3-2mamba
- obsolete protobuf25
* Sat Jan 11 2025 Automatic Build System <autodist@openmamba.org> 29.3-1mamba
- automatic version update by autodist
* Sat Jan 04 2025 Automatic Build System <autodist@openmamba.org> 29.2-1mamba
- automatic version update by autodist
* Thu Dec 05 2024 Automatic Build System <autodist@openmamba.org> 29.1-1mamba
- automatic version update by autodist
* Thu Nov 28 2024 Automatic Build System <autodist@openmamba.org> 29.0-1mamba
- automatic version update by autodist
* Wed Oct 23 2024 Automatic Build System <autodist@openmamba.org> 28.3-1mamba
- automatic version update by autodist
* Tue Oct 15 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 28.2-2mamba
- move libutf8_range.so and libutf8_validity.so from devel to lib package
* Thu Sep 19 2024 Automatic Build System <autodist@openmamba.org> 28.2-1mamba
- automatic version update by autodist
* Mon Sep 16 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 28.1-2mamba
- obsolete legacy packages
* Thu Sep 12 2024 Automatic Build System <autodist@openmamba.org> 28.1-1mamba
- automatic version update by autodist
* Sun Sep 01 2024 Automatic Build System <autodist@openmamba.org> 28.0-1mamba
- automatic version update by autodist
* Wed Aug 28 2024 Automatic Build System <autodist@openmamba.org> 27.4-1mamba
- automatic version update by autodist
* Thu Aug 01 2024 Automatic Build System <autodist@openmamba.org> 27.3-1mamba
- automatic version update by autodist
* Wed Jun 26 2024 Automatic Build System <autodist@openmamba.org> 27.2-1mamba
- automatic version update by autodist
* Thu Jun 06 2024 Automatic Build System <autodist@openmamba.org> 27.1-1mamba
- automatic version update by autodist
* Sun May 26 2024 Automatic Build System <autodist@openmamba.org> 27.0-1mamba
- automatic version update by autodist
* Fri Apr 05 2024 Automatic Build System <autodist@openmamba.org> 26.1-1mamba
- automatic version update by autodist
* Mon Feb 19 2024 Automatic Build System <autodist@openmamba.org> 25.3-1mamba
- automatic version update by autodist
* Tue Jul 04 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 21.12-2mamba
- added python 3.10 subpackage