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-sphinxcontrib-jquery.changes b/python-sphinxcontrib-jquery.changes
index 8f9c8c6..56678e4 100644
--- a/python-sphinxcontrib-jquery.changes
+++ b/python-sphinxcontrib-jquery.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon May 8 11:07:48 UTC 2023 - Torsten Gruner
+
+- Switch to mulitbuild to avoid build loop dependency
+
-------------------------------------------------------------------
Fri May 5 06:14:05 UTC 2023 - Steve Kowalik
diff --git a/python-sphinxcontrib-jquery.spec b/python-sphinxcontrib-jquery.spec
index 4f2f53d..4cbd653 100644
--- a/python-sphinxcontrib-jquery.spec
+++ b/python-sphinxcontrib-jquery.spec
@@ -1,5 +1,5 @@
#
-# spec file for package python-sphinxcontrib-jquery
+# spec file
#
# Copyright (c) 2023 SUSE LLC
#
@@ -16,7 +16,17 @@
#
-Name: python-sphinxcontrib-jquery
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+
+%{?sle15_python_module_pythons}
+Name: python-sphinxcontrib-jquery%{psuffix}
Version: 4.1
Release: 0
Summary: Extension to include jQuery on newer Sphinx releases
@@ -27,8 +37,11 @@ BuildRequires: %{python_module flit-core}
BuildRequires: %{python_module pip}
BuildRequires: python-rpm-macros
# SECTION test requirements
-BuildRequires: %{python_module pytest}
+%if %{with test}
BuildRequires: %{python_module Sphinx >= 1.8}
+BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module sphinxcontrib-jquery = %{version}}
+%endif
# /SECTION
BuildRequires: fdupes
Requires: python-Sphinx >= 1.8
@@ -41,21 +54,27 @@ Extension to include jQuery on newer Sphinx releases
%prep
%autosetup -p1 -n sphinxcontrib-jquery-%{version}
+%if !%{with test}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
+%if %{with test}
%check
%pytest
+%endif
+%if !%{with test}
%files %{python_files}
%doc AUTHORS CHANGES.rst README.rst
%dir %{python_sitelib}/sphinxcontrib
%dir %{python_sitelib}/sphinxcontrib/jquery
%{python_sitelib}/sphinxcontrib/jquery/*
%{python_sitelib}/sphinxcontrib_jquery-%{version}*info
+%endif
%changelog