]> git.pld-linux.org Git - packages/python-urwid.git/blob - python-urwid.spec
rebuild with tests and docs
[packages/python-urwid.git] / python-urwid.spec
1 #
2 # Conditional build:
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
7
8 %define         module  urwid
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}
13 Version:        2.1.2
14 Release:        6
15 License:        LGPL v2.1+
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
24 %if %{with python2}
25 BuildRequires:  python-devel >= 1:2.7
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-2to3 >= 1:3.5
29 BuildRequires:  python3-devel >= 1:3.5
30 BuildRequires:  python3-setuptools
31 %endif
32 %if %{with doc}
33 BuildRequires:  sphinx-pdg-3 >= 2.0.0
34 %endif
35 Requires:       python-modules >= 1:2.7
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
44 %description -l pl.UTF-8
45 Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona.
46
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
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
74 %prep
75 %setup -q -n %{module}-%{version}
76 %patch0 -p1
77
78 %build
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
89 sphinx-build-3 -b html . _html
90 %endif
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94
95 %if %{with python2}
96 %py_install
97
98 %py_postclean
99
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
109 %if %{with tests}
110 # unversioned copy installed if tests are run
111 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid.egg-info
112 %endif
113 %endif
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118 %if %{with python2}
119 %files
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
126 %endif
127
128 %if %{with python3}
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
137 %endif
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
This page took 0.055377 seconds and 3 git commands to generate.