# Copyright Vespa.ai. 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 14 %define ver_patch 0 %define ver_release 1 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} || 0%{?el9} %global _centos_stream %(grep -qs '^NAME="CentOS Stream"' /etc/os-release && echo 1 || echo 0) BuildRequires: vespa-toolset-13-meta %define _devtoolset_enable /opt/rh/gcc-toolset/enable BuildRequires: cmake %endif %if 0%{?fedora} BuildRequires: cmake BuildRequires: gcc-c++ %endif BuildRequires: make %package devel Summary: Google C++ testing framework -- gtest devel Requires: %{name}%{?_isa} = %{version}-%{release} %package -n vespa-gmock Summary: Google C++ testing framework -- gmock Requires: %{name}%{?_isa} = %{version}-%{release} %package -n vespa-gmock-devel Summary: Google C++ testing framework -- gmock devel Requires: vespa-gmock%{?_isa} = %{version}-%{release} %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} %description devel Google C++ testing framework -- gtest devel %{_vespa_3rdparty_deps_packaging_notice} %description -n vespa-gmock Google C++ testing framework -- gmock %{_vespa_3rdparty_deps_packaging_notice} %description -n vespa-gmock-devel Google C++ testing framework -- gmock devel %{_vespa_3rdparty_deps_packaging_notice} %prep %setup -q -n googletest-%{version} %build %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif mkdir build %{?_cmake_prog}%{!?_cmake_prog:cmake} \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_CXX_FLAGS="-std=c++2a ${RPM_OPT_FLAGS}" \ -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -Dgtest_build_tests=ON \ -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_INSTALL_RPATH=\$ORIGIN \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=false \ -S . \ -B build make -C build %{?_smp_mflags} %check %{?_ctest_prog}%{!?_ctest_prog:ctest} --test-dir build %{?_smp_mflags} %install %if 0%{?_devtoolset_enable:1} source %{_devtoolset_enable} || true %endif cd build %make_install %files %license LICENSE %{_libdir}/libgtest*.so.* %files devel %license LICENSE %doc CONTRIBUTORS %doc README.md %doc googletest/docs/ %doc googletest/samples %{_includedir}/gtest %{_libdir}/libgtest*.so %{_libdir}/cmake %{_libdir}/pkgconfig %files -n vespa-gmock %license LICENSE %{_libdir}/libgmock*.so.* %files -n vespa-gmock-devel %license LICENSE %doc googletest/docs %{_includedir}/gmock %{_libdir}/libgmock*.so %changelog