b6337b5
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
b6337b5
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
b6337b5
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
b6337b5
%endif
b6337b5
b6337b5
Name:          python-urwid
b6337b5
Version:       0.9.9.1
b6337b5
Release:       1%{?dist}
b6337b5
Summary:       Console user interface library
b6337b5
b6337b5
Group:         Development/Libraries
b6337b5
License:       LGPLv2+
b6337b5
URL:           http://excess.org/urwid/
b6337b5
Source0:       http://excess.org/urwid/urwid-%{version}.tar.gz
b6337b5
b6337b5
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
b6337b5
BuildRequires: python2-devel
b6337b5
BuildRequires: python-twisted-core
b6337b5
BuildRequires: pygobject2
b6337b5
b6337b5
%description
b6337b5
Urwid is a Python library for making text console applications.  It has many
b6337b5
features including fluid interface resizing, support for UTF-8 and CJK
b6337b5
encodings, standard and custom text layout modes, simple markup for setting
b6337b5
text attributes, and a powerful, dynamic list box that handles a mix of widget
b6337b5
types.  It is flexible, modular, and leaves the developer in control.
b6337b5
b6337b5
%prep
b6337b5
%setup -q -n urwid-%{version}
b6337b5
find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \;
b6337b5
find urwid -type f -name "*.py" -exec chmod 644 {} \;
b6337b5
b6337b5
%build
b6337b5
CFLAGS="%{optflags}" %{__python} setup.py build
b6337b5
b6337b5
%check
b6337b5
./test_urwid.py
b6337b5
b6337b5
%install
b6337b5
rm -rf %{buildroot}
b6337b5
%{__python} setup.py install --skip-build --no-compile --root %{buildroot}
b6337b5
rm -f tmpl_tutorial.html
b6337b5
mkdir examples
b6337b5
cp -p *.py examples/
b6337b5
rm -f examples/test_urwid.py examples/docgen_*.py
b6337b5
b6337b5
%clean
b6337b5
rm -rf %{buildroot}
b6337b5
b6337b5
%files
b6337b5
%defattr(-,root,root,-)
b6337b5
%doc CHANGELOG *.html examples
b6337b5
%{python_sitearch}/urwid
b6337b5
%{python_sitearch}/urwid-%{version}*.egg-info
b6337b5
b6337b5
%changelog
b6337b5
* Wed May 19 2010 David Cantrell <dcantrell@redhat.com> - 0.9.9.1-1
b6337b5
- Initial package