]>
Commit | Line | Data |
---|---|---|
9739dc1f ER |
1 | # |
2 | # Conditional build: | |
1758bfc3 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
9739dc1f | 5 | %bcond_without python2 # CPython 2.x module |
2e60e376 | 6 | %bcond_without python3 # CPython 3.x module |
9739dc1f ER |
7 | |
8 | %define module wheel | |
9 | Summary: A built-package format for Python | |
2e60e376 | 10 | Summary(pl.UTF-8): Format zbudowanych pakietów dla Pythona |
9739dc1f | 11 | Name: python-%{module} |
1758bfc3 JB |
12 | Version: 0.37.1 |
13 | Release: 1 | |
9739dc1f ER |
14 | License: MIT |
15 | Group: Libraries/Python | |
2e60e376 JB |
16 | #Source0Download: https://pypi.python.org/simple/wheel/ |
17 | Source0: https://pypi.python.org/packages/source/w/wheel/%{module}-%{version}.tar.gz | |
1758bfc3 | 18 | # Source0-md5: f490f1399e5903706cb1d4fbed9ecb28 |
9739dc1f ER |
19 | URL: https://bitbucket.org/pypa/wheel |
20 | %if %{with python2} | |
1758bfc3 JB |
21 | BuildRequires: python-devel >= 1:2.7 |
22 | BuildRequires: python-setuptools >= 1:40.9.0 | |
2e60e376 | 23 | %if %{with tests} |
9739dc1f | 24 | BuildRequires: python-keyring |
1758bfc3 | 25 | BuildRequires: python-pytest >= 3.0.0 |
d1e48991 | 26 | BuildRequires: python-pytest-cov |
2e60e376 | 27 | %endif |
9739dc1f ER |
28 | %endif |
29 | %if %{with python3} | |
1758bfc3 JB |
30 | BuildRequires: python3-devel >= 1:3.5 |
31 | BuildRequires: python3-setuptools >= 1:40.9.0 | |
2e60e376 | 32 | %if %{with tests} |
9739dc1f | 33 | BuildRequires: python3-keyring |
1758bfc3 | 34 | BuildRequires: python3-pytest >= 3.0.0 |
d1e48991 | 35 | BuildRequires: python3-pytest-cov |
2e60e376 | 36 | %endif |
9739dc1f | 37 | %endif |
1758bfc3 JB |
38 | %if %{with doc} |
39 | BuildRequires: sphinx-pdg | |
40 | %endif | |
d1e48991 JB |
41 | BuildRequires: rpm-pythonprov |
42 | BuildRequires: rpmbuild(macros) >= 1.714 | |
9739dc1f ER |
43 | BuildArch: noarch |
44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
45 | ||
46 | %description | |
47 | A built-package format for Python. | |
48 | ||
49 | A wheel is a ZIP-format archive with a specially formatted filename | |
50 | and the .whl extension. It is designed to contain all the files for a | |
51 | PEP 376 compatible install in a way that is very close to the on-disk | |
52 | format. | |
53 | ||
2e60e376 JB |
54 | %description -l pl.UTF-8 |
55 | Format zbudowanych pakietów dla Pythona. | |
56 | ||
57 | "wheel" to archiwum w formacie ZIP ze specjalnie sformatowaną nazwą | |
58 | pliku oraz rozszerzeniem ".whl". Jest zaprojektowane, aby zawierało | |
59 | wszystkie pliki instalacji zgodnej z PEP 376 w sposób bardzo zbliżony | |
60 | do formatu na dysku. | |
61 | ||
9739dc1f ER |
62 | %package -n python3-%{module} |
63 | Summary: A built-package format for Python | |
2e60e376 | 64 | Summary(pl.UTF-8): Format zbudowanych pakietów dla Pythona |
9739dc1f | 65 | Group: Libraries/Python |
1758bfc3 JB |
66 | # /usr/bin/wheel migration |
67 | Conflicts: python-wheel < 0.37.1 | |
9739dc1f ER |
68 | |
69 | %description -n python3-%{module} | |
70 | A built-package format for Python. | |
71 | ||
72 | A wheel is a ZIP-format archive with a specially formatted filename | |
73 | and the .whl extension. It is designed to contain all the files for a | |
74 | PEP 376 compatible install in a way that is very close to the on-disk | |
75 | format. | |
76 | ||
2e60e376 JB |
77 | %description -n python3-%{module} -l pl.UTF-8 |
78 | Format zbudowanych pakietów dla Pythona. | |
79 | ||
80 | "wheel" to archiwum w formacie ZIP ze specjalnie sformatowaną nazwą | |
81 | pliku oraz rozszerzeniem ".whl". Jest zaprojektowane, aby zawierało | |
82 | wszystkie pliki instalacji zgodnej z PEP 376 w sposób bardzo zbliżony | |
83 | do formatu na dysku. | |
9739dc1f | 84 | |
1758bfc3 JB |
85 | %package apidocs |
86 | Summary: API documentation for Python wheel module | |
87 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona wheel | |
88 | Group: Documentation | |
89 | ||
90 | %description apidocs | |
91 | API documentation for Python wheel module. | |
92 | ||
93 | %description apidocs -l pl.UTF-8 | |
94 | Dokumentacja API modułu Pythona wheel. | |
95 | ||
9739dc1f ER |
96 | %prep |
97 | %setup -q -n %{module}-%{version} | |
98 | ||
9739dc1f ER |
99 | %build |
100 | %if %{with python2} | |
afce17e6 | 101 | %py_build |
2e60e376 JB |
102 | |
103 | %if %{with tests} | |
1758bfc3 JB |
104 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
105 | PYTEST_PLUGINS="pytest_cov.plugin" \ | |
106 | PYTHONPATH=$(pwd)/src \ | |
107 | %{__python} -m pytest tests -k 'not test_macosx_libfile' | |
2e60e376 | 108 | %endif |
9739dc1f ER |
109 | %endif |
110 | ||
111 | %if %{with python3} | |
afce17e6 | 112 | %py3_build |
9739dc1f | 113 | |
2e60e376 | 114 | %if %{with tests} |
1758bfc3 JB |
115 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
116 | PYTEST_PLUGINS="pytest_cov.plugin" \ | |
117 | PYTHONPATH=$(pwd)/src \ | |
118 | %{__python3} -m pytest tests -k 'not test_macosx_libfile' | |
9739dc1f | 119 | %endif |
9739dc1f ER |
120 | %endif |
121 | ||
1758bfc3 JB |
122 | %if %{with doc} |
123 | %{__make} -C docs html | |
124 | %endif | |
9739dc1f ER |
125 | |
126 | %install | |
127 | rm -rf $RPM_BUILD_ROOT | |
9739dc1f ER |
128 | |
129 | %if %{with python2} | |
afce17e6 | 130 | %py_install |
1758bfc3 | 131 | |
2e60e376 | 132 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/wheel{,-2} |
9739dc1f | 133 | |
9739dc1f ER |
134 | %py_postclean |
135 | %endif | |
136 | ||
1758bfc3 JB |
137 | %if %{with python3} |
138 | %py3_install | |
139 | ||
140 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/wheel{,-3} | |
141 | ln -sf wheel-3 $RPM_BUILD_ROOT%{_bindir}/wheel | |
142 | %endif | |
143 | ||
144 | %clean | |
145 | rm -rf $RPM_BUILD_ROOT | |
146 | ||
9739dc1f ER |
147 | %if %{with python2} |
148 | %files | |
149 | %defattr(644,root,root,755) | |
9282f87c | 150 | %doc LICENSE.txt README.rst |
2e60e376 | 151 | %attr(755,root,root) %{_bindir}/wheel-2 |
9739dc1f ER |
152 | %{py_sitescriptdir}/wheel |
153 | %{py_sitescriptdir}/wheel-%{version}-py*.egg-info | |
154 | %endif | |
155 | ||
156 | %if %{with python3} | |
157 | %files -n python3-%{module} | |
158 | %defattr(644,root,root,755) | |
9282f87c | 159 | %doc LICENSE.txt README.rst |
1758bfc3 | 160 | %attr(755,root,root) %{_bindir}/wheel |
2e60e376 JB |
161 | %attr(755,root,root) %{_bindir}/wheel-3 |
162 | %{py3_sitescriptdir}/wheel | |
163 | %{py3_sitescriptdir}/wheel-%{version}-py*.egg-info | |
9739dc1f | 164 | %endif |
1758bfc3 JB |
165 | |
166 | %if %{with doc} | |
167 | %files apidocs | |
168 | %defattr(644,root,root,755) | |
169 | %doc docs/_build/html/{_static,reference,*.html,*.js} | |
170 | %endif |