From f968e0d8274b04526b281a8fd1c6f9aa443126fb Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: May 27 2019 13:37:15 +0000 Subject: add a condition for running tests Signed-off-by: Tomas Tomecek --- diff --git a/python-urwid.spec b/python-urwid.spec index 2134859..f244558 100644 --- a/python-urwid.spec +++ b/python-urwid.spec @@ -1,4 +1,8 @@ -Name: python-urwid +%bcond_without tests + +%global srcname urwid + +Name: python-%{srcname} Version: 2.0.1 Release: 6%{?dist} Summary: Console user interface library @@ -17,7 +21,7 @@ control. %description %_description -%package -n python3-urwid +%package -n python3-%{srcname} Summary: %summary %{?python_provide:%python_provide python3-urwid} BuildRequires: gcc @@ -26,10 +30,10 @@ BuildRequires: python3-setuptools # needed by selftest suite for test.support BuildRequires: python3-test -%description -n python3-urwid %_description +%description -n python3-%{srcname} %_description %prep -%setup -q -n urwid-%{version} +%setup -q -n %{srcname}-%{version} find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \; find urwid -type f -name "*.py" -exec chmod 644 {} \; @@ -39,12 +43,14 @@ find urwid -type f -name "*.py" -exec chmod 644 {} \; find examples -type f -exec chmod 0644 \{\} \; %check +%if %{with tests} PYTHON=%{__python3} %{__python3} setup.py test +%endif # tests %install %py3_install -%files -n python3-urwid +%files -n python3-%{srcname} %license COPYING %doc README.rst examples docs %{python3_sitearch}/urwid/