From 80190350ac4c8bfa68691827e9bd04b784cd1548 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 21 Oct 2025 12:04:24 +0800 Subject: [PATCH] fix build with wrong permission --- protobuf.spec | 64 ++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/protobuf.spec b/protobuf.spec index aa4ad9f..1db5b60 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -7,7 +7,7 @@ Summary: Protocol Buffers - Google's data interchange format Name: protobuf Version: 25.1 -Release: 10 +Release: 12 License: BSD-3-Clause URL: https://github.com/protocolbuffers/protobuf Source: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}%{?rcver}/%{name}-all-%{version}%{?rcver}.tar.gz @@ -19,8 +19,8 @@ Patch9001: 0002-Fix-CC-compiler-support.patch Patch9002: 0003-protobuf-add-coverage-compile-option.patch Patch9003: 0004-backport-CVE-2024-7254-1.patch Patch9004: 0005-backport-CVE-2024-7254-2.patch -Patch9005: 0006-fix-CVE-2025-4565-1.patch -Patch9006: 0007-fix-CVE-2025-4565-2.patch +Patch9005: 0006-fix-CVE-2025-4565-1.patch +Patch9006: 0007-fix-CVE-2025-4565-2.patch BuildRequires: cmake gcc-c++ emacs zlib-devel gmock-devel gtest-devel jsoncpp-devel BuildRequires: fdupes pkgconfig python-rpm-macros pkgconfig(zlib) ninja-build @@ -37,7 +37,8 @@ Summary: Protocol Buffers compiler Requires: %{name} = %{version}-%{release} Obsoletes: protobuf-emacs < %{version} Obsoletes: protobuf-emacs-el < %{version} -Obsoletes: protobuf2-compiler +Conflicts: protobuf2-compiler +Conflicts: ptotobuf2-emacs Requires: emacs-filesystem >= %{_emacs_version} %description compiler @@ -54,9 +55,9 @@ Provides: %{name}-static Provides: %{name}-vim Obsoletes: %{name}-static < %{version} Obsoletes: %{name}-vim < %{version} -Obsoletes: protobuf2-devel -Obsoletes: protobuf2-vim -Obsoletes: protobuf2-static +Conflicts: protobuf2-devel +Conflicts: protobuf2-vim +Conflicts: protobuf2-static %description devel @@ -79,8 +80,8 @@ Requires: %{name}-devel = %{version}-%{release} Requires: %{name}-lite = %{version}-%{release} Provides: %{name}-lite-static Obsoletes: %{name}-lite-static < %{version} -Obsoletes: protobuf2-lite-devel -Obsoletes: protobuf2-lite-static +Conflicts: protobuf2-lite-devel +Conflicts: protobuf2-lite-static %description lite-devel This package contains development libraries built with @@ -178,7 +179,7 @@ Protocol Buffer BOM POM. %setup -q -n %{name}-%{version}%{?rcver} %autopatch -p1 find -name \*.cc -o -name \*.h | xargs chmod -x -chmod 644 examples/* +find examples -type f | xargs chmod 644 %if %{with java} #%pom_remove_dep com.google.truth:truth java/pom.xml #%pom_remove_dep org.easymock:easymockclassextension java/pom.xml java/*/pom.xml @@ -225,30 +226,26 @@ mv java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \ rm -f src/solaris/libstdc++.la -mkdir build -pushd build +%build %cmake \ + -B build \ -Dprotobuf_BUILD_EXAMPLES:BOOL=OFF \ -Dprotobuf_BUILD_LIBPROTOC:BOOL=ON \ -Dprotobuf_BUILD_SHARED_LIBS:BOOL=ON \ -Dprotobuf_USE_EXTERNAL_GTEST:BOOL=ON \ -Dprotobuf_ABSL_PROVIDER=package \ -Dprotobuf_BUILD_TESTS:BOOL=OFF \ - -DCMAKE_EXE_LINKER_FLAGS=-Wl,--as-needed \ - -DCMAKE_MODULE_LINKER_FLAGS=-Wl,--as-needed \ - -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--as-needed \ - -DCMAKE_CXX_FLAGS="-g -O2" \ + -DCMAKE_EXE_LINKER_FLAGS="%{build_ldflags} -Wl,--as-needed" \ + -DCMAKE_SHARED_LINKER_FLAGS="%{build_ldflags} -Wl,--as-needed" \ + -DCMAKE_CXX_FLAGS="%{build_cxxflags} %{?_ld_as_needed_flags}" \ -DCMAKE_C_COMPILER=%{__cc} \ -DCMAKE_CXX_COMPILER=%{__cxx} \ -DCMAKE_SKIP_RPATH=TRUE \ - -G Ninja \ - ../ -popd + -G Ninja +%ninja_build -C build -mkdir build-static -pushd build-static -export CMAKE_BUILD_DIR=build-static %cmake \ + -B build-static \ -Dprotobuf_BUILD_EXAMPLES:BOOL=OFF \ -Dprotobuf_BUILD_LIBPROTOC:BOOL=ON \ -Dprotobuf_BUILD_SHARED_LIBS:BOOL=OFF \ @@ -259,12 +256,7 @@ export CMAKE_BUILD_DIR=build-static -DCMAKE_C_COMPILER=%{__cc} \ -DCMAKE_CXX_COMPILER=%{__cxx} \ -DCMAKE_SKIP_RPATH=TRUE \ - -G Ninja \ - ../ -popd - -%build -%ninja_build -C build + -G Ninja %ninja_build -C build-static # we have to override LD_LIBRARY_PATH because we eliminated rpath @@ -302,8 +294,6 @@ fail=1 %install %ninja_install -C build-static -mv %{buildroot}%{_libdir}/pkgconfig/protobuf.pc %{buildroot}%{_libdir}/pkgconfig/protobuf-static.pc -mv %{buildroot}%{_libdir}/cmake/protobuf %{buildroot}%{_libdir}/cmake/protobuf-static %ninja_install -C build %if %{with python} @@ -328,10 +318,6 @@ install -p -m 0644 editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/% mkdir -p %{buildroot}%{_emacs_sitestartdir} install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} -%ldconfig_scriptlets -%ldconfig_scriptlets lite -%ldconfig_scriptlets compiler - %files %doc CONTRIBUTORS.txt README.md %license LICENSE @@ -352,7 +338,6 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} %{_includedir}/utf8_validity.h %{_libdir}/libprotobuf.so %{_libdir}/libprotoc.so -%{_libdir}/pkgconfig/protobuf-static.pc %{_libdir}/pkgconfig/protobuf.pc %{_libdir}/pkgconfig/utf8_range.pc %doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md @@ -361,7 +346,6 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} %{_datadir}/vim/vimfiles/syntax/proto.vim %{_libdir}/cmake/utf8_range %{_libdir}/cmake/protobuf -%{_libdir}/cmake/protobuf-static %{_libdir}/libutf8_range.a %{_libdir}/libutf8_validity.a %{_includedir}/java/core/src/main/java/com/google/protobuf/java_features.proto @@ -407,6 +391,14 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} %endif %changelog +* Tue Oct 21 2025 Funda Wang - 25.1-12 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC: fix build with wrong permission +- DESC: fix conflicts with protobuf2 +- DESC: revert:distinguish between statically and dynamically compiled pc files and cmake dir to prevent BEP binary differences + * Thu Jun 26 2025 jingxiaolu - 25.1-10 - Type:bugfix - CVE:NA -- Gitee