1 |
# Created by pyp2rpm-1.0.1 |
2 |
%define pypi_name wheel |
3 |
%define with_python3 1 |
4 |
|
5 |
Name: python-%{pypi_name} |
6 |
Version: 0.22.0 |
7 |
Release: %mkrel 1 |
8 |
Summary: A built-package format for Python |
9 |
Group: Development/Python |
10 |
License: MIT |
11 |
URL: http://bitbucket.org/dholth/wheel/ |
12 |
Source0: https://pypi.python.org/packages/source/w/%{pypi_name}/%{pypi_name}-%{version}.tar.gz |
13 |
# Some test files are not present in tarball, so we include them separately. |
14 |
# Upstream pull request to include the files in tarball: |
15 |
# https://bitbucket.org/dholth/wheel/pull-request/34 (Patch0 below) |
16 |
# (version 0.22 doesn't have a tag, so we're using commit hash to point to the |
17 |
# correct testing wheel) |
18 |
Source1: https://bitbucket.org/dholth/wheel/src/099352e/wheel/test/test-1.0-py2.py3-none-win32.whl |
19 |
Source2: https://bitbucket.org/dholth/wheel/raw/099352e/wheel/test/pydist-schema.json |
20 |
Patch0: wheel-0.22-add-test-files-to-manifest.path |
21 |
Patch1: wheel-0.22-legacy-keyring-compatibility.patch |
22 |
Patch2: wheel-0.22-fix-tests-broken-by-keyring-fix.patch |
23 |
BuildArch: noarch |
24 |
|
25 |
BuildRequires: python-devel |
26 |
BuildRequires: python-setuptools |
27 |
|
28 |
BuildRequires: python-pytest |
29 |
BuildRequires: python-jsonschema |
30 |
BuildRequires: python-keyring |
31 |
BuildRequires: python-py |
32 |
|
33 |
%if %{?with_python3} |
34 |
BuildRequires: python3-devel |
35 |
BuildRequires: python3-setuptools |
36 |
BuildRequires: python3-pytest |
37 |
BuildRequires: python3-jsonschema |
38 |
BuildRequires: python3-keyring |
39 |
BuildRequires: python3-py |
40 |
%endif # if with_python3 |
41 |
|
42 |
|
43 |
%description |
44 |
A built-package format for Python. |
45 |
|
46 |
A wheel is a ZIP-format archive with a specially formatted filename and the |
47 |
.whl extension. It is designed to contain all the files for a PEP 376 |
48 |
compatible install in a way that is very close to the on-disk format. |
49 |
|
50 |
%if 0%{?with_python3} |
51 |
%package -n python3-%{pypi_name} |
52 |
Summary: A built-package format for Python |
53 |
Group: Development/Python |
54 |
|
55 |
%description -n python3-%{pypi_name} |
56 |
A built-package format for Python. |
57 |
|
58 |
A wheel is a ZIP-format archive with a specially formatted filename and the |
59 |
.whl extension. It is designed to contain all the files for a PEP 376 |
60 |
compatible install in a way that is very close to the on-disk format. |
61 |
|
62 |
This is package contains Python 3 version of the package. |
63 |
%endif # with_python3 |
64 |
|
65 |
|
66 |
%prep |
67 |
%setup -q -n %{pypi_name}-%{version} |
68 |
|
69 |
%patch0 -p1 |
70 |
%patch1 -p1 |
71 |
%patch2 -p1 |
72 |
|
73 |
# copy test files in place |
74 |
cp %{SOURCE1} %{pypi_name}/test/ |
75 |
cp %{SOURCE2} %{pypi_name}/test/ |
76 |
# header files just has to be there, even empty |
77 |
touch %{pypi_name}/test/headers.dist/header.h |
78 |
|
79 |
# remove unneeded shebangs |
80 |
sed -ie '1d' %{pypi_name}/{egg2wheel,wininst2wheel}.py |
81 |
|
82 |
%if 0%{?with_python3} |
83 |
cp -a . %{py3dir} |
84 |
%endif # with_python3 |
85 |
|
86 |
|
87 |
%build |
88 |
%{__python} setup.py build |
89 |
|
90 |
%if 0%{?with_python3} |
91 |
pushd %{py3dir} |
92 |
%{__python3} setup.py build |
93 |
popd |
94 |
%endif # with_python3 |
95 |
|
96 |
|
97 |
%install |
98 |
# Must do the subpackages' install first because the scripts in /usr/bin are |
99 |
# overwritten with every setup.py install (and we want the python2 version |
100 |
# to be the default for now). |
101 |
%if 0%{?with_python3} |
102 |
pushd %{py3dir} |
103 |
%{__python3} setup.py install --skip-build --root %{buildroot} |
104 |
popd |
105 |
pushd %{buildroot}%{_bindir} |
106 |
for f in $(ls); do mv $f python3-$f; done |
107 |
popd |
108 |
%endif # with_python3 |
109 |
|
110 |
%{__python} setup.py install --skip-build --root %{buildroot} |
111 |
|
112 |
|
113 |
%check |
114 |
# remove setup.cfg that makes pytest require pytest-cov (unnecessary dep) |
115 |
rm setup.cfg |
116 |
py.test --ignore build |
117 |
|
118 |
%if 0%{?with_python3} |
119 |
pushd %{py3dir} |
120 |
rm setup.cfg |
121 |
py.test-%{python3_version} --ignore build |
122 |
popd |
123 |
%endif # with_python3 |
124 |
|
125 |
|
126 |
%files |
127 |
%doc LICENSE.txt CHANGES.txt README.txt |
128 |
%{_bindir}/egg2wheel |
129 |
%{_bindir}/wheel |
130 |
%{_bindir}/wininst2wheel |
131 |
%{python_sitelib}/%{pypi_name}* |
132 |
%exclude %{python_sitelib}/%{pypi_name}/test |
133 |
|
134 |
%if 0%{?with_python3} |
135 |
%files -n python3-%{pypi_name} |
136 |
%doc LICENSE.txt CHANGES.txt README.txt |
137 |
%{_bindir}/python3-egg2wheel |
138 |
%{_bindir}/python3-wheel |
139 |
%{_bindir}/python3-wininst2wheel |
140 |
%{python3_sitelib}/%{pypi_name}* |
141 |
%exclude %{python3_sitelib}/%{pypi_name}/test |
142 |
%endif # with_python3 |
143 |
|