diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..fcc7b97
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ test
+
diff --git a/ninja.changes b/ninja.changes
index b130809..0c5403f 100644
--- a/ninja.changes
+++ b/ninja.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Tue May 7 13:45:10 UTC 2024 - Christoph G
+
+- Move testing and its dependency google-test into a separate
+ package
+
-------------------------------------------------------------------
Sat May 4 21:31:20 UTC 2024 - Christoph G
diff --git a/ninja.spec b/ninja.spec
index 9b16b8c..27dca0b 100644
--- a/ninja.spec
+++ b/ninja.spec
@@ -15,21 +15,31 @@
# 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: ninja%{name_ext}
Version: 1.12.0
Release: 0
Summary: A small build system closest in spirit to Make
License: Apache-2.0
Group: Development/Tools/Building
URL: https://ninja-build.org/
-Source0: https://github.com/ninja-build/ninja/archive/v%{version}/%{name}-%{version}.tar.gz
+Source0: https://github.com/ninja-build/ninja/archive/v%{version}/ninja-%{version}.tar.gz
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: python3-base
BuildRequires: re2c
@@ -39,7 +49,7 @@ of files (typically source code and output executables) and orchestrates
building them, quickly.
%prep
-%autosetup -p1
+%autosetup -p1 -n ninja-%{version}
%build
export CFLAGS="%{optflags}"
@@ -47,7 +57,11 @@ export CFLAGS="%{optflags}"
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
%endif
export CXXFLAGS="$CFLAGS"
+%if %{without test}
+%cmake -DBUILD_TESTING=OFF
+%else
%cmake
+%endif
%cmake_build
%install
@@ -58,7 +72,9 @@ install -D -p -m 0644 misc/bash-completion %{buildroot}%{_datadir}/bash-completi
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/macros.ninja
%check
+%if %{with test}
%ctest
+%endif
%files
%license COPYING