# 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 11 %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/release-%{version}.tar.gz BuildRequires: python3-devel %if 0%{?el7} %if 0%{?amzn2} BuildRequires: gcc10-c++%{?_isa} %define _toolset_compiler_cmake_args -DCMAKE_C_COMPILER=gcc10-gcc -DCMAKE_CXX_COMPILER=gcc10-g++ %else %define _devtoolset_enable /opt/rh/devtoolset-10/enable BuildRequires: devtoolset-10-gcc-c++%{?_isa} %endif BuildRequires: cmake3 %define _cmake_prog cmake3 %endif %if 0%{?el8} %global _centos_stream %(grep -qs '^NAME="CentOS Stream"' /etc/os-release && echo 1 || echo 0) %if 0%{?_centos_stream} || 0%{?rocky} || 0%{?almalinux} BuildRequires: gcc-toolset-11-gcc-c++ BuildRequires: gcc-toolset-11-annobin BuildRequires: gcc-toolset-11-annobin-plugin-gcc %define _devtoolset_enable /opt/rh/gcc-toolset-11/enable %else %define _devtoolset_enable /opt/rh/gcc-toolset-10/enable BuildRequires: gcc-toolset-10-gcc-c++ BuildRequires: gcc-toolset-10-annobin %endif BuildRequires: 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-release-%{version} %build %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif mkdir build && cd build %{?_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