diff --git a/protobuf-all-24.4.tar.gz b/protobuf-all-24.4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2cdad7a9f02be5939e81a64357b055e8881debfe Binary files /dev/null and b/protobuf-all-24.4.tar.gz differ diff --git a/protobuf.spec b/protobuf.spec index 3bd0bf9bd0f7ca2fa609c5f5ef0ca759a5020679..4b91d16c4ff82b58a4e0cc424a01363dfe6ba445 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -3,11 +3,12 @@ # Build -java subpackage %bcond_without java -#global rcver rc2 +#global rcver rc3 +%global so_version %{rcver}.0 Summary: Protocol Buffers - Google's data interchange format Name: protobuf -Version: 3.19.6 +Version: 24.4 Release: 1 License: BSD URL: https://github.com/protocolbuffers/protobuf @@ -15,10 +16,8 @@ Source: https://github.com/protocolbuffers/protobuf/releases/download/v% Source1: protobuf-init.el %global so_version 30 -Patch9000: 0001-add-secure-compile-option-in-Makefile.patch -Patch9001: 0002-add-secure-compile-fs-check-in-Makefile.patch -BuildRequires: make autoconf automake emacs gcc-c++ libtool pkgconfig zlib-devel +BuildRequires: cmake ninja-build gcc-c++ emacs zlib-devel gmock-devel gtest-devel abseil-cpp-devel jsoncpp-devel %description @@ -202,18 +201,29 @@ rm -f src/solaris/libstdc++.la %build iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8 mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt -export PTHREAD_LIBS="-lpthread" -./autogen.sh -%configure -%make_build CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits" + +%cmake . -G Ninja \ + -Dprotobuf_BUILD_TESTS:BOOL=OFF \ + -Dprotobuf_BUILD_CONFORMANCE:BOOL=ON \ + -Dprotobuf_BUILD_LIBPROTOC:BOOL=ON \ + -Dprotobuf_ABSL_PROVIDER:STRING="package" \ + -Dprotobuf_JSONCPP_PROVIDER:STRING="package" \ + -Dprotobuf_USE_EXTERNAL_GTEST:BOOL=ON \ + --no-warn-unused-cli + +%cmake_build %if %{with python} pushd python +PROTOC="../%{_vpath_builddir}/protoc" \ +CXXFLAGS="%{build_cxxflags}" \ +LDFLAGS="-L../%{_vpath_builddir} -L../%{_vpath_builddir}/third_party/utf8_range %{build_ldflags}" \ %py3_build popd %endif %if %{with java} +sed -i 's|${protobuf.basedir}/protoc|${protobuf.basedir}/%{_vpath_builddir}/protoc|' java/pom.xml %pom_disable_module kotlin java/pom.xml %pom_disable_module kotlin-lite java/pom.xml %mvn_build -s -- -Dmaven.test.skip=true -f java/pom.xml @@ -229,45 +239,50 @@ fail=0 %else fail=1 %endif -%make_build check CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits" || exit $fail +%ctest %install -%make_install %{?_smp_mflags} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" +%cmake_install find %{buildroot} -type f -name "*.la" -exec rm -f {} \; +find %{buildroot} -type f -name "*.o" -exec rm -f {} + +find %{buildroot} -type f -name "*.a" -exec rm -f {} + %if %{with 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 %py3_install find %{buildroot}%{python3_sitelib} -name \*.py | xargs sed -i -e '1{\@^#!@d}' popd %endif -install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim +%__install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim %if %{with java} %mvn_install %endif -mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name} -install -p -m 0644 editors/protobuf-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name} -install -p -m 0644 editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/%{name} -mkdir -p %{buildroot}%{_emacs_sitestartdir} -install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} +%__mkdir -p %{buildroot}%{_emacs_sitelispdir}/protobuf +%__install -p -m 0644 editors/protobuf-mode.el %{buildroot}%{_emacs_sitelispdir}/protobuf +%__install -p -m 0644 editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/protobuf +%__mkdir -p %{buildroot}%{_emacs_sitestartdir} +%__install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} %ldconfig_scriptlets %ldconfig_scriptlets lite %ldconfig_scriptlets compiler %files -%doc CHANGES.txt CONTRIBUTORS.txt README.md +%doc CONTRIBUTORS.txt README.md %license LICENSE -%{_libdir}/libprotobuf.so.%{so_version}{,.*} +%{_libdir}/libprotobuf.so.%{so_version}* +%{_libdir}/libutf8_validity.so %files compiler -%{_bindir}/protoc -%{_libdir}/libprotoc.so.%{so_version}{,.*} +%{_bindir}/protoc* +%{_libdir}/libprotoc.so.%{so_version}* %{_emacs_sitelispdir}/%{name}/ %{_emacs_sitestartdir}/protobuf-init.el %license LICENSE @@ -277,16 +292,23 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir} %files devel %dir %{_includedir}/google %{_includedir}/google/protobuf/ +%{_includedir}/utf8_*.h %{_libdir}/libprotobuf.so +%{_libdir}/libprotobuf-lite.so %{_libdir}/libprotoc.so +%{_libdir}/libutf8_range.so +%{_libdir}/cmake/protobuf/ +%{_libdir}/cmake/utf8_range/ %{_libdir}/pkgconfig/protobuf.pc -%doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md +%{_libdir}/pkgconfig/protobuf-lite.pc +%{_libdir}/pkgconfig/utf8_range.pc +%doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/CMakeLists.txt examples/README.m %{_libdir}/libprotobuf.a %{_libdir}/libprotoc.a %{_datadir}/vim/vimfiles/syntax/proto.vim %files lite -%{_libdir}/libprotobuf-lite.so.%{so_version}{,.*} +%{_libdir}/libprotobuf-lite.so.* %files lite-devel %{_libdir}/libprotobuf-lite.so