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-Automat.changes b/python-Automat.changes
index c58e6a9..efdeaf5 100644
--- a/python-Automat.changes
+++ b/python-Automat.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Thu Mar 7 09:09:35 UTC 2019 - Tomáš Chvátal
+
+- Add mulitbuild to make sure we do not cycle
+
-------------------------------------------------------------------
Tue Mar 5 12:01:41 UTC 2019 - Tomáš Chvátal
@@ -5,6 +10,7 @@ Tue Mar 5 12:01:41 UTC 2019 - Tomáš Chvátal
* test updates
* pep fixes
- Run tests
+
-------------------------------------------------------------------
Tue Jul 4 04:45:19 UTC 2017 - tbechtold@suse.com
diff --git a/python-Automat.spec b/python-Automat.spec
index 8ad2b2c..b523bd9 100644
--- a/python-Automat.spec
+++ b/python-Automat.spec
@@ -17,7 +17,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name: python-Automat
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-Automat%{psuffix}
Version: 0.7.0
Release: 0
Summary: Self-service finite-state machines for the programmer on the go
@@ -25,9 +33,6 @@ License: MIT
Group: Development/Languages/Python
URL: https://github.com/glyph/automat
Source: https://files.pythonhosted.org/packages/source/A/Automat/Automat-%{version}.tar.gz
-BuildRequires: %{python_module Twisted >= 16.1.1}
-BuildRequires: %{python_module attrs >= 16.1.0}
-BuildRequires: %{python_module graphviz >= 0.5.1}
BuildRequires: %{python_module m2r}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
@@ -40,6 +45,11 @@ Requires(preun): update-alternatives
Suggests: python-Twisted >= 16.1.1
Suggests: python-graphviz > 0.5.1
BuildArch: noarch
+%if %{with test}
+BuildRequires: %{python_module Twisted >= 16.1.1}
+BuildRequires: %{python_module attrs >= 16.1.0}
+BuildRequires: %{python_module graphviz >= 0.5.1}
+%endif
%python_subpackages
%description
@@ -53,13 +63,18 @@ automata (particularly deterministic finite-state transducers).
%python_build
%install
+%if !%{with test}
%python_install
%python_clone -a %{buildroot}%{_bindir}/automat-visualize
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
%python_exec setup.py test
+%endif
+%if !%{with test}
%post
%python_install_alternative automat-visualize
@@ -71,5 +86,6 @@ automata (particularly deterministic finite-state transducers).
%doc README.md
%python_alternative %{_bindir}/automat-visualize
%{python_sitelib}/*
+%endif
%changelog