source: spec/trunk/SPECS/python-setuptools.spec

Last change on this file was 1564, checked in by Silvan Scherrer, 7 years ago

spec: python-setuptools: Release version 34.4.1-2.

File size: 6.8 KB
Line 
1
2%global with_check 0
3%global build_wheel 0
4
5%global with_python3 0
6
7%global main_name setuptools
8%if 0%{?build_wheel}
9%global python2_wheelname %{main_name}-%{version}-py2.py3-none-any.whl
10%global python2_record %{python2_sitelib}/%{main_name}-%{version}.dist-info/RECORD
11%if 0%{?with_python3}
12%global python3_wheelname %python2_wheelname
13%global python3_record %{python3_sitelib}/%{main_name}-%{version}.dist-info/RECORD
14%endif
15%endif
16
17Name: python-setuptools
18Version: 34.4.1
19Release: 2%{?dist}
20Summary: Easily build and distribute Python packages
21
22Group: Applications/System
23License: MIT
24URL: https://pypi.python.org/pypi/%{main_name}
25Vendor: bww bitwise works GmbH
26%scm_source github https://github.com/bitwiseworks/%{main_name}-os2 %{version}-os2
27
28
29BuildArch: noarch
30BuildRequires: python-rpm-macros >= 1-3
31BuildRequires: python2-devel
32BuildRequires: python2-packaging
33BuildRequires: python2-appdirs
34%if 0%{?build_wheel}
35BuildRequires: python-pip
36BuildRequires: python-wheel
37%endif
38%if 0%{?with_check}
39BuildRequires: python2-pytest
40BuildRequires: python2-mock
41BuildRequires: python2-backports-unittest_mock
42%endif # with_check
43
44%if 0%{?with_python3}
45BuildRequires: python3-devel
46BuildRequires: python3-packaging
47BuildRequires: python3-appdirs
48%if 0%{?with_check}
49BuildRequires: python3-pytest
50BuildRequires: python3-mock
51%endif # with_check
52%if 0%{?build_wheel}
53BuildRequires: python3-pip
54BuildRequires: python3-wheel
55%endif # build_wheel
56%endif # with_python3
57
58# We're now back to setuptools as the package.
59# Keep the python-distribute name active for a few releases. Eventually we'll
60# want to get rid of the Provides and just keep the Obsoletes
61Provides: python-distribute = %{version}-%{release}
62Obsoletes: python-distribute < 0.6.36-2
63
64
65%description
66Setuptools is a collection of enhancements to the Python distutils that allow
67you to more easily build and distribute Python packages, especially ones that
68have dependencies on other packages.
69
70This package also contains the runtime components of setuptools, necessary to
71execute the software that requires pkg_resources.py.
72
73%package -n python2-setuptools
74Summary: Easily build and distribute Python packages
75%{?python_provide:%python_provide python2-setuptools}
76Requires: python2-packaging >= 16.8
77Requires: python2-six >= 1.6.0
78Requires: python2-appdirs >= 1.4.0
79%description -n python2-setuptools
80Setuptools is a collection of enhancements to the Python distutils that allow
81you to more easily build and distribute Python packages, especially ones that
82have dependencies on other packages.
83
84This package also contains the runtime components of setuptools, necessary to
85execute the software that requires pkg_resources.py.
86
87%if 0%{?with_python3}
88%package -n python3-setuptools
89Summary: Easily build and distribute Python 3 packages
90Requires: python3-packaging >= 16.8
91Requires: python3-six >= 1.6.0
92Requires: python3-appdirs >= 1.4.0
93Group: Applications/System
94%{?python_provide:%python_provide python3-setuptools}
95
96# Note: Do not need to Require python3-backports-ssl_match_hostname because it
97# has been present since python3-3.2. We do not ship python3-3.0 or
98# python3-3.1 anywhere
99
100%description -n python3-setuptools
101Setuptools is a collection of enhancements to the Python 3 distutils that allow
102you to more easily build and distribute Python 3 packages, especially ones that
103have dependencies on other packages.
104
105This package also contains the runtime components of setuptools, necessary to
106execute the software that requires pkg_resources.py.
107
108%endif # with_python3
109
110%prep
111%scm_setup
112python bootstrap.py
113
114# We can't remove .egg-info (but it doesn't matter, since it'll be rebuilt):
115# The problem is that to properly execute setuptools' setup.py,
116# it is needed for setuptools to be loaded as a Distribution
117# (with egg-info or .dist-info dir), it's not sufficient
118# to just have them on PYTHONPATH
119# Running "setup.py install" without having setuptools installed
120# as a distribution gives warnings such as
121# ... distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
122# and doesn't create "easy_install" and .egg-info directory
123# Note: this is only a problem if bootstrapping wheel or building on RHEL,
124# otherwise setuptools are installed as dependency into buildroot
125
126# Strip shbang
127find setuptools -name \*.py | xargs sed -i -e '1 {/^#!\//d}'
128# Remove bundled exes
129rm -f setuptools/*.exe
130# These tests require internet connection
131rm setuptools/tests/test_integration.py
132
133
134%build
135%if 0%{?build_wheel}
136%py2_build_wheel
137%else
138%py2_build
139%endif
140
141%if 0%{?with_python3}
142%if 0%{?build_wheel}
143%py3_build_wheel
144%else
145%py3_build
146%endif
147%endif # with_python3
148
149%install
150# Must do the python3 install first because the scripts in /usr/bin are
151# overwritten with every setup.py install (and we want the python2 version
152# to be the default for now).
153%if 0%{?with_python3}
154%if 0%{?build_wheel}
155%py3_install_wheel %{python3_wheelname}
156
157# TODO: we have to remove this by hand now, but it'd be nice if we wouldn't have to
158# (pip install wheel doesn't overwrite)
159rm %{buildroot}%{_bindir}/easy_install
160
161sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
162%else
163%py3_install
164%endif
165
166rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
167%if 0%{?build_wheel}
168sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
169%endif
170
171find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
172%endif # with_python3
173
174%if 0%{?build_wheel}
175%py2_install_wheel %{python2_wheelname}
176%else
177%py2_install
178%endif
179
180rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests
181%if 0%{?build_wheel}
182sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record}
183%endif
184
185find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f
186
187# Don't ship these
188rm -r docs/Makefile
189rm -r docs/conf.py
190rm -r docs/_*
191
192%if 0%{?with_check}
193%check
194#LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test
195
196%if 0%{?with_python3}
197LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test-%{python3_version}
198%endif # with_python3
199%endif # with_check
200
201%files -n python2-setuptools
202%license LICENSE
203%doc docs/* CHANGES.rst README.rst
204%{python2_sitelib}/*
205%{_bindir}/easy_install
206%{_bindir}/easy_install-2.*
207
208%if 0%{?with_python3}
209%files -n python3-setuptools
210%license LICENSE CHANGES.rst README.rst
211%doc docs/*
212%{python3_sitelib}/easy_install.py
213%{python3_sitelib}/pkg_resources/
214%{python3_sitelib}/setuptools*/
215%{python3_sitelib}/__pycache__/*
216%{_bindir}/easy_install-3.*
217%endif # with_python3
218
219%changelog
220* Mon Jan 21 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 34.4.1-2
221- rebuilt with latest python macros
222
223* Mon May 08 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 34.4.1-1
224- moved source to github
225- rebuilt with latest python macros
226
227* Mon Feb 27 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 34.2-0
228- first rpm version (internal version only)
Note: See TracBrowser for help on using the repository browser.