]> git.pld-linux.org Git - packages/python-urwid.git/blob - python-urwid.spec
362d0b6c51c59b1842de0f36524aaddb262236ad
[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:        1
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 URL:            http://urwid.org/
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python-devel >= 1:2.7
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-2to3 >= 1:3.5
28 BuildRequires:  python3-devel >= 1:3.5
29 BuildRequires:  python3-setuptools
30 %endif
31 %if %{with doc}
32 BuildRequires:  sphinx-pdg-2
33 %endif
34 Requires:       python-modules >= 1:2.7
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
43 %description -l pl.UTF-8
44 Urwid to biblioteka konsolowego interfejsu użytkownika dla Pythona.
45
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
51 Requires:       python3-modules >= 1:3.5
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
73 %prep
74 %setup -q -n %{module}-%{version}
75
76 %build
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
87 sphinx-build-2 -b html . _html
88 %endif
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92
93 %if %{with python2}
94 %py_install
95
96 %py_postclean
97
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
107 %if %{with tests}
108 # unversioned copy installed if tests are run
109 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/urwid.egg-info
110 %endif
111 %endif
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116 %files
117 %defattr(644,root,root,755)
118 %doc README.rst docs/changelog.rst
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
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
This page took 0.117199 seconds and 2 git commands to generate.