From e98440220d4e67ec4dcbbefe3488c4b3c6808247 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 21 Oct 2025 12:56:29 +0800 Subject: [PATCH] fix build with wrong permission --- protobuf.spec | 66 +++++++++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/protobuf.spec b/protobuf.spec index 9d2951a..35e5125 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -2,17 +2,13 @@ # Build -python subpackage %bcond_without python # Build -java subpackage -%ifarch loongarch64 -%bcond_with java -%else %bcond_without java -%endif Summary: Protocol Buffers - Google's data interchange format Name: protobuf Version: 25.1 -Release: 9 -License: BSD +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 Source1: protobuf-init.el @@ -41,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 @@ -58,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 @@ -83,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 @@ -182,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 @@ -229,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 \ @@ -263,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 @@ -306,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} @@ -332,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 @@ -356,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 @@ -365,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 @@ -411,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 Jul 03 2025 wujichao - 25.1-9 - Type:bugfix - ID:NA -- Gitee