]>
Commit | Line | Data |
---|---|---|
8821ece5 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
d03e8fee JB |
5 | %bcond_without doc # API documentation |
6 | %bcond_without tests # unit tests | |
8821ece5 JP |
7 | |
8 | Summary: Clean single-source support for Python 3 and 2 | |
d03e8fee | 9 | Summary(pl.UTF-8): Czysta obsługa Pythona 3 i 2 w jednych źródłach |
8821ece5 | 10 | Name: python-future |
32cf6268 | 11 | Version: 0.18.2 |
0379646c | 12 | Release: 4 |
8821ece5 JP |
13 | License: MIT |
14 | Group: Libraries/Python | |
d03e8fee JB |
15 | #Source0Download: https://pypi.org/simple/future/ |
16 | Source0: https://files.pythonhosted.org/packages/source/f/future/future-%{version}.tar.gz | |
32cf6268 | 17 | # Source0-md5: e4579c836b9c025872efe230f6270349 |
8f33d0a9 | 18 | Patch0: %{name}-tests.patch |
8821ece5 JP |
19 | URL: https://python-future.org/ |
20 | %if %{with python2} | |
d03e8fee | 21 | BuildRequires: python-modules >= 1:2.6 |
8821ece5 | 22 | BuildRequires: python-setuptools |
d03e8fee JB |
23 | %if "%{py_ver}" < "2.7" |
24 | BuildRequires: python-argparse | |
25 | BuildRequires: python-importlib | |
26 | %if %{with tests} | |
32cf6268 | 27 | BuildRequires: python-2to3 |
d03e8fee JB |
28 | BuildRequires: python-unittest2 |
29 | %endif | |
30 | %endif | |
8821ece5 JP |
31 | %endif |
32 | %if %{with python3} | |
33 | BuildRequires: python3-modules >= 1:3.3 | |
34 | BuildRequires: python3-setuptools | |
35 | %endif | |
36 | BuildRequires: rpm-pythonprov | |
37 | BuildRequires: rpmbuild(macros) >= 1.714 | |
d03e8fee JB |
38 | %if %{with doc} |
39 | BuildRequires: python3-sphinx_bootstrap_theme | |
40 | BuildRequires: sphinx-pdg-3 | |
41 | %endif | |
42 | Requires: python-modules >= 1:2.6 | |
43 | %if "%{py_ver}" < "2.7" | |
44 | Requires: python-argparse | |
45 | Requires: python-importlib | |
46 | Requires: python-unittest2 | |
47 | %endif | |
8821ece5 JP |
48 | BuildArch: noarch |
49 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
50 | ||
51 | %description | |
52 | future is the missing compatibility layer between Python 2 and | |
53 | Python 3. It allows you to use a single, clean Python 3.x-compatible | |
54 | codebase to support both Python 2 and Python 3 with minimal overhead. | |
55 | ||
d03e8fee JB |
56 | %description -l pl.UTF-8 |
57 | future to brakująca warstwa zgodności między Pythonem 2 i 3. Pozwala | |
58 | na używanie pojedynczego kodu źródłowego w Pythonie 3.x do obsługi | |
59 | zarówno Pythona 2, jak i 3 z minimalnym narzutem. | |
60 | ||
8821ece5 JP |
61 | %package -n python3-future |
62 | Summary: Clean single-source support for Python 3 and 2 | |
d03e8fee | 63 | Summary(pl.UTF-8): Czysta obsługa Pythona 3 i 2 w jednych źródłach |
8821ece5 JP |
64 | Group: Libraries/Python |
65 | Requires: python3-modules >= 1:3.3 | |
66 | ||
67 | %description -n python3-future | |
68 | future is the missing compatibility layer between Python 2 and | |
69 | Python 3. It allows you to use a single, clean Python 3.x-compatible | |
70 | codebase to support both Python 2 and Python 3 with minimal overhead. | |
71 | ||
d03e8fee JB |
72 | %description -n python3-future -l pl.UTF-8 |
73 | future to brakująca warstwa zgodności między Pythonem 2 i 3. Pozwala | |
74 | na używanie pojedynczego kodu źródłowego w Pythonie 3.x do obsługi | |
75 | zarówno Pythona 2, jak i 3 z minimalnym narzutem. | |
76 | ||
77 | %package apidocs | |
78 | Summary: API documentation for Python future module | |
79 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona future | |
80 | Group: Documentation | |
81 | ||
82 | %description apidocs | |
83 | API documentation for Python future module. | |
84 | ||
85 | %description apidocs -l pl.UTF-8 | |
86 | Dokumentacja API modułu Pythona future. | |
87 | ||
8821ece5 JP |
88 | %prep |
89 | %setup -q -n future-%{version} | |
d03e8fee | 90 | %patch0 -p1 |
8821ece5 JP |
91 | |
92 | %build | |
93 | %if %{with python2} | |
94 | %py_build | |
d03e8fee JB |
95 | |
96 | %if %{with tests} | |
97 | PYTHONPATH=$(pwd)/build-2/lib \ | |
98 | %{__python} -m unittest discover -s tests | |
99 | %endif | |
8821ece5 JP |
100 | %endif |
101 | ||
102 | %if %{with python3} | |
103 | %py3_build | |
d03e8fee JB |
104 | |
105 | %if %{with tests} | |
5a09ca9d JB |
106 | # FIXME: fail with py3.9(?) as of future-0.18.2 |
107 | %{__rm} tests/test_future/test_standard_library.py \ | |
108 | tests/test_future/test_urllib_toplevel.py \ | |
109 | tests/test_past/test_translation.py | |
d03e8fee JB |
110 | |
111 | PYTHONPATH=$(pwd)/build-3/lib \ | |
112 | %{__python3} -m unittest discover -s tests | |
113 | %endif | |
114 | %endif | |
115 | ||
116 | %if %{with doc} | |
117 | PYTHONPATH=$(pwd)/build-3/lib \ | |
118 | %{__make} -C docs html \ | |
119 | SPHINXBUILD=sphinx-build-3 | |
8821ece5 JP |
120 | %endif |
121 | ||
122 | %install | |
123 | rm -rf $RPM_BUILD_ROOT | |
124 | ||
125 | %if %{with python2} | |
126 | %py_install | |
127 | ||
128 | %py_postclean | |
d03e8fee JB |
129 | |
130 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/futurize{,-2} | |
131 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pasteurize{,-2} | |
8821ece5 JP |
132 | %endif |
133 | ||
134 | %if %{with python3} | |
135 | %py3_install | |
d03e8fee JB |
136 | |
137 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/futurize{,-3} | |
138 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pasteurize{,-3} | |
139 | ||
140 | ln -sf futurize-3 $RPM_BUILD_ROOT%{_bindir}/futurize | |
141 | ln -sf pasteurize-3 $RPM_BUILD_ROOT%{_bindir}/pasteurize | |
8821ece5 JP |
142 | %endif |
143 | ||
144 | %clean | |
145 | rm -rf $RPM_BUILD_ROOT | |
146 | ||
147 | %if %{with python2} | |
148 | %files | |
149 | %defattr(644,root,root,755) | |
d03e8fee JB |
150 | %doc LICENSE.txt README.rst |
151 | %attr(755,root,root) %{_bindir}/futurize-2 | |
152 | %attr(755,root,root) %{_bindir}/pasteurize-2 | |
8821ece5 JP |
153 | %{py_sitescriptdir}/_dummy_thread |
154 | %{py_sitescriptdir}/_markupbase | |
155 | %{py_sitescriptdir}/_thread | |
156 | %{py_sitescriptdir}/builtins | |
157 | %{py_sitescriptdir}/copyreg | |
158 | %{py_sitescriptdir}/future | |
159 | %{py_sitescriptdir}/html | |
160 | %{py_sitescriptdir}/http | |
161 | %{py_sitescriptdir}/libfuturize | |
162 | %{py_sitescriptdir}/libpasteurize | |
163 | %{py_sitescriptdir}/past | |
164 | %{py_sitescriptdir}/queue | |
165 | %{py_sitescriptdir}/reprlib | |
166 | %{py_sitescriptdir}/socketserver | |
167 | %{py_sitescriptdir}/tkinter | |
168 | %{py_sitescriptdir}/winreg | |
169 | %{py_sitescriptdir}/xmlrpc | |
170 | %{py_sitescriptdir}/future-%{version}-py*.egg-info | |
171 | %endif | |
172 | ||
173 | %if %{with python3} | |
174 | %files -n python3-future | |
175 | %defattr(644,root,root,755) | |
d03e8fee JB |
176 | %doc LICENSE.txt README.rst |
177 | %attr(755,root,root) %{_bindir}/futurize | |
178 | %attr(755,root,root) %{_bindir}/futurize-3 | |
179 | %attr(755,root,root) %{_bindir}/pasteurize | |
180 | %attr(755,root,root) %{_bindir}/pasteurize-3 | |
8821ece5 JP |
181 | %{py3_sitescriptdir}/future |
182 | %{py3_sitescriptdir}/libfuturize | |
183 | %{py3_sitescriptdir}/libpasteurize | |
184 | %{py3_sitescriptdir}/past | |
185 | %{py3_sitescriptdir}/future-%{version}-py*.egg-info | |
186 | %endif | |
d03e8fee JB |
187 | |
188 | %if %{with doc} | |
189 | %files apidocs | |
190 | %defattr(644,root,root,755) | |
191 | %doc docs/build/html/{_modules,_static,*.html,*.js} | |
192 | %endif |