]>
Commit | Line | Data |
---|---|---|
9f847f08 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # docs build | |
1d225bd0 | 4 | %bcond_with tests # test target (fails on builders due to lack of pts) |
9f847f08 JB |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
1026538b | 8 | %define module urwid |
9f847f08 JB |
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 | |
1026538b | 12 | Name: python-%{module} |
153a965c | 13 | Version: 2.1.2 |
6bec91b2 | 14 | Release: 5 |
9129945d | 15 | License: LGPL v2.1+ |
1026538b | 16 | Group: Development/Languages/Python |
9f847f08 JB |
17 | #Source0Download: http://urwid.org/ |
18 | Source0: https://pypi.python.org/packages/source/u/urwid/%{module}-%{version}.tar.gz | |
153a965c | 19 | # Source0-md5: f7f4e6bed9ba38965dbd619520f39287 |
972dabfd | 20 | Patch0: 0002-Use-non-deprecated-template.patch |
9f847f08 | 21 | URL: http://urwid.org/ |
1026538b | 22 | BuildRequires: rpm-pythonprov |
9129945d | 23 | BuildRequires: rpmbuild(macros) >= 1.714 |
9f847f08 | 24 | %if %{with python2} |
153a965c | 25 | BuildRequires: python-devel >= 1:2.7 |
9f847f08 JB |
26 | %endif |
27 | %if %{with python3} | |
153a965c JP |
28 | BuildRequires: python3-2to3 >= 1:3.5 |
29 | BuildRequires: python3-devel >= 1:3.5 | |
9f847f08 JB |
30 | BuildRequires: python3-setuptools |
31 | %endif | |
32 | %if %{with doc} | |
1723e898 | 33 | BuildRequires: sphinx-pdg-3 >= 2.0.0 |
9f847f08 | 34 | %endif |
153a965c | 35 | Requires: python-modules >= 1:2.7 |
1026538b ZU |
36 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
37 | ||
38 | %description | |
39 | Urwid is a console user interface library for Python. | |
40 | ||
41 | %description -l hu.UTF-8 | |
42 | Urwid egy konzolos felhasználói felület könyvtár Pythonhoz. | |
43 | ||
9129945d JB |
44 | %description -l pl.UTF-8 |
45 | Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona. | |
46 | ||
9f847f08 JB |
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 | |
153a965c | 52 | Requires: python3-modules >= 1:3.5 |
9f847f08 JB |
53 | |
54 | %description -n python3-%{module} | |
55 | Urwid is a console user interface library for Python. | |
56 | ||
57 | %description -n python3-%{module} -l hu.UTF-8 | |
58 | Urwid egy konzolos felhasználói felület könyvtár Pythonhoz. | |
59 | ||
60 | %description -n python3-%{module} -l pl.UTF-8 | |
61 | Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona. | |
62 | ||
63 | %package apidocs | |
64 | Summary: API documentation for urwid module | |
65 | Summary(pl.UTF-8): Dokumentacja API modułu urwid | |
66 | Group: Documentation | |
67 | ||
68 | %description apidocs | |
69 | API documentation for urwid module. | |
70 | ||
71 | %description apidocs -l pl.UTF-8 | |
72 | Dokumentacja API modułu urwid. | |
73 | ||
1026538b ZU |
74 | %prep |
75 | %setup -q -n %{module}-%{version} | |
972dabfd | 76 | %patch0 -p1 |
1026538b ZU |
77 | |
78 | %build | |
9f847f08 JB |
79 | %if %{with python2} |
80 | %py_build %{?with_tests:test} | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %py3_build %{?with_tests:test} | |
85 | %endif | |
86 | ||
87 | %if %{with doc} | |
88 | cd docs | |
1723e898 | 89 | sphinx-build-3 -b html . _html |
9f847f08 | 90 | %endif |
1026538b ZU |
91 | |
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
9f847f08 JB |
94 | |
95 | %if %{with python2} | |
ba5115d6 | 96 | %py_install |
1026538b | 97 | |
1026538b ZU |
98 | %py_postclean |
99 | ||
9f847f08 JB |
100 | # tests |
101 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/urwid/tests | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %py3_install | |
106 | ||
107 | # tests | |
108 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid/tests | |
1d225bd0 JB |
109 | %if %{with tests} |
110 | # unversioned copy installed if tests are run | |
9f847f08 JB |
111 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid.egg-info |
112 | %endif | |
1d225bd0 | 113 | %endif |
9f847f08 | 114 | |
1026538b ZU |
115 | %clean |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
df43a33b | 118 | %if %{with python2} |
1026538b ZU |
119 | %files |
120 | %defattr(644,root,root,755) | |
9f847f08 | 121 | %doc README.rst docs/changelog.rst |
9129945d JB |
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 | |
df43a33b | 126 | %endif |
9f847f08 | 127 | |
df43a33b | 128 | %if %{with python3} |
9f847f08 JB |
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 | |
df43a33b | 137 | %endif |
9f847f08 JB |
138 | |
139 | %if %{with doc} | |
140 | %files apidocs | |
141 | %defattr(644,root,root,755) | |
142 | %doc docs/_html/{_images,_static,examples,manual,reference,tutorial,*.html,*.js} | |
143 | %endif |