add a condition for running tests

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
This commit is contained in:
Tomas Tomecek 2019-05-27 15:35:58 +02:00
parent 066b437654
commit f968e0d827

View File

@ -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/