File project.diff of Package ninja
--- ninja.spec.orig
+++ ninja.spec
@@ -1,7 +1,7 @@
#
# spec file for package ninja
#
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,16 +15,11 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
-%global flavor @BUILD_FLAVOR@%{nil}
-%if "%{flavor}" == "test"
-%define name_ext -test
-%bcond_without test
-%else
-%define name_ext %{nil}
-%bcond_with test
-%endif
-Name: ninja%{name_ext}
+%if 0%{?gcc_version} < 12
+%global with_gcc 12
+%endif
+Name: ninja
Version: 1.13.0
Release: 0
Summary: A small build system closest in spirit to Make
@@ -36,10 +31,8 @@ Source1: macros.ninja
Patch1: ninja-disable-maxprocs-test.patch
Patch2: ninja-re2c-g.patch
BuildRequires: cmake
-BuildRequires: gcc-c++
-%if %{with test}
-BuildRequires: googletest-devel
-%endif
+BuildRequires: gcc%{?with_gcc}
+BuildRequires: gcc%{?with_gcc}-c++
BuildRequires: python3-base
BuildRequires: re2c
@@ -53,33 +46,25 @@ building them, quickly.
%build
export CFLAGS="%{optflags}"
-%if "%__isa_bits" == "32"
+%if "%{__isa_bits}" == "32"
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
%endif
export CXXFLAGS="$CFLAGS"
-%if %{without test}
-%cmake -DBUILD_TESTING=OFF
-%else
-%cmake
+%if 0%{?with_gcc}
+export CC=gcc-%{with_gcc}
+export CXX=g++-%{with_gcc}
%endif
+%cmake -DBUILD_TESTING=OFF
%cmake_build
%install
-%if %{without test}
%cmake_install
install -D -p -m 0644 misc/zsh-completion %{buildroot}%{_datadir}/zsh/site-functions/_ninja
install -D -p -m 0644 misc/ninja.vim %{buildroot}%{_datadir}/vim/site/syntax/ninja.vim
install -D -p -m 0644 misc/bash-completion %{buildroot}%{_datadir}/bash-completion/completions/ninja
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.ninja
-%endif
-
-%check
-%if %{with test}
-%ctest
-%endif
%files
-%if %{without test}
%license COPYING
%{_bindir}/ninja
%{_datadir}/bash-completion
@@ -88,4 +73,3 @@ install -D -p -m 0644 %{SOURCE1} %{build
%{_rpmconfigdir}/macros.d/macros.ninja
%changelog
-%endif
\ No newline at end of file