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-calver.changes b/python-calver.changes
index fac28cf..db048f5 100644
--- a/python-calver.changes
+++ b/python-calver.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Thu Apr 20 08:02:49 UTC 2023 - Steve Kowalik
+
+- Inject multibuild.
+
-------------------------------------------------------------------
Wed Jul 13 21:23:32 UTC 2022 - Ben Greiner
diff --git a/python-calver.spec b/python-calver.spec
index 65202d3..1ae91ce 100644
--- a/python-calver.spec
+++ b/python-calver.spec
@@ -1,7 +1,7 @@
#
-# spec file for package python-calver
+# spec file
#
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,21 +16,31 @@
#
-%{?!python_module:%define python_module() python3-%{**}}
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -%{flavor}
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
%define skip_python2 1
%define ghtag 2022.06.26
-Name: python-calver
+Name: python-calver%{psuffix}
Version: 2022.6.26
Release: 0
Summary: Setuptools extension for CalVer package versions
License: Apache-2.0
URL: https://github.com/di/calver
Source: https://github.com/di/calver/archive/refs/tags/%{ghtag}.tar.gz#/calver-%{version}-gh.tar.gz
-BuildRequires: python-rpm-macros
BuildRequires: %{python_module setuptools}
+BuildRequires: python-rpm-macros
# SECTION test requirement
-BuildRequires: %{python_module pytest}
+%if %{with test}
+BuildRequires: %{python_module calver}
BuildRequires: %{python_module pretend}
+BuildRequires: %{python_module pytest}
+%endif
# /SECTION
BuildRequires: fdupes
BuildArch: noarch
@@ -49,16 +59,22 @@ sed -i 's/calver_version(True)/"%{version}"/' setup.py
%python_build
%install
+%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
%pytest
+%endif
+%if !%{with test}
%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/calver
%{python_sitelib}/calver-%{version}*-info
+%endif
%changelog