From d2cd8a620ad53119b00de3b23e853b75ce56559f Mon Sep 17 00:00:00 2001
From: Michel Alexandre Salim <salimma@fedoraproject.org>
Date: Thu, 20 Jan 2022 11:58:03 -0800
Subject: [PATCH] Add boostrap and check toggles to ease bootstrapping new EPEL
 releases

Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
---
 python-tomli-w.spec | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/python-tomli-w.spec b/python-tomli-w.spec
index 087327c..79dc155 100644
--- a/python-tomli-w.spec
+++ b/python-tomli-w.spec
@@ -1,6 +1,16 @@
+%bcond_with bootstrap
+
+%if %{with bootstrap}
+%bcond_with check
+%else
+%bcond_without check
+%endif
+
+%global modname tomli_w
+
 Name:           python-tomli-w
 Version:        0.4.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A Python library for writing TOML
 
 License:        MIT
@@ -28,7 +38,11 @@ Summary:        %{summary}
 
 
 %generate_buildrequires
+%if %{with check}
 %pyproject_buildrequires -t
+%else
+%pyproject_buildrequires
+%endif
 
 
 %build
@@ -37,11 +51,16 @@ Summary:        %{summary}
 
 %install
 %pyproject_install
-%pyproject_save_files tomli_w
+%pyproject_save_files %{modname}
 
 
 %check
+%if %{with check}
 %tox
+%else
+# no %%pyproject_check_import on EL9
+%py3_check_import %{modname}
+%endif
 
 
 %files -n python3-tomli-w -f %{pyproject_files}
@@ -51,5 +70,8 @@ Summary:        %{summary}
 
 
 %changelog
+* Thu Jan 20 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 0.4.0-2
+- Add boostrap and check toggles to ease bootstrapping new EPEL releases
+
 * Wed Oct 27 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 0.4.0-1
 - Initial package