3 %bcond_without doc # docs build
4 %bcond_with tests # test target (fails on builders due to lack of pts)
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
9 Summary: Urwid - a console user interface library for Python 2
10 Summary(hu.UTF-8): Urwid egy konzolos felhasználói felület könyvtár Pythonhoz 2
11 Summary(pl.UTF-8): Urwid - biblioteka konsolowego interfejsu użytkownika dla Pythona 2
12 Name: python-%{module}
16 Group: Development/Languages/Python
17 #Source0Download: http://urwid.org/
18 Source0: https://pypi.python.org/packages/source/u/urwid/%{module}-%{version}.tar.gz
19 # Source0-md5: f7f4e6bed9ba38965dbd619520f39287
20 Patch0: 0002-Use-non-deprecated-template.patch
21 URL: http://urwid.org/
22 BuildRequires: rpm-pythonprov
23 BuildRequires: rpmbuild(macros) >= 1.714
25 BuildRequires: python-devel >= 1:2.7
28 BuildRequires: python3-2to3 >= 1:3.5
29 BuildRequires: python3-devel >= 1:3.5
30 BuildRequires: python3-setuptools
33 BuildRequires: sphinx-pdg-3 >= 2.0.0
35 Requires: python-modules >= 1:2.7
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Urwid is a console user interface library for Python.
41 %description -l hu.UTF-8
42 Urwid egy konzolos felhasználói felület könyvtár Pythonhoz.
44 %description -l pl.UTF-8
45 Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona.
47 %package -n python3-%{module}
48 Summary: Urwid - a console user interface library for Python 3
49 Summary(hu.UTF-8): Urwid egy konzolos felhasználói felület könyvtár Pythonhoz 3
50 Summary(pl.UTF-8): Urwid - biblioteka konsolowego interfejsu użytkownika dla Pythona 3
51 Group: Development/Languages/Python
52 Requires: python3-modules >= 1:3.5
54 %description -n python3-%{module}
55 Urwid is a console user interface library for Python.
57 %description -n python3-%{module} -l hu.UTF-8
58 Urwid egy konzolos felhasználói felület könyvtár Pythonhoz.
60 %description -n python3-%{module} -l pl.UTF-8
61 Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona.
64 Summary: API documentation for urwid module
65 Summary(pl.UTF-8): Dokumentacja API modułu urwid
69 API documentation for urwid module.
71 %description apidocs -l pl.UTF-8
72 Dokumentacja API modułu urwid.
75 %setup -q -n %{module}-%{version}
80 %py_build %{?with_tests:test}
84 %py3_build %{?with_tests:test}
89 sphinx-build-3 -b html . _html
93 rm -rf $RPM_BUILD_ROOT
101 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/urwid/tests
108 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid/tests
110 # unversioned copy installed if tests are run
111 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid.egg-info
116 rm -rf $RPM_BUILD_ROOT
120 %defattr(644,root,root,755)
121 %doc README.rst docs/changelog.rst
122 %dir %{py_sitedir}/urwid
123 %attr(755,root,root) %{py_sitedir}/urwid/str_util.so
124 %{py_sitedir}/urwid/*.py[co]
125 %{py_sitedir}/urwid-%{version}-py*.egg-info
129 %files -n python3-%{module}
130 %defattr(644,root,root,755)
131 %doc README.rst docs/changelog.rst
132 %dir %{py3_sitedir}/urwid
133 %attr(755,root,root) %{py3_sitedir}/urwid/str_util.cpython-*.so
134 %{py3_sitedir}/urwid/*.py
135 %{py3_sitedir}/urwid/__pycache__
136 %{py3_sitedir}/urwid-%{version}-py*.egg-info
141 %defattr(644,root,root,755)
142 %doc docs/_html/{_images,_static,examples,manual,reference,tutorial,*.html,*.js}