diff --git a/5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081.zip b/5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081.zip deleted file mode 100644 index a1463746e9071cb7b6ea11dcd6bc8e9fea988936..0000000000000000000000000000000000000000 Binary files a/5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081.zip and /dev/null differ diff --git a/googletest-5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081.tar.gz b/googletest-5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..92e1ec3a7852342bf2d3fb71201bf8af9b84b9f7 Binary files /dev/null and b/googletest-5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081.tar.gz differ diff --git a/protobuf-3.19.4-all.tar.gz b/protobuf-3.19.6-all.tar.gz similarity index 42% rename from protobuf-3.19.4-all.tar.gz rename to protobuf-3.19.6-all.tar.gz index c65bee8069ecdc7b85170af7049957dc58766177..9ed632b2bd5e471942e19a14afcafe693f0e5907 100644 Binary files a/protobuf-3.19.4-all.tar.gz and b/protobuf-3.19.6-all.tar.gz differ diff --git a/protobuf.spec b/protobuf.spec index c2ed8d38a31fa43b5ef1381249e173e1f9946317..9608fbbf237823cd06a602521ad56abd13ac0fbf 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -4,22 +4,39 @@ %bcond_without java Name: protobuf -Version: 3.19.4 +Version: 3.19.6 Release: %{anolis_release}%{?dist} Summary: Protocol Buffers - Google's data interchange format License: BSD URL: https://github.com/protocolbuffers/protobuf Source0: https://github.com/protocolbuffers/protobuf/archive/refs/tags/%{name}-%{version}-all.tar.gz + +Source1: ftdetect-proto.vim +Source2: protobuf-init.el + +# We bundle a copy of the exact version of gtest that is used by upstream in +# the source RPM rather than using the system copy. This is to be discouraged, +# but necessary in this case. It is not treated as a bundled library because +# it is used only at build time, and contributes nothing to the installed +# files. We take measures to verify this in %%check. See +# https://github.com/protocolbuffers/protobuf/tree/v%%{version}/third_party to +# check the correct commit hash. +%global gtest_url https://github.com/google/googletest +%global gtest_commit 5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081 +%global gtest_dir googletest-%{gtest_commit} # For tests (using exactly the same version as the release) -Source1: https://github.com/google/googletest/archive/%{googletest_ver}.zip +Source3: %{gtest_url}/archive/%{gtest_commit}/%{gtest_dir}.tar.gz -Source2: ftdetect-proto.vim -Source3: protobuf-init.el +# Man page hand-written for Fedora in groff_man(7) format based on “protoc +# --help” output. +Source4: protoc.1 # https://bugzilla.redhat.com/show_bug.cgi?id=2051202 -Patch1: protobuf-3.19.4-jre17-add-opens.patch - +# java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) +# throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @12d5624a +# at com.google.protobuf.ServiceTest.testGetPrototype(ServiceTest.java:107) +Patch3: protobuf-3.19.4-jre17-add-opens.patch BuildRequires: make BuildRequires: autoconf BuildRequires: automake @@ -201,9 +218,14 @@ This package contains syntax highlighting for Google Protocol Buffers descriptions in the Emacs editor. %prep -%autosetup -n %{name}-%{version} -p1 -a 1 +%setup -q -n %{name}-%{version} -a3 +%patch3 -p1 -b .jre17 + +# Copy in the needed gtest/gmock implementations. +%setup -q -T -D -b 3 -n %{name}-%{version} +rm -rvf 'third_party/googletest' +mv '../%{gtest_dir}' 'third_party/googletest' -mv googletest-%{googletest_ver}/* third_party/googletest/ find -name \*.cc -o -name \*.h | xargs chmod -x chmod 644 examples/* @@ -259,8 +281,10 @@ popd %{_emacs_bytecompile} editors/protobuf-mode.el %install -%make_install %{?_smp_mflags} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" -find %{buildroot} -type f -name "*.la" -exec rm -f {} \; +%make_install STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" + +# protoc.1 man page +install -p -m 0644 -D -t '%{buildroot}%{_mandir}/man1' %{SOURCE4} %if %{with python} pushd python @@ -269,7 +293,7 @@ find %{buildroot}%{python3_sitelib} -name \*.py | xargs sed -i -e '1{\@^#!@d}' popd %endif -install -p -m 644 -D %{SOURCE2} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim +install -p -m 644 -D %{SOURCE1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim @@ -281,16 +305,12 @@ 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 %{SOURCE3} %{buildroot}%{_emacs_sitestartdir} +install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} %check fail=1 %make_build check CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits" || exit $fail -%ldconfig_scriptlets -%ldconfig_scriptlets lite -%ldconfig_scriptlets compiler - %files %license LICENSE %doc CHANGES.txt CONTRIBUTORS.txt README.md @@ -300,6 +320,7 @@ fail=1 %doc README.md %license LICENSE %{_bindir}/protoc +%{_mandir}/man1/protoc.1* %{_libdir}/libprotoc.so.30* %files devel @@ -365,5 +386,8 @@ fail=1 %endif %changelog +* Fri Jan 20 2023 Funda Wang - 3.19.6-1 +- New version 3.19.6 + * Wed Apr 27 2022 happy_orange - 3.19.4-1 - init from upstream diff --git a/protoc.1 b/protoc.1 new file mode 100644 index 0000000000000000000000000000000000000000..71e0bd588f4b37f2ac7abea6197905532b22da5c --- /dev/null +++ b/protoc.1 @@ -0,0 +1,193 @@ +.TH protoc "1" "December 2022" protoc "User Commands" +.SH NAME +protoc \- Protobuf compiler +.SH SYNOPSIS +protoc +.RI [ OPTION ] +.I PROTO_FILES +.SH DESCRIPTION +.PP +Parse +.I PROTO_FILES +and generate output based on the options given. +.SH OPTIONS +.TP +.B \-I\fIPATH\fR, \fB\-\-proto_path=\fIPATH +Specify the directory in which to search for imports. +May be specified multiple times; directories will be searched in order. +If not given, the current working directory is used. +If not found in any of the these directories, the +.B \-\-descriptor_set_in +descriptors will be checked for required proto file. +.TP +.B \-\-version +Show version info and exit. +.TP +.B \-h\fR, \fB\-\-help +Show a help message and exit. +.TP +.BI \-\-encode= MESSAGE_TYPE +Read a text-format message of the given type +from standard input and write it in binary +to standard output. +The message type must be defined in +.I PROTO_FILES +or their imports. +.TP +.B \-\-deterministic_output +When using +.BR \-\-encode , +ensure map fields are deterministically ordered. +Note that this order is not canonical, +and changes across builds or releases of +.BR protoc (1). +.TP +.BI \-\-decode= MESSAGE_TYPE +Read a binary message of the given type +from standard input and write it in text format +to standard output. +The message type must be defined in +.I PROTO_FILES +or their imports. +.TP +.B \-\-decode_raw +Read an arbitrary protocol message +from standard input and write the raw tag/value pairs in text format +to standard output. +No +.I PROTO_FILES +should be given when using this flag. +.TP +.BI \-\-descriptor_set_in= FILES +Specifies a delimited list of +.I FILES +each containing a +.B FileDescriptorSet +(a protocol buffer defined in +.BR descriptor.proto ). +The +.B FileDescriptor +for each of the +.I PROTO_FILES +provided will be loaded from these +.BR FileDescriptorSets . +If a +.B FileDescriptor +appears multiple times, the first occurrence will be used. +.TP +.B \-o\fIFILE\fR, \fB\-\-descriptor_set_out=\fIFILE +Writes a +.B FileDescriptorSet +(a protocol buffer, defined in +.BR descriptor.proto ) +containing all of the input files to +.IR FILE . +.TP +.B \-\-include_imports +When using +.BR \-\-descriptor_set_out , +also include all dependencies of the input files in the set, +so that the set is self-contained. +.TP +.B \-\-include_source_info +When using +.BR \-\-descriptor_set_out , +do not strip +.B SourceCodeInfo +from the +.BR FileDescriptorProto . +This results in vastly larger descriptors +that include information about the original location +of each decl in the source file +as well as surrounding comments. +.TP +.BI \-\-dependency_out= FILE +Write a dependency output file in the format expected by +.BR make (1). +This writes the transitive set of input file paths to +.I FILE +.TP +.BI \-\-error_format= FORMAT +Set the format in which to print errors. +.I FORMAT +may be +.RB \(oq gcc \(cq +(the default) or +.RP \(oq msvs \(cq +(Microsoft Visual Studio format). +.TP +.B \-\-fatal_warnings +Make warnings be fatal (similar to +.B \-Werr +in +.BR gcc (1)). +This flag will make +.BR protoc (1) + return with a non-zero exit code +if any warnings are generated. +.TP +.B \-\-print_free_field_numbers +Print the free field numbers of the messages +defined in the given proto files. +Groups share the same field number space with the parent message. +Extension ranges are counted as occupied fields numbers. +.TP +.BI \-\-plugin= EXECUTABLE +Specifies a plugin executable to use. +Normally, +.BR protoc (1) +searches the +.B PATH +for plugins, but you may specify additional executables +not in the path using this flag. +Additionally, +.I EXECUTABLE +may be of the form +.BR NAME=\fIPATH , +in which case the given plugin name +is mapped to the given executable +even if the executable\(cqs own name differs. +.TP +.BI \-\-cpp_out= OUT_DIR +Generate C++ header and source. +.TP +.BI \-\-csharp_out= OUT_DIR +Generate C# source file. +.TP +.BI \-\-java_out= OUT_DIR +Generate Java source file. +.TP +.BI \-\-js_out= OUT_DIR +Generate JavaScript source. +.TP +.BI \-\-kotlin_out= OUT_DIR +Generate Kotlin file. +.TP +.BI \-\-objc_out= OUT_DIR +Generate Objective-C header and source. +.TP +.BI \-\-php_out= OUT_DIR +Generate PHP source file. +.TP +.BI \-\-python_out= OUT_DIR +Generate Python source file. +.TP +.BI \-\-ruby_out= OUT_DIR +Generate Ruby source file. +.TP +.BI @ +Read options and filenames from file. +If a relative file path is specified, +the file will be searched in the working directory. +The +.B \-\-proto_path +option will not affect how this argument file is searched. +Content of the file will be expanded in the position of +.BI @ +as in the argument list. +Note that shell expansion is not applied to the content of the file +(i.e., you cannot use quotes, wildcards, escapes, commands, etc.). +Each line corresponds to a single argument, even if it contains spaces. +.SH "SEE ALSO" +.BR make (1), +.BR gcc (1)