diff --git a/protobuf.spec b/protobuf.spec index 77e08306e3ab06ce1cbbd5266bd24e7337b557ed..b97febd3fdbb42abe57c297d8584d4d404a66c11 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -1,8 +1,12 @@ -%define anolis_release 3 +%define anolis_release 4 %define googletest_ver 5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081 %bcond_without python %bcond_with java +%global gtest_url https://github.com/google/googletest +%global gtest_commit 5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081 +%global gtest_dir googletest-%{gtest_commit} + Name: protobuf Version: 3.19.6 Release: %{anolis_release}%{?dist} @@ -15,16 +19,6 @@ Source0: https://github.com/protocolbuffers/protobuf/archive/refs/tags/%{name}-% 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) Source3: %{gtest_url}/archive/%{gtest_commit}/%{gtest_dir}.tar.gz @@ -32,32 +26,58 @@ Source3: %{gtest_url}/archive/%{gtest_commit}/%{gtest_dir}.tar.gz # --help” output. Source4: protoc.1 -# 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 -BuildRequires: emacs emacs-common -BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: zlib-devel +BuildRequires: emacs emacs-common +BuildRequires: make autoconf automake gcc-c++ %description -Protocol Buffers are a way of encoding structured data in an efficient -yet extensible format. Google uses Protocol Buffers for almost all of -its internal RPC protocols and file formats. - -Protocol buffers are a flexible, efficient, automated mechanism for -serializing structured data – think XML, but smaller, faster, and -simpler. You define how you want your data to be structured once, then -you can use special generated source code to easily write and read -your structured data to and from a variety of data streams and using a -variety of languages. You can even update your data structure without -breaking deployed programs that are compiled against the "old" format. - +Protobuf, short for Protocol Buffers, is a data serialization protocol. It was +developed by Google and was released as an open-source project in 2008. It is +designed to provide a simple and efficient way to serialize structured data for +communication between different systems. + +Protobuf uses a language-neutral data format that can be used to serialize data +in a variety of programming languages such as C++, Java, Python, and Go. This +allows developers to easily share data between different systems written in +different languages. + +The main advantages of using Protobuf are: + +Efficiency: Protobuf generates smaller and faster messages than other +serialization formats such as XML and JSON. This is because Protobuf uses binary +encoding of data. + +Flexibility: Protobuf provides a flexible schema definition language that +allows developers to define complex data structures such as nested objects and +arrays. + +Interoperability: Protobuf provides language-neutral data format that can be +used by different systems written in different languages. + +Extensibility: Protobuf allows developers to add new fields to the schema +without breaking compatibility with existing systems. + +The basic concept of Protobuf is that data is defined in a .proto file, which +is a plain text file that contains the schema definition for the data. The +schema definition includes the data types, fields, and message formats. Once +the schema is defined, a code generator is used to generate source code for the +desired programming language. + +Protobuf messages are composed of fields, each with a unique identifier and a +data type. The data types include basic types such as integers, booleans, and +strings, as well as complex types such as nested objects and arrays. + +Protobuf messages can be encoded and decoded using the provided library for the +desired programming language. The encoded message can then be sent over the +network or saved to disk. + +In summary, Protobuf is a simple and efficient way to serialize structured +data for communication between different systems. Its efficiency, flexibility, +interoperability, and extensibility make it a popular choice for developers who +need to share data between different systems written in different languages. %package compiler Summary: Protocol Buffers compiler @@ -67,17 +87,6 @@ Requires: %{name} = %{version}-%{release} This package contains Protocol Buffers compiler for all programming languages -%package devel -Summary: Protocol Buffers C++ headers and libraries -Requires: %{name} = %{version}-%{release} -Requires: %{name}-compiler = %{version}-%{release} -Requires: zlib-devel -Requires: pkgconfig - -%description devel -This package contains Protocol Buffers compiler for all languages and -C++ headers and libraries - %package static Summary: Static development files for %{name} Requires: %{name}-devel = %{version}-%{release} @@ -94,7 +103,19 @@ Protocol Buffers built with optimize_for = LITE_RUNTIME. The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code which only depends libprotobuf-lite, which is much smaller than libprotobuf but lacks descriptors, reflection, and some other features. + +%package lite-static +Summary: Static development files for %{name}-lite +Requires: %{name}-devel = %{version}-%{release} +%description lite-static +This package contains static development libraries built with +optimize_for = LITE_RUNTIME. + +The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code +which only depends libprotobuf-lite, which is much smaller than libprotobuf but +lacks descriptors, reflection, and some other features. + %package lite-devel Summary: Protocol Buffers LITE_RUNTIME development libraries Requires: %{name}-devel = %{version}-%{release} @@ -104,18 +125,6 @@ Requires: %{name}-lite = %{version}-%{release} This package contains development libraries built with optimize_for = LITE_RUNTIME. -The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code -which only depends libprotobuf-lite, which is much smaller than libprotobuf but -lacks descriptors, reflection, and some other features. - -%package lite-static -Summary: Static development files for %{name}-lite -Requires: %{name}-devel = %{version}-%{release} - -%description lite-static -This package contains static development libraries built with -optimize_for = LITE_RUNTIME. - The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code which only depends libprotobuf-lite, which is much smaller than libprotobuf but lacks descriptors, reflection, and some other features. @@ -146,6 +155,16 @@ Requires: vim-enhanced This package contains syntax highlighting for Google Protocol Buffers descriptions in Vim editor +%package emacs +Summary: Emacs mode for Google Protocol Buffers descriptions +BuildArch: noarch +Requires: emacs-filesystem >= %{_emacs_version} +Obsoletes: protobuf-emacs-el < 3.6.1-4 + +%description emacs +This package contains syntax highlighting for Google Protocol Buffers +descriptions in the Emacs editor. + %if %{with java} %package java Summary: Java Protocol Buffers runtime library @@ -206,15 +225,24 @@ Protocol Buffer BOM POM. %endif -%package emacs -Summary: Emacs mode for Google Protocol Buffers descriptions -BuildArch: noarch -Requires: emacs-filesystem >= %{_emacs_version} -Obsoletes: protobuf-emacs-el < 3.6.1-4 +%package devel +Summary: Protocol Buffers C++ headers and libraries +Requires: %{name} = %{version}-%{release} +Requires: %{name}-compiler = %{version}-%{release} +Requires: zlib-devel +Requires: pkgconfig -%description emacs -This package contains syntax highlighting for Google Protocol Buffers -descriptions in the Emacs editor. +%description devel +This package contains Protocol Buffers compiler for all languages and +C++ headers and libraries + +%package doc +Summary: Doc files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name} %prep %setup -q -n %{name}-%{version} -a3 @@ -292,8 +320,8 @@ find %{buildroot}%{python3_sitelib} -name \*.py | xargs sed -i -e '1{\@^#!@d}' popd %endif -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 +install -p -m 0644 -D %{SOURCE1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim +install -p -m 0644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim %if %{with java} @@ -301,19 +329,23 @@ install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/synt %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} +install -m 0644 -p editors/protobuf-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name} +install -m 0644 -p editors/protobuf-mode.elc %{buildroot}%{_emacs_sitelispdir}/%{name} mkdir -p %{buildroot}%{_emacs_sitestartdir} -install -p -m 0644 %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} +install -m 0644 -p %{SOURCE2} %{buildroot}%{_emacs_sitestartdir} + +%generate_compatibility_deps %check fail=1 %make_build check CXXFLAGS="%{build_cxxflags} -Wno-error=type-limits" || exit $fail %files -%license LICENSE -%doc CHANGES.txt CONTRIBUTORS.txt README.md +%dir %{abidir} %{_libdir}/libprotobuf.so.30* +%{abidir}/libprotobuf.dump +%{abidir}/protoc-option.list +%license LICENSE %files compiler %doc README.md @@ -321,27 +353,29 @@ fail=1 %{_bindir}/protoc %{_mandir}/man1/protoc.1* %{_libdir}/libprotoc.so.30* +%{abidir}/libprotoc.dump %files devel -%doc examples/add_person.cc examples/addressbook.proto -%doc examples/list_people.cc examples/Makefile examples/README.md +%{_libdir}/libprotoc.so +%{_libdir}/libprotobuf.so %dir %{_includedir}/google %{_includedir}/google/protobuf/ -%{_libdir}/libprotobuf.so -%{_libdir}/libprotoc.so %{_libdir}/pkgconfig/protobuf.pc +%doc examples/add_person.cc examples/addressbook.proto +%doc examples/list_people.cc examples/Makefile examples/README.md %files emacs %{_emacs_sitelispdir}/%{name}/ %{_emacs_sitestartdir}/protobuf-init.el %files static -%{_libdir}/libprotobuf.a %{_libdir}/libprotoc.a +%{_libdir}/libprotobuf.a %files lite %{_libdir}/libprotobuf-lite.so.30* - +%{abidir}/libprotobuf-lite.dump + %files lite-devel %{_libdir}/libprotobuf-lite.so %{_libdir}/pkgconfig/protobuf-lite.pc @@ -352,16 +386,16 @@ fail=1 %if %{with python} %files -n python3-protobuf %doc python/README.md -%doc examples/add_person.py examples/list_people.py examples/addressbook.proto %dir %{python3_sitelib}/google %{python3_sitelib}/google/protobuf/ %{python3_sitelib}/protobuf-%{version}%{?rcver}-py3.*.egg-info/ %{python3_sitelib}/protobuf-%{version}%{?rcver}-py3.*-nspkg.pth +%doc examples/add_person.py examples/list_people.py examples/addressbook.proto %endif %files vim -%{_datadir}/vim/vimfiles/ftdetect/proto.vim %{_datadir}/vim/vimfiles/syntax/proto.vim +%{_datadir}/vim/vimfiles/ftdetect/proto.vim %if %{with java} %files java -f .mfiles-protobuf-java @@ -384,7 +418,13 @@ fail=1 %license LICENSE %endif +%files doc +%doc CHANGES.txt CONTRIBUTORS.txt README.md + %changelog +* Wed Apr 12 2023 Xuchun Shang - 3.19.6-4 +- Add doc package and update some description + * Tue Mar 28 2023 mgb01105731 - 3.19.6-3 - Del Specific Fields