%global gtest_version 1.14.0 %global absl_version 20230802.1 # build -python subpackage %define with_python %{?_without_python: 0} %{?!_without_python: 1} # don't require gtest for building %define without_gtest %{?_without_gtest: 0} %{?!_without_gtest: 1} # don't build static subpackages %define with_static %{?_with_static: 1} %{?!_with_static: 0} Summary: Protocol Buffers - Google's data interchange format Summary(ja): Protocol Buffers - Google のデータ交換フォーマット Name: protobuf Version: 24.4 Release: 1%{?_dist_release} Group: system Vendor: Project Vine Distribution: Vine Linux License: BSD URL: https://github.com/protocolbuffers/protobuf Source: https://github.com/protocolbuffers/protobuf/archive/v%{version}%{?rcver}/%{name}-%{version}%{?rcver}-all.tar.gz Source1: ftdetect-proto.vim Source3: https://github.com/google/googletest/archive/refs/tags/v%{gtest_version}.tar.gz#/googletest-%{gtest_version}.tar.gz Patch1: add-missing-stdint-header.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: cmake pkgconfig BuildRequires: abseil-cpp-devel %if !%{without_gtest} BuildRequires: gtest-devel %endif BuildRequires: zlib-devel %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. %package compiler Summary: Protocol Buffers compiler Group: programming Requires: %{name} = %{version}-%{release} %description compiler This package contains Protocol Buffers compiler for all programming languages %package devel Summary: Protocol Buffers C++ headers and libraries Group: programming Requires: %{name} = %{version}-%{release} Requires: %{name}-compiler = %{version}-%{release} Requires: pkgconfig %description devel This package contains Protocol Buffers compiler for all languages and C++ headers and libraries %if %{with_static} %package static Summary: Static development files for %{name} Group: programming Requires: %{name} = %{version}-%{release} %description static Static libraries for Protocol Buffers %endif %package lite Summary: Protocol Buffers LITE_RUNTIME libraries Group: system %description lite 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-devel Summary: Protocol Buffers LITE_RUNTIME development libraries Group: programming Requires: %{name}-devel = %{version}-%{release} Requires: %{name}-lite = %{version}-%{release} %description lite-devel 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. %if %{with_static} %package lite-static Summary: Static development files for %{name}-lite Group: programming 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. %endif %if %{with_python} %package -n python3-%{name} Summary: Python bindings for Google Protocol Buffers Group: programming BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-six Conflicts: %{name}-compiler > %{version} Conflicts: %{name}-compiler < %{version} Obsoletes: %{name}-python < %{version}-%{release} Provides: %{name}-python3 = %{version}-%{release} %description -n python3-%{name} This package contains Python libraries for Google Protocol Buffers %endif %package vim Summary: Vim syntax highlighting for Google Protocol Buffers descriptions Group: accessories Requires(pre): vim Requires: vim %description vim This package contains syntax highlighting for Google Protocol Buffers descriptions in Vim editor %debug_package %prep %setup -a 3 %patch1 -p1 rm -rf examples/go/* mv googletest-%{gtest_version}/* third_party/googletest/ find -name \*.cc -o -name \*.h | xargs chmod -x chmod 644 examples/* %if %{with_python} sed -i '/apputils/d' python/setup.py sed -i '/google_test_dir/d' python/setup.py %endif # kill shebang that we do not really want sed -i -e '/env python/d' python/google/protobuf/internal/*.py %build iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8 mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt %cmake \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_ABSL_PROVIDER=package %cmake_build %if %{with_python} export PROTOC=../%{_vpath_builddir}/protoc pushd python %py3_build popd %endif %install %cmake_install install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim %if %{with_python} export PROTOC=../%{_vpath_builddir}/protoc pushd python %py3_install 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 rm -f %{buildroot}%{_datadir}/vim/site/syntax/proto.vim %if !%{without_gtest} %check %ctest %endif %clean rm -rf %{buildroot} %files %defattr(-, root, root, -) %{_libdir}/libprotobuf.so.* %doc CONTRIBUTORS.txt README.md %license LICENSE %files compiler %defattr(-, root, root, -) %{_bindir}/protoc %{_bindir}/protoc-* %{_libdir}/libprotoc.so.* %doc README.md %license LICENSE %files devel %defattr(-, root, root, -) %dir %{_includedir}/google %{_includedir}/google/protobuf/ %{_includedir}/utf8_* %{_libdir}/cmake/protobuf %{_libdir}/cmake/utf8_range %{_libdir}/libprotobuf.so %{_libdir}/libprotoc.so %{_libdir}/libutf8_range.a %{_libdir}/libutf8_validity.a %{_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 %if %{with_static} %files static %defattr(-, root, root, -) %{_libdir}/libprotobuf.a %{_libdir}/libprotoc.a %endif %files lite %defattr(-, root, root, -) %{_libdir}/libprotobuf-lite.so.* %files lite-devel %defattr(-, root, root, -) %{_libdir}/libprotobuf-lite.so %{_libdir}/pkgconfig/protobuf-lite.pc %if %{with_static} %files lite-static %defattr(-, root, root, -) %{_libdir}/libprotobuf-lite.a %endif %if %{with_python} %files -n python3-%{name} %defattr(-, root, root, -) %dir %{python3_sitelib}/google %{python3_sitelib}/google/protobuf/ %{python3_sitelib}/protobuf-*.egg-info/ %{python3_sitelib}/protobuf-*-nspkg.pth %doc python/README.md %doc examples/add_person.py examples/list_people.py examples/addressbook.proto %endif %files vim %defattr(-, root, root, -) %{_datadir}/vim/vimfiles/ftdetect/proto.vim %{_datadir}/vim/vimfiles/syntax/proto.vim %changelog * Thu Sep 09 2021 Tomohiro "Tomo-p" KATO 3.17.3-1 - new upstream release. - dropped java stuff. - dropped ldconfig scriptlets. - dropped Patch0 and 1. - imported Patch1 from upstream. * Thu Jun 30 2016 Tomohiro "Tomo-p" KATO 2.6.1-1 - updated to 2.6.1. * Sat Oct 4 2014 Ryoichi INAGAKI 2.5.0-2 - moved main and protobuf-lite to System Environment/Libraries Group * Sun Mar 31 2013 Daisuke SUZUKI 2.5.0-1 - update to 2.5.0 * Thu Feb 16 2012 Yoji TOYODA 2.4.1-1 - update to 2.4.1 * Thu Sep 30 2010 Shu KONNO 2.3.0-3 - rebuilt with rpm-4.8.1 for pkg-config * Tue May 25 2010 IWAI, Masaharu 2.3.0-2 - add missing Group tag for protobuf-lite-devel - fix files list in python sub package * Sun May 23 2010 Kazutaka HARADA 2.3.0-1 - initial build for Vine Linux based on fedora development * Tue May 4 2010 Conrad Meyer - 2.3.0-1 - bump to 2.3.0 * Wed Sep 30 2009 Lev Shamardin - 2.2.0-2 - added export PTHREAD_LIBS="-lpthread" * Fri Sep 18 2009 Lev Shamardin - 2.2.0-1 - Upgraded to upstream protobuf-2.2.0 - New -lite packages * Sun Mar 01 2009 Caolán McNamra - 2.0.2-8 - add stdio.h for sprintf, perror, etc. * Thu Feb 26 2009 Fedora Release Engineering - 2.0.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Tue Dec 23 2008 Lev Shamardin - 2.0.2-6 - Small fixes for python 2.6 eggs. - Temporarily disabled java subpackage due to build problems, will be fixed and turned back on in future. * Thu Nov 27 2008 Lev Shamardin - 2.0.2-5 - No problems with ppc & ppc64 arch in rawhide, had to do a release bump. * Sat Nov 22 2008 Lev Shamardin - 2.0.2-4 - Added patch from subversion r70 to workaround gcc 4.3.0 bug (see http://code.google.com/p/protobuf/issues/detail?id=45 for more details). * Tue Nov 11 2008 Lev Shamardin - 2.0.2-3 - Added conflicts to java and python subpackages to prevent using with wrong compiler versions. - Fixed license. - Fixed BuildRequires for -python subpackage. - Fixed Requires and Group for -javadoc subpackage. - Fixed Requires for -devel subpackage. - Fixed issue with wrong shebang in descriptor_pb2.py. - Specify build options via --with/--without. - Use Fedora-packaged gtest library instead of a bundled one by default (optional). * Fri Oct 31 2008 Lev Shamardin - 2.0.2-2 - Use python_sitelib macro instead of INSTALLED_FILES. - Fix the license. - Fix redundant requirement for -devel subpackage. - Fix wrong dependences for -python subpackage. - Fix typo in requirements for -javadoc subpackage. - Use -p option for cp and install to preserve timestamps. - Remove unneeded ldconfig call for post scripts of -devel subpackage. - Fix directories ownership. * Sun Oct 12 2008 Lev Shamardin - 2.0.2-1 - Update to version 2.0.2 - New -java and -javadoc subpackages. - Options to disable building of -python and -java* subpackages * Mon Sep 15 2008 Lev Shamardin - 2.0.1-2 - Added -p switch to install commands to preserve timestamps. - Fixed Version and Libs in pkgconfig script. - Added pkgconfig requires for -devel package. - Removed libtool archives from -devel package. * Thu Sep 04 2008 Lev Shamardin - 2.0.1-1 - Updated to 2.0.1 version. * Wed Aug 13 2008 Lev Shamardin - 2.0.0-0.1.beta - Initial package version. Credits for vim subpackage and pkgconfig go to Rick L Vinyard Jr