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