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-celery.changes b/python-celery.changes
index 1d4f405..012a661 100644
--- a/python-celery.changes
+++ b/python-celery.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Wed Jul 24 10:50:33 UTC 2019 - Tomáš Chvátal
+
+- Switch to multibuild in order to not pull moto everywhere
+
-------------------------------------------------------------------
Fri Jul 19 12:48:17 UTC 2019 - Tomáš Chvátal
diff --git a/python-celery.spec b/python-celery.spec
index cc21d2b..850ef1d 100644
--- a/python-celery.spec
+++ b/python-celery.spec
@@ -17,7 +17,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name: python-celery
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-celery%{psuffix}
Version: 4.3.0
Release: 0
Summary: Distributed Task Queue module for Python
@@ -26,6 +34,24 @@ Group: Development/Languages/Python
URL: http://celeryproject.org
Source: https://files.pythonhosted.org/packages/source/c/celery/celery-%{version}.tar.gz
Patch2: unpin-pytest.patch
+BuildRequires: %{python_module setuptools}
+BuildRequires: fdupes
+BuildRequires: netcfg
+BuildRequires: python-rpm-macros
+Requires: python-billiard >= 3.6.0
+Requires: python-kombu >= 4.4.0
+Requires: python-python-dateutil
+Requires: python-pytz >= 2016.7
+Requires: python-vine >= 1.3.0
+Recommends: python-curses
+Recommends: python-pyOpenSSL
+Suggests: python-eventlet
+Suggests: python-gevent
+Suggests: python-pymongo
+Suggests: python-python-daemon
+Suggests: python-pytyrant
+BuildArch: noarch
+%if %{with test}
BuildRequires: %{python_module SQLAlchemy}
BuildRequires: %{python_module billiard >= 3.6.0}
BuildRequires: %{python_module boto3 >= 1.9.125}
@@ -39,27 +65,11 @@ BuildRequires: %{python_module pyOpenSSL}
BuildRequires: %{python_module pytest >= 4.3.1}
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module pytz >= 2016.7}
-BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module vine >= 1.3.0}
-BuildRequires: fdupes
-BuildRequires: netcfg
-BuildRequires: python-rpm-macros
-Requires: python-billiard >= 3.6.0
-Requires: python-kombu >= 4.4.0
-Requires: python-python-dateutil
-Requires: python-pytz >= 2016.7
-Requires: python-vine >= 1.3.0
+%endif
%ifpython3
Requires: python3-dbm
%endif
-Recommends: python-curses
-Recommends: python-pyOpenSSL
-Suggests: python-eventlet
-Suggests: python-gevent
-Suggests: python-pymongo
-Suggests: python-python-daemon
-Suggests: python-pytyrant
-BuildArch: noarch
%python_subpackages
%description
@@ -77,16 +87,22 @@ sed -i -e 's:==:>=:g' requirements/*.txt
%python_build
%install
+%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
%python_exec setup.py test
+%endif
+%if !%{with test}
%files %{python_files}
%{python_sitelib}/*
%license LICENSE
%doc Changelog README.rst TODO
%python3_only %{_bindir}/celery*
+%endif
%changelog