# Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. # Disable build id note requirement for now %undefine _missing_build_ids_terminate_build # Force special prefix for Vespa %define _prefix /opt/vespa-deps # Only strip debug info %global _find_debuginfo_opts -g # Don't provide shared library or pkgconfig %global __provides_exclude ^(lib.*\\.so\\.[0-9.]*\\([A-Za-z._0-9]*\\)\\(64bit\\)|pkgconfig\\(.*)$ # Exclude automated requires for libraries in /opt/vespa-deps/lib64. %global __requires_exclude ^lib(protobuf|protoc)\\.so\\.[0-9.]*\\([A-Za-z._0-9]*\\)\\(64bit\\)$ # Version %define ver_major 3 %define ver_minor 19 %define ver_patch 1 %define ver_release 1 Summary: Protocol Buffers for C++ runtime Name: vespa-protobuf Version: %{ver_major}.%{ver_minor}.%{ver_patch} Release: %{ver_release}%{?dist} License: BSD URL: https://github.com/protocolbuffers/protobuf Source0: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}/protobuf-cpp-%{version}.tar.gz Patch0: patches.protobuf-linker-maps.diff %if 0%{?el7} %if 0%{?amzn2} BuildRequires: gcc10-c++%{?_isa} %define _configure_args CC=gcc10-gcc CXX=gcc10-g++ CC_FOR_BUILD=gcc10-gcc CXX_FOR_BUILD=gcc10-g++ %else %define _devtoolset_enable /opt/rh/devtoolset-10/enable BuildRequires: devtoolset-10-gcc-c++%{?_isa} %endif %endif %if 0%{?el8} %define _devtoolset_enable /opt/rh/gcc-toolset-10/enable BuildRequires: gcc-toolset-10-gcc-c++ BuildRequires: make %endif %if 0%{?fedora} BuildRequires: gcc-c++ BuildRequires: make %endif %global _vespa_3rdparty_deps_packaging_notice \ See https://github.com/vespa-engine/vespa-3rdparty-deps for details \ about packaging. %description Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. This package contains protobuf runtime library for C++. %{_vespa_3rdparty_deps_packaging_notice} %package devel Summary: Protocol Buffers for C++ development Requires: %{name} = %{version}-%{release} %description devel This package contains protobuf compiler for C++ and C++ headers and libraries. %{_vespa_3rdparty_deps_packaging_notice} %prep %setup -q -n protobuf-%{version} %if 0%{?el7} && 0%{?amzn2} %patch0 -p0 %endif %build %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif mkdir build && cd build CXXFLAGS="-std=c++14 -g -O3" \ ../configure --prefix=%{_prefix} --libdir=%{_prefix}/lib64 %{?_configure_args} make %{?_smp_mflags} %install %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif cd build %make_install %define _unpackaged_files_terminate_build 0 %files %{_libdir}/libprotobuf.so.30* %license LICENSE %files devel %dir %{_includedir}/google %{_includedir}/google/protobuf/ %{_libdir}/libprotobuf.so %{_libdir}/libprotoc.so %{_libdir}/libprotoc.so.30* %{_bindir}/protoc %license LICENSE %changelog