# Copyright 2018 Yahoo Holdings. 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.]*)?\\(\\)\\(64bit\\)|(cmake|pkgconfig)\\(.*)$ # Exclude automated requires for libraries in /opt/vespa-deps/lib64. %global __requires_exclude ^(lib(gmock|gtest)(_main)?\\.so(\\.[0-9.]*)?\\([A-Za-z._0-9]*\\)\\(64bit\\)|pkgconfig\\((gmock|gtest)(_main)?\\)( = [0-9.]*)?)$ # Version %define ver_major 1 %define ver_minor 13 %define ver_patch 0 %define ver_release 2 Summary: Google C++ testing framework Name: vespa-gtest Version: %{ver_major}.%{ver_minor}.%{ver_patch} Release: %{ver_release}%{?dist} License: BSD URL: https://github.com/google/googletest Source0: https://github.com/google/googletest/archive/refs/tags/v%{version}.tar.gz BuildRequires: python3-devel %if 0%{?el8}%{?el9} %global _centos_stream %(grep -qs '^NAME="CentOS Stream"' /etc/os-release && echo 1 || echo 0) BuildRequires: vespa-toolset-12-meta %define _devtoolset_enable /opt/rh/gcc-toolset-12/enable BuildRequires: vespa-cmake %endif %if 0%{?fedora} BuildRequires: cmake BuildRequires: gcc-c++ %endif BuildRequires: make %global _vespa_3rdparty_deps_packaging_notice \ See https://github.com/vespa-engine/vespa-3rdparty-deps for details \ about packaging. %description Framework for writing C++ tests on a variety of platforms (GNU/Linux, Mac OS X, Windows, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, various options for running the tests, and XML test report generation. %{_vespa_3rdparty_deps_packaging_notice} %prep %setup -q -n googletest-%{version} %build %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} %endif echo "Using RPM_OPT_FLAGS = ${RPM_OPT_FLAGS}" echo " aka optflags = %{optflags}" cat /usr/lib/rpm/redhat/redhat-annobin-cc1 mkdir build && cd build PATH=%{_prefix}/bin:$PATH %{?_cmake_prog}%{!?_cmake_prog:cmake} \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_CXX_FLAGS="-std=c++2a ${RPM_OPT_FLAGS}" \ -DPYTHON_EXECUTABLE=%{__python3} \ -Dgtest_build_tests=ON \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_RPATH=%{_prefix}/lib64 \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=true \ %{?_toolset_compiler_cmake_args} \ .. make %{?_smp_mflags} %install %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif cd build %make_install %files %license LICENSE %doc CONTRIBUTORS %doc README.md %doc googletest/docs/ %doc googletest/samples %{_includedir}/gtest/ %{_includedir}/gmock/ %{_prefix}/lib64/* %changelog