Blob Blame History Raw
%bcond_without tests

%global srcname urwid

Name:          python-%{srcname}
Version:       2.5.3
Release:       %autorelease
Summary:       Console user interface library

# examples/ is MIT
License:       LGPL-2.1-or-later AND MIT
Source0:       %{pypi_source urwid}

%global _description\
Urwid is a Python library for making text console applications.  It has\
many features including fluid interface resizing, support for UTF-8 and\
CJK encodings, standard and custom text layout modes, simple markup for\
setting text attributes, and a powerful, dynamic list box that handles a\
mix of widget types.  It is flexible, modular, and leaves the developer in\

%description %_description

%package -n python3-%{srcname}
Summary: %summary
%{?python_provide:%python_provide python3-urwid}
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
# needed by selftest suite for
BuildRequires: python3-test

%description -n python3-%{srcname} %_description

%autosetup -n %{srcname}-%{version}
find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \;
find urwid -type f -name "*.py" -exec chmod 644 {} \;


find examples -type f -exec chmod 0644 \{\} \;

%if %{with tests}
# tests are failing:
PYTHON=%{__python3} %{__python3} test || :


%files -n python3-%{srcname}
%license COPYING
%doc README.rst examples docs