update to 25.1
Signed-off-by: zhongtao <zhongtao17@huawei.com>
This commit is contained in:
parent
7c46ec465e
commit
93e850f181
@ -1,24 +0,0 @@
|
|||||||
From 03ce780382f83b0921a55f9e06bb59c6ce7b03f1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: zhongtao <zhongtao17@huawei.com>
|
|
||||||
Date: Fri, 21 Jul 2023 17:30:51 +0800
|
|
||||||
Subject: [PATCH] add secure compile option in Makefile
|
|
||||||
|
|
||||||
---
|
|
||||||
src/Makefile.am | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
||||||
index 1d9cd6fb4..cd9f7cff5 100644
|
|
||||||
--- a/src/Makefile.am
|
|
||||||
+++ b/src/Makefile.am
|
|
||||||
@@ -19,6 +19,7 @@ PTHREAD_DEF =
|
|
||||||
endif
|
|
||||||
|
|
||||||
PROTOBUF_VERSION = 30:6:0
|
|
||||||
+PROTOBUF_OPT_FLAG += -Wl,-z,now
|
|
||||||
|
|
||||||
if GCC
|
|
||||||
# Turn on all warnings except for sign comparison (we ignore sign comparison
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
26
0001-add-secure-compile-option.patch
Normal file
26
0001-add-secure-compile-option.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From bc32151458494ce41b4ccc0e0e87999ce27a15fc Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhongtao <zhongtao17@huawei.com>
|
||||||
|
Date: Wed, 10 Jan 2024 16:21:07 +0800
|
||||||
|
Subject: [PATCH] add secure compile option
|
||||||
|
|
||||||
|
Signed-off-by: zhongtao <zhongtao17@huawei.com>
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 4137ce2..05ee303 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -2,6 +2,8 @@
|
||||||
|
# to 3.26.
|
||||||
|
cmake_minimum_required(VERSION 3.10...3.26)
|
||||||
|
|
||||||
|
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,now -fstack-check")
|
||||||
|
+
|
||||||
|
# Revert to old behavior for MSVC debug symbols.
|
||||||
|
if(POLICY CMP0141)
|
||||||
|
cmake_policy(SET CMP0141 OLD)
|
||||||
|
--
|
||||||
|
2.43.0
|
||||||
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
From 3908a54725aae8ed549ba527306c9b4a5551bf88 Mon Sep 17 00:00:00 2001
|
|
||||||
From: zhongtao <zhongtao17@huawei.com>
|
|
||||||
Date: Fri, 21 Jul 2023 17:32:52 +0800
|
|
||||||
Subject: [PATCH] add secure compile fs check in Makefile
|
|
||||||
|
|
||||||
Signed-off-by: haozi007 <liuhao27@huawei.com>
|
|
||||||
---
|
|
||||||
src/Makefile.am | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
|
||||||
index cd9f7cff5..df9d134ed 100644
|
|
||||||
--- a/src/Makefile.am
|
|
||||||
+++ b/src/Makefile.am
|
|
||||||
@@ -19,7 +19,7 @@ PTHREAD_DEF =
|
|
||||||
endif
|
|
||||||
|
|
||||||
PROTOBUF_VERSION = 30:6:0
|
|
||||||
-PROTOBUF_OPT_FLAG += -Wl,-z,now
|
|
||||||
+PROTOBUF_OPT_FLAG += -Wl,-z,now -fstack-check
|
|
||||||
|
|
||||||
if GCC
|
|
||||||
# Turn on all warnings except for sign comparison (we ignore sign comparison
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
Binary file not shown.
125
protobuf.spec
125
protobuf.spec
@ -1,24 +1,24 @@
|
|||||||
|
#needsrootforbuild
|
||||||
# Build -python subpackage
|
# Build -python subpackage
|
||||||
%bcond_without python
|
%bcond_without python
|
||||||
# Build -java subpackage
|
# Build -java subpackage
|
||||||
%bcond_without java
|
%bcond_without java
|
||||||
|
|
||||||
#global rcver rc2
|
|
||||||
|
|
||||||
Summary: Protocol Buffers - Google's data interchange format
|
Summary: Protocol Buffers - Google's data interchange format
|
||||||
Name: protobuf
|
Name: protobuf
|
||||||
Version: 3.19.6
|
Version: 25.1
|
||||||
Release: 2
|
Release: 1
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: https://github.com/protocolbuffers/protobuf
|
URL: https://github.com/protocolbuffers/protobuf
|
||||||
Source: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}%{?rcver}/%{name}-all-%{version}%{?rcver}.tar.gz
|
Source: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}%{?rcver}/%{name}-all-%{version}%{?rcver}.tar.gz
|
||||||
Source1: protobuf-init.el
|
Source1: protobuf-init.el
|
||||||
%global so_version 30
|
%global so_version 25.1
|
||||||
|
|
||||||
Patch9000: 0001-add-secure-compile-option-in-Makefile.patch
|
Patch9000: 0001-add-secure-compile-option.patch
|
||||||
Patch9001: 0002-add-secure-compile-fs-check-in-Makefile.patch
|
|
||||||
|
|
||||||
BuildRequires: make autoconf automake emacs gcc-c++ libtool pkgconfig zlib-devel
|
BuildRequires: cmake gcc-c++ emacs zlib-devel gmock-devel gtest-devel jsoncpp-devel
|
||||||
|
BuildRequires: fdupes pkgconfig python-rpm-macros pkgconfig(zlib) ninja-build
|
||||||
|
BuildRequires: abseil-cpp-devel >= 20230802
|
||||||
|
|
||||||
%description
|
%description
|
||||||
|
|
||||||
@ -43,6 +43,7 @@ Summary: Protocol Buffers C++ headers and libraries
|
|||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name} = %{version}-%{release}
|
||||||
Requires: %{name}-compiler = %{version}-%{release}
|
Requires: %{name}-compiler = %{version}-%{release}
|
||||||
Requires: zlib-devel pkgconfig vim-enhanced
|
Requires: zlib-devel pkgconfig vim-enhanced
|
||||||
|
Requires: abseil-cpp-devel >= 20230802
|
||||||
Provides: %{name}-static
|
Provides: %{name}-static
|
||||||
Provides: %{name}-vim
|
Provides: %{name}-vim
|
||||||
Obsoletes: %{name}-static < %{version}
|
Obsoletes: %{name}-static < %{version}
|
||||||
@ -105,15 +106,25 @@ This package contains Python 3 libraries for Google Protocol Buffers
|
|||||||
%package java
|
%package java
|
||||||
Summary: Java Protocol Buffers runtime library
|
Summary: Java Protocol Buffers runtime library
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
BuildRequires: java-devel >= 1.6
|
||||||
|
BuildRequires: jpackage-utils
|
||||||
BuildRequires: maven-local
|
BuildRequires: maven-local
|
||||||
BuildRequires: mvn(com.google.code.gson:gson)
|
BuildRequires: mvn(com.google.code.gson:gson)
|
||||||
BuildRequires: mvn(com.google.guava:guava)
|
BuildRequires: mvn(com.google.guava:guava)
|
||||||
BuildRequires: mvn(junit:junit)
|
BuildRequires: mvn(junit:junit)
|
||||||
|
BuildRequires: mvn(org.easymock:easymock)
|
||||||
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||||||
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
|
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
|
||||||
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
|
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
|
||||||
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
|
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
|
||||||
BuildRequires: mvn(org.easymock:easymock)
|
BuildRequires: maven-compiler-plugin
|
||||||
|
BuildRequires: maven-install-plugin
|
||||||
|
BuildRequires: maven-jar-plugin
|
||||||
|
BuildRequires: maven-javadoc-plugin
|
||||||
|
BuildRequires: maven-release-plugin
|
||||||
|
BuildRequires: maven-resources-plugin
|
||||||
|
BuildRequires: maven-surefire-plugin
|
||||||
|
BuildRequires: maven-antrun-plugin
|
||||||
Obsoletes: %{name}-javanano < 3.6.0
|
Obsoletes: %{name}-javanano < 3.6.0
|
||||||
|
|
||||||
%description java
|
%description java
|
||||||
@ -171,6 +182,9 @@ chmod 644 examples/*
|
|||||||
%pom_remove_dep com.google.guava:guava-testlib java/pom.xml java/util/pom.xml
|
%pom_remove_dep com.google.guava:guava-testlib java/pom.xml java/util/pom.xml
|
||||||
%pom_remove_dep com.google.j2objc:j2objc-annotations java/util/pom.xml
|
%pom_remove_dep com.google.j2objc:j2objc-annotations java/util/pom.xml
|
||||||
|
|
||||||
|
%pom_remove_plugin org.codehaus.mojo:animal-sniffer-maven-plugin java/pom.xml java/util/pom.xml
|
||||||
|
%pom_remove_dep org.mockito:mockito-core java/pom.xml java/core/pom.xml java/lite/pom.xml java/util/pom.xml
|
||||||
|
|
||||||
# These use easymockclassextension
|
# These use easymockclassextension
|
||||||
rm java/core/src/test/java/com/google/protobuf/ServiceTest.java
|
rm java/core/src/test/java/com/google/protobuf/ServiceTest.java
|
||||||
|
|
||||||
@ -205,21 +219,54 @@ mv java/core/src/test/java/com/google/protobuf/DecodeUtf8Test.java \
|
|||||||
|
|
||||||
rm -f src/solaris/libstdc++.la
|
rm -f src/solaris/libstdc++.la
|
||||||
|
|
||||||
|
mkdir build
|
||||||
|
pushd build
|
||||||
|
%cmake \
|
||||||
|
-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" \
|
||||||
|
-G Ninja \
|
||||||
|
../
|
||||||
|
popd
|
||||||
|
|
||||||
|
mkdir build-static
|
||||||
|
pushd build-static
|
||||||
|
export CMAKE_BUILD_DIR=build-static
|
||||||
|
%cmake \
|
||||||
|
-Dprotobuf_BUILD_EXAMPLES:BOOL=OFF \
|
||||||
|
-Dprotobuf_BUILD_LIBPROTOC:BOOL=ON \
|
||||||
|
-Dprotobuf_BUILD_SHARED_LIBS:BOOL=OFF \
|
||||||
|
-Dprotobuf_USE_EXTERNAL_GTEST:BOOL=ON \
|
||||||
|
-Dprotobuf_ABSL_PROVIDER=package \
|
||||||
|
-Dprotobuf_BUILD_TESTS:BOOL=OFF \
|
||||||
|
-G Ninja \
|
||||||
|
../
|
||||||
|
popd
|
||||||
|
|
||||||
%build
|
%build
|
||||||
iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8
|
%ninja_build -C build
|
||||||
mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt
|
%ninja_build -C build-static
|
||||||
export PTHREAD_LIBS="-lpthread"
|
|
||||||
./autogen.sh
|
|
||||||
%configure
|
|
||||||
%make_build CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits"
|
|
||||||
|
|
||||||
%if %{with python}
|
%if %{with python}
|
||||||
|
# Use the just built protoc instead of any
|
||||||
|
# system version for python and/or java bindings
|
||||||
|
export PROTOC=../build/protoc
|
||||||
pushd python
|
pushd python
|
||||||
|
CXXFLAGS="%{build_cxxflags}" \
|
||||||
|
LDFLAGS="-L../%{_vpath_builddir} -L../%{_vpath_builddir}/third_party/utf8_range %{build_ldflags}" \
|
||||||
%py3_build
|
%py3_build
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with java}
|
%if %{with java}
|
||||||
|
cp build/protoc ./
|
||||||
%pom_disable_module kotlin java/pom.xml
|
%pom_disable_module kotlin java/pom.xml
|
||||||
%pom_disable_module kotlin-lite java/pom.xml
|
%pom_disable_module kotlin-lite java/pom.xml
|
||||||
%mvn_build -s -- -Dmaven.test.skip=true -f java/pom.xml
|
%mvn_build -s -- -Dmaven.test.skip=true -f java/pom.xml
|
||||||
@ -235,15 +282,16 @@ fail=0
|
|||||||
%else
|
%else
|
||||||
fail=1
|
fail=1
|
||||||
%endif
|
%endif
|
||||||
%make_build check CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits" || exit $fail
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install %{?_smp_mflags} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p"
|
%ninja_install -C build-static
|
||||||
find %{buildroot} -type f -name "*.la" -exec rm -f {} \;
|
%ninja_install -C build
|
||||||
|
|
||||||
%if %{with python}
|
%if %{with python}
|
||||||
pushd python
|
pushd python
|
||||||
|
CXXFLAGS="%{build_cxxflags}" \
|
||||||
|
LDFLAGS="-L../%{_vpath_builddir} -L../%{_vpath_builddir}/third_party/utf8_range %{build_ldflags}" \
|
||||||
#python ./setup.py install --root=%{buildroot} --single-version-externally-managed --record=INSTALLED_FILES --optimize=1
|
#python ./setup.py install --root=%{buildroot} --single-version-externally-managed --record=INSTALLED_FILES --optimize=1
|
||||||
%py3_install
|
%py3_install
|
||||||
find %{buildroot}%{python3_sitelib} -name \*.py |
|
find %{buildroot}%{python3_sitelib} -name \*.py |
|
||||||
@ -267,7 +315,7 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
|
|||||||
%ldconfig_scriptlets compiler
|
%ldconfig_scriptlets compiler
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc CHANGES.txt CONTRIBUTORS.txt README.md
|
%doc CONTRIBUTORS.txt README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{_libdir}/libprotobuf.so.%{so_version}{,.*}
|
%{_libdir}/libprotobuf.so.%{so_version}{,.*}
|
||||||
|
|
||||||
@ -279,17 +327,23 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%dir %{_includedir}/google
|
%doc CONTRIBUTORS.txt README.md
|
||||||
%{_includedir}/google/protobuf/
|
%{_bindir}/protoc*
|
||||||
|
%{_includedir}/google
|
||||||
|
%{_includedir}/*.h
|
||||||
|
%{_libdir}/cmake/protobuf
|
||||||
|
%{_libdir}/cmake/utf8_range
|
||||||
|
%{_libdir}/pkgconfig/*
|
||||||
|
%{_libdir}/libprotobuf-lite.so
|
||||||
%{_libdir}/libprotobuf.so
|
%{_libdir}/libprotobuf.so
|
||||||
%{_libdir}/libprotoc.so
|
%{_libdir}/libprotoc.so
|
||||||
%{_libdir}/pkgconfig/protobuf.pc
|
%{_libdir}/libutf8_range.a
|
||||||
%doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md
|
%{_libdir}/libutf8_validity.a
|
||||||
%{_libdir}/libprotobuf.a
|
%{_libdir}/libprotobuf.a
|
||||||
%{_libdir}/libprotoc.a
|
%{_libdir}/libprotoc.a
|
||||||
%{_datadir}/vim/vimfiles/syntax/proto.vim
|
%{_datadir}/vim
|
||||||
|
%{_includedir}/java/core/src/main/java/com/google/protobuf/java_features.proto
|
||||||
|
|
||||||
%files lite
|
%files lite
|
||||||
%{_libdir}/libprotobuf-lite.so.%{so_version}{,.*}
|
%{_libdir}/libprotobuf-lite.so.%{so_version}{,.*}
|
||||||
@ -303,8 +357,8 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
|
|||||||
%files -n python%{python3_pkgversion}-protobuf
|
%files -n python%{python3_pkgversion}-protobuf
|
||||||
%dir %{python3_sitelib}/google
|
%dir %{python3_sitelib}/google
|
||||||
%{python3_sitelib}/google/protobuf/
|
%{python3_sitelib}/google/protobuf/
|
||||||
%{python3_sitelib}/protobuf-%{version}%{?rcver}-py3.*.egg-info/
|
%{python3_sitelib}/%{name}-*-py3.*.egg-info/
|
||||||
%{python3_sitelib}/protobuf-%{version}%{?rcver}-py3.*-nspkg.pth
|
%{python3_sitelib}/%{name}-*-py3.*-nspkg.pth
|
||||||
%doc python/README.md
|
%doc python/README.md
|
||||||
%doc examples/add_person.py examples/list_people.py examples/addressbook.proto
|
%doc examples/add_person.py examples/list_people.py examples/addressbook.proto
|
||||||
%endif
|
%endif
|
||||||
@ -314,6 +368,7 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
|
|||||||
%doc examples/AddPerson.java examples/ListPeople.java
|
%doc examples/AddPerson.java examples/ListPeople.java
|
||||||
%doc java/README.md
|
%doc java/README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
%{_includedir}/java/core/src/main/java/com/google/protobuf/java_features.proto
|
||||||
|
|
||||||
%files java-util -f .mfiles-protobuf-java-util
|
%files java-util -f .mfiles-protobuf-java-util
|
||||||
|
|
||||||
@ -331,11 +386,23 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jan 10 2024 zhongtao <zhongtao17@huawei.com> - 25.1-1
|
||||||
|
- Type:upgrade
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: update to 25.1
|
||||||
|
|
||||||
* Wed Dec 06 2023 konglidong <konglidong@uniontech.com> - 3.19.6-2
|
* Wed Dec 06 2023 konglidong <konglidong@uniontech.com> - 3.19.6-2
|
||||||
- obsolets protobuf2 for fix install conflict
|
- Type:enhancement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: obsolets protobuf2 for fix install conflict
|
||||||
|
|
||||||
* Mon Jul 17 2023 zhongtao <zhongtao17@huawei.com> - 3.19.6-1
|
* Mon Jul 17 2023 zhongtao <zhongtao17@huawei.com> - 3.19.6-1
|
||||||
- update to 3.19.6
|
- Type:upgrade
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: update to 3.19.6
|
||||||
|
|
||||||
* Tue Oct 18 2022 chengzeruizhi <chengzeruizhi@huawei.com> - 3.14.0-6
|
* Tue Oct 18 2022 chengzeruizhi <chengzeruizhi@huawei.com> - 3.14.0-6
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user