# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. # Version %global ver_major 1 %global ver_minor 9 %global ver_patch 4 %global ver_release 1 %global version_suffix %{ver_major}.%{ver_minor}.%{ver_patch} # 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 %if 0%{?el8} || 0%{?el9} || 0%{?amzn2023} %global _use_vespa_gtest 1 %global _vespa_gtest_version 1.16.0 %endif # Libraries use shared libraries in /opt/vespa-deps/lib64 %global __brp_check_rpaths %{nil} # 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(benchmark|benchmark_main)\\.so\\.[0-9.]*\\([A-Za-z._0-9]*\\)\\(64bit\\)|pkgconfig\\(.*)$ Summary: Google Benchmark for C++ runtime Name: vespa-gbenchmark Version: %{ver_major}.%{ver_minor}.%{ver_patch} Release: %{ver_release}%{?dist} License: Apache 2.0 URL: https://github.com/google/benchmark Source0: https://github.com/google/benchmark/archive/refs/tags/v%{version}.tar.gz %if 0%{?el8} || 0%{?el9} %define _devtoolset_enable /opt/rh/gcc-toolset-14/enable BuildRequires: gcc-toolset-14-gcc-c++ BuildRequires: make %endif %if 0%{?el10} || 0%{?fedora} BuildRequires: gcc-c++ BuildRequires: make %endif BuildRequires: cmake %global _cmake_prog cmake %global _ctest_prog ctest BuildRequires: which %if 0%{?_use_vespa_gtest} BuildRequires: vespa-gtest-devel%{?_isa} = %{_vespa_gtest_version} BuildRequires: vespa-gmock-devel%{?_isa} = %{_vespa_gtest_version} %else BuildRequires: gtest-devel BuildRequires: gmock-devel %endif %global _vespa_3rdparty_deps_packaging_notice \ See https://github.com/vespa-engine/vespa-3rdparty-deps for details \ about packaging. %description Google Benchmark is microbenchmark support library. This package contains the Google Benchmark runtime library for C++. %{_vespa_3rdparty_deps_packaging_notice} %package devel Summary: Google Benchmark for C++ runtime Requires: %{name}%{?_isa} = %{version}-%{release} # Google Benchmark requires GTest for building tests, so add an explicit gtest-devel dependency %if 0%{?_use_vespa_gtest} Requires: vespa-gtest-devel%{?_isa} = %{_vespa_gtest_version} Requires: vespa-gmock-devel%{?_isa} = %{_vespa_gtest_version} %else Requires: gtest-devel Requires: gmock-devel %endif %description devel This package contains Google Benchmark for C++ with headers and libraries. %{_vespa_3rdparty_deps_packaging_notice} %prep %setup -q -n benchmark-%{version} %build %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif mkdir build %{_cmake_prog} \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_RPATH=%{_libdir} \ -DCMAKE_PREFIX_PATH=%{_prefix} \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=false \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_CXX_STANDARD=23 \ -DBENCHMARK_DOWNLOAD_DEPENDENCIES=OFF \ -DBENCHMARK_USE_BUNDLED_GTEST=OFF \ -S . \ -B build make -C build %{?_smp_mflags} %check %{_ctest_prog} --test-dir build %{?_smp_mflags} %install %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif cd build %make_install %files %{_libdir}/libbenchmark.so.* %{_libdir}/libbenchmark_main.so.* %license LICENSE %files devel %dir %{_includedir}/ %{_includedir}/benchmark %{_libdir}/cmake %{_libdir}/pkgconfig %{_libdir}/libbenchmark.so %{_libdir}/libbenchmark_main.so %exclude %{_datadir}/doc/benchmark/* %license LICENSE %changelog * Fri Sep 12 2025 Tor Brede Vekterli - 1.9.4 - Initial version of Google Benchmark Vespa C++ RPM