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/python-referencing.changes b/python-referencing.changes
index 59221f5..a50808e 100644
--- a/python-referencing.changes
+++ b/python-referencing.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Tue Mar 28 09:12:37 UTC 2023 - Matej Cepl
+
+- Split package into multibuild to avoid a build cycle.
+
-------------------------------------------------------------------
Tue Mar 28 05:05:26 UTC 2023 - kastl@b1-systems.de
diff --git a/python-referencing.spec b/python-referencing.spec
index 6cbb50b..6ca533b 100644
--- a/python-referencing.spec
+++ b/python-referencing.spec
@@ -1,5 +1,5 @@
#
-# spec file for package python-referencing
+# spec file
#
# Copyright (c) 2023 SUSE LLC
#
@@ -16,7 +16,15 @@
#
-Name: python-referencing
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-referencing%{psuffix}
Version: 0.26.4
Release: 0
Summary: JSON Referencing + Python
@@ -36,6 +44,7 @@ BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: git-core
BuildRequires: python-rpm-macros
+%if %{with test}
# SECTION test requirements
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module attrs >= 22.2.0}
@@ -44,6 +53,7 @@ BuildRequires: %{python_module jsonschema}
BuildRequires: %{python_module pytest-subtests}
BuildRequires: %{python_module rpds-py >= 0.7.0}
# /SECTION
+%endif
BuildRequires: fdupes
Requires: python-attrs >= 22.2.0
Requires: python-rpds-py >= 0.7.0
@@ -60,16 +70,22 @@ JSON Referencing + Python
%pyproject_wheel
%install
+%if %{without test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
%pytest
+%endif
+%if %{without test}
%files %{python_files}
%doc CHANGELOG.rst README.rst
%license COPYING
%{python_sitelib}/referencing/
%{python_sitelib}/referencing-%{version}.dist-info/
+%endif
%changelog