]>
Commit | Line | Data |
---|---|---|
9739dc1f ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_with python3 # CPython 3.x module | |
6 | ||
7 | %define module wheel | |
8 | Summary: A built-package format for Python | |
9 | Name: python-%{module} | |
10 | Version: 0.24.0 | |
11 | Release: 0.1 | |
12 | License: MIT | |
13 | Group: Libraries/Python | |
14 | Source0: https://pypi.python.org/packages/source/w/%{module}/%{module}-%{version}.tar.gz | |
15 | # Source0-md5: 3b0d66f0d127ea8befaa5d11453107fd | |
16 | URL: https://bitbucket.org/pypa/wheel | |
2814391e | 17 | BuildRequires: rpmbuild(macros) >= 1.710 |
9739dc1f ER |
18 | %if %{with python2} |
19 | BuildRequires: python-argparse | |
20 | BuildRequires: python-devel | |
21 | BuildRequires: python-jsonschema | |
22 | BuildRequires: python-keyring | |
23 | BuildRequires: python-pytest | |
24 | BuildRequires: python-setuptools | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel | |
28 | BuildRequires: python3-jsonschema | |
29 | BuildRequires: python3-keyring | |
30 | BuildRequires: python3-pytest | |
31 | BuildRequires: python3-setuptools | |
32 | %endif | |
33 | Requires: python-argparse | |
34 | BuildArch: noarch | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | A built-package format for Python. | |
39 | ||
40 | A wheel is a ZIP-format archive with a specially formatted filename | |
41 | and the .whl extension. It is designed to contain all the files for a | |
42 | PEP 376 compatible install in a way that is very close to the on-disk | |
43 | format. | |
44 | ||
45 | %package -n python3-%{module} | |
46 | Summary: A built-package format for Python | |
47 | Group: Libraries/Python | |
48 | ||
49 | %description -n python3-%{module} | |
50 | A built-package format for Python. | |
51 | ||
52 | A wheel is a ZIP-format archive with a specially formatted filename | |
53 | and the .whl extension. It is designed to contain all the files for a | |
54 | PEP 376 compatible install in a way that is very close to the on-disk | |
55 | format. | |
56 | ||
57 | This is package contains Python 3 version of the package. | |
58 | ||
59 | %prep | |
60 | %setup -q -n %{module}-%{version} | |
61 | ||
62 | # remove unneeded shebangs | |
63 | sed -ie '1d' %{module}/{egg2wheel,wininst2wheel}.py | |
64 | ||
9739dc1f ER |
65 | %build |
66 | %if %{with python2} | |
afce17e6 | 67 | %py_build |
9739dc1f ER |
68 | %endif |
69 | ||
70 | %if %{with python3} | |
afce17e6 | 71 | %py3_build |
9739dc1f ER |
72 | %endif |
73 | ||
74 | %if %{with test} | |
75 | # remove setup.cfg that makes pytest require pytest-cov (unnecessary dep) | |
76 | rm setup.cfg | |
afce17e6 | 77 | PYTHONPATH=build-2/lib py.test --ignore build -k 'not test_keygen' |
9739dc1f ER |
78 | |
79 | # no test for Python 3, no python3-jsonschema yet | |
80 | %if %{with python3} && 0 | |
afce17e6 | 81 | PYTHONPATH=build-3/lib py.test-%{py3_ver} --ignore build |
9739dc1f ER |
82 | %endif |
83 | ||
84 | %endif | |
85 | ||
86 | %clean | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | %if %{with python3} | |
92 | cd py3 | |
afce17e6 | 93 | %py3_install |
9739dc1f ER |
94 | cd $RPM_BUILD_ROOT%{_bindir} |
95 | for f in $(ls); do mv $f python3-$f; done | |
96 | cd - | |
97 | ||
98 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/test | |
99 | %endif | |
100 | ||
101 | %if %{with python2} | |
afce17e6 | 102 | %py_install |
9739dc1f ER |
103 | |
104 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/test | |
105 | ||
106 | %py_postclean | |
107 | %endif | |
108 | ||
109 | %if %{with python2} | |
110 | %files | |
111 | %defattr(644,root,root,755) | |
112 | %doc LICENSE.txt CHANGES.txt README.txt | |
113 | %attr(755,root,root) %{_bindir}/wheel | |
114 | %{py_sitescriptdir}/wheel | |
115 | %{py_sitescriptdir}/wheel-%{version}-py*.egg-info | |
116 | %endif | |
117 | ||
118 | %if %{with python3} | |
119 | %files -n python3-%{module} | |
120 | %defattr(644,root,root,755) | |
121 | %doc LICENSE.txt CHANGES.txt README.txt | |
122 | %attr(755,root,root) %{__python}3-wheel | |
123 | %{py3_sitescriptdir}/%{module}* | |
124 | %endif |