]>
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 JP |
13 | Version: 2.1.2 |
14 | Release: 1 | |
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 |
9f847f08 | 20 | URL: http://urwid.org/ |
1026538b | 21 | BuildRequires: rpm-pythonprov |
9129945d | 22 | BuildRequires: rpmbuild(macros) >= 1.714 |
9f847f08 | 23 | %if %{with python2} |
153a965c | 24 | BuildRequires: python-devel >= 1:2.7 |
9f847f08 JB |
25 | %endif |
26 | %if %{with python3} | |
153a965c JP |
27 | BuildRequires: python3-2to3 >= 1:3.5 |
28 | BuildRequires: python3-devel >= 1:3.5 | |
9f847f08 JB |
29 | BuildRequires: python3-setuptools |
30 | %endif | |
31 | %if %{with doc} | |
1723e898 | 32 | BuildRequires: sphinx-pdg-3 >= 2.0.0 |
9f847f08 | 33 | %endif |
153a965c | 34 | Requires: python-modules >= 1:2.7 |
1026538b ZU |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
36 | ||
37 | %description | |
38 | Urwid is a console user interface library for Python. | |
39 | ||
40 | %description -l hu.UTF-8 | |
41 | Urwid egy konzolos felhasználói felület könyvtár Pythonhoz. | |
42 | ||
9129945d JB |
43 | %description -l pl.UTF-8 |
44 | Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona. | |
45 | ||
9f847f08 JB |
46 | %package -n python3-%{module} |
47 | Summary: Urwid - a console user interface library for Python 3 | |
48 | Summary(hu.UTF-8): Urwid egy konzolos felhasználói felület könyvtár Pythonhoz 3 | |
49 | Summary(pl.UTF-8): Urwid - biblioteka konsolowego interfejsu użytkownika dla Pythona 3 | |
50 | Group: Development/Languages/Python | |
153a965c | 51 | Requires: python3-modules >= 1:3.5 |
9f847f08 JB |
52 | |
53 | %description -n python3-%{module} | |
54 | Urwid is a console user interface library for Python. | |
55 | ||
56 | %description -n python3-%{module} -l hu.UTF-8 | |
57 | Urwid egy konzolos felhasználói felület könyvtár Pythonhoz. | |
58 | ||
59 | %description -n python3-%{module} -l pl.UTF-8 | |
60 | Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona. | |
61 | ||
62 | %package apidocs | |
63 | Summary: API documentation for urwid module | |
64 | Summary(pl.UTF-8): Dokumentacja API modułu urwid | |
65 | Group: Documentation | |
66 | ||
67 | %description apidocs | |
68 | API documentation for urwid module. | |
69 | ||
70 | %description apidocs -l pl.UTF-8 | |
71 | Dokumentacja API modułu urwid. | |
72 | ||
1026538b ZU |
73 | %prep |
74 | %setup -q -n %{module}-%{version} | |
75 | ||
76 | %build | |
9f847f08 JB |
77 | %if %{with python2} |
78 | %py_build %{?with_tests:test} | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %py3_build %{?with_tests:test} | |
83 | %endif | |
84 | ||
85 | %if %{with doc} | |
86 | cd docs | |
1723e898 | 87 | sphinx-build-3 -b html . _html |
9f847f08 | 88 | %endif |
1026538b ZU |
89 | |
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
9f847f08 JB |
92 | |
93 | %if %{with python2} | |
ba5115d6 | 94 | %py_install |
1026538b | 95 | |
1026538b ZU |
96 | %py_postclean |
97 | ||
9f847f08 JB |
98 | # tests |
99 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/urwid/tests | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %py3_install | |
104 | ||
105 | # tests | |
106 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid/tests | |
1d225bd0 JB |
107 | %if %{with tests} |
108 | # unversioned copy installed if tests are run | |
9f847f08 JB |
109 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid.egg-info |
110 | %endif | |
1d225bd0 | 111 | %endif |
9f847f08 | 112 | |
1026538b ZU |
113 | %clean |
114 | rm -rf $RPM_BUILD_ROOT | |
115 | ||
116 | %files | |
117 | %defattr(644,root,root,755) | |
9f847f08 | 118 | %doc README.rst docs/changelog.rst |
9129945d JB |
119 | %dir %{py_sitedir}/urwid |
120 | %attr(755,root,root) %{py_sitedir}/urwid/str_util.so | |
121 | %{py_sitedir}/urwid/*.py[co] | |
122 | %{py_sitedir}/urwid-%{version}-py*.egg-info | |
9f847f08 JB |
123 | |
124 | %files -n python3-%{module} | |
125 | %defattr(644,root,root,755) | |
126 | %doc README.rst docs/changelog.rst | |
127 | %dir %{py3_sitedir}/urwid | |
128 | %attr(755,root,root) %{py3_sitedir}/urwid/str_util.cpython-*.so | |
129 | %{py3_sitedir}/urwid/*.py | |
130 | %{py3_sitedir}/urwid/__pycache__ | |
131 | %{py3_sitedir}/urwid-%{version}-py*.egg-info | |
132 | ||
133 | %if %{with doc} | |
134 | %files apidocs | |
135 | %defattr(644,root,root,755) | |
136 | %doc docs/_html/{_images,_static,examples,manual,reference,tutorial,*.html,*.js} | |
137 | %endif |