5 # This controls whether setuptools is build as a wheel or not,
6 # simplifying Python 3.4 bootstraping process
13 # define some macros for RHEL 6
14 %global __python2 %__python
15 %global python2_sitelib %python_sitelib
19 %global with_python3 1
21 %global srcname setuptools
23 %global python2_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
24 %global python2_record %{python2_sitelib}/%{srcname}-%{version}.dist-info/RECORD
26 %global python3_wheelname %python2_wheelname
27 %global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD
31 Name: python-setuptools
33 Release: 3%{?dist}~mos1
34 Summary: Easily build and distribute Python packages
36 Group: Applications/System
37 License: Python or ZPLv2.0
38 URL: https://pypi.python.org/pypi/%{srcname}
39 Source0: %{srcname}-%{version}.tar.gz
44 BuildRequires: python2-devel
46 BuildRequires: python-pip
47 BuildRequires: python-wheel
50 BuildRequires: pytest python-mock
54 BuildRequires: python3-devel
56 BuildRequires: python3-pytest
57 BuildRequires: python3-mock
60 BuildRequires: python3-pip
61 BuildRequires: python3-wheel
65 # We're now back to setuptools as the package.
66 # Keep the python-distribute name active for a few releases. Eventually we'll
67 # want to get rid of the Provides and just keep the Obsoletes
68 Provides: python-distribute = %{version}-%{release}
69 Obsoletes: python-distribute < 0.6.36-2
72 Setuptools is a collection of enhancements to the Python distutils that allow
73 you to more easily build and distribute Python packages, especially ones that
74 have dependencies on other packages.
76 This package also contains the runtime components of setuptools, necessary to
77 execute the software that requires pkg_resources.py.
80 %package -n python3-setuptools
81 Summary: Easily build and distribute Python 3 packages
82 Group: Applications/System
84 # Note: Do not need to Require python3-backports-ssl_match_hostname because it
85 # has been present since python3-3.2. We do not ship python3-3.0 or
86 # python3-3.1 anywhere
88 %description -n python3-setuptools
89 Setuptools is a collection of enhancements to the Python 3 distutils that allow
90 you to more easily build and distribute Python 3 packages, especially ones that
91 have dependencies on other packages.
93 This package also contains the runtime components of setuptools, necessary to
94 execute the software that requires pkg_resources.py.
99 %setup -q -n %{srcname}-%{version}
101 # We can't remove .egg-info (but it doesn't matter, since it'll be rebuilt):
102 # The problem is that to properly execute setuptools' setup.py,
103 # it is needed for setuptools to be loaded as a Distribution
104 # (with egg-info or .dist-info dir), it's not sufficient
105 # to just have them on PYTHONPATH
106 # Running "setup.py install" without having setuptools installed
107 # as a distribution gives warnings such as
108 # ... distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
109 # and doesn't create "easy_install" and .egg-info directory
110 # Note: this is only a problem if bootstrapping wheel or building on RHEL,
111 # otherwise setuptools are installed as dependency into buildroot
113 # Remove bundled exes
114 rm -f setuptools/*.exe
115 # These tests require internet connection
116 rm setuptools/tests/test_integration.py
118 %if 0%{?with_python3}
121 %endif # with_python3
125 %{__python} setup.py bdist_wheel
127 %{__python} setup.py build
130 %if 0%{?with_python3}
133 %{__python3} setup.py bdist_wheel
135 %{__python3} setup.py build
138 %endif # with_python3
141 # Must do the python3 install first because the scripts in /usr/bin are
142 # overwritten with every setup.py install (and we want the python2 version
143 # to be the default for now).
144 %if 0%{?with_python3}
147 pip3 install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
149 # TODO: we have to remove this by hand now, but it'd be nice if we wouldn't have to
150 # (pip install wheel doesn't overwrite)
151 rm %{buildroot}%{_bindir}/easy_install
153 sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
155 %{__python3} setup.py install --skip-build --root %{buildroot}
158 rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
160 sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
163 install -p -m 0644 %{SOURCE1} %{SOURCE2} %{py3dir}
164 find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
165 chmod +x %{buildroot}%{python3_sitelib}/setuptools/command/easy_install.py
167 %endif # with_python3
170 pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
172 %{__python2} setup.py install --skip-build --root %{buildroot}
175 rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests
177 sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record}
180 install -p -m 0644 %{SOURCE1} %{SOURCE2} .
181 find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f
182 chmod +x %{buildroot}%{python2_sitelib}/setuptools/command/easy_install.py
186 LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test
188 %if 0%{?with_python3}
190 LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test-%{python3_version}
192 %endif # with_python3
198 %{_bindir}/easy_install
199 %{_bindir}/easy_install-2.*
201 %if 0%{?with_python3}
202 %files -n python3-setuptools
203 %doc psfl.txt zpl.txt docs
205 %{_bindir}/easy_install-3.*
206 %endif # with_python3
209 * Mon Sep 14 2015 Mikhail Ivanov <mivanov@mirantis.com> - 17.1.1-3~mos8.0.1
211 - Based on source and .spec from
212 https://kojipkgs.fedoraproject.org//packages/python-setuptools/17.1.1/3.fc22/src/python-setuptools-17.1.1-3.fc22.src.rpm
215 * Sat Jun 20 2015 Kevin Fenzi <kevin@scrye.com> 17.1.1-3
216 - Drop no longer needed Requires/BuildRequires on python-backports-ssl_match_hostname
219 * Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 17.1.1-2
220 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
222 * Wed Jun 10 2015 Kevin Fenzi <kevin@scrye.com> 17.1.1-1
223 - Update to 17.1.1. Fixes bug 1229507
225 * Sun Jun 07 2015 Kevin Fenzi <kevin@scrye.com> 17.1-1
226 - Update to 17.1. Fixes bug 1229066
228 * Sat May 30 2015 Kevin Fenzi <kevin@scrye.com> 17.0-1
231 * Mon May 18 2015 Kevin Fenzi <kevin@scrye.com> 16.0-1
234 * Mon Apr 27 2015 Ralph Bean <rbean@redhat.com> - 15.2-1
237 * Sat Apr 04 2015 Ralph Bean <rbean@redhat.com> - 15.0-1
240 * Sun Mar 22 2015 Ralph Bean <rbean@redhat.com> - 14.3.1-1
243 * Sat Mar 21 2015 Ralph Bean <rbean@redhat.com> - 14.3.1-1
246 * Mon Mar 16 2015 Ralph Bean <rbean@redhat.com> - 14.3-1
249 * Sun Mar 15 2015 Ralph Bean <rbean@redhat.com> - 14.2-1
252 * Sun Mar 15 2015 Ralph Bean <rbean@redhat.com> - 14.1.1-1
255 * Fri Mar 06 2015 Ralph Bean <rbean@redhat.com> - 13.0.2-1
258 * Thu Mar 05 2015 Ralph Bean <rbean@redhat.com> - 12.4-1
261 * Fri Feb 27 2015 Ralph Bean <rbean@redhat.com> - 12.3-1
264 * Tue Jan 20 2015 Kevin Fenzi <kevin@scrye.com> 12.0.3-1
267 * Fri Jan 09 2015 Slavek Kabrda <bkabrda@redhat.com> - 11.3.1-2
269 - Make spec buildable on all Fedoras and RHEL 6 and 7
270 - Make tests actually run
272 * Wed Jan 07 2015 Kevin Fenzi <kevin@scrye.com> 11.3.1-1
273 - Update to 11.3.1. Fixes bugs: #1179393 and #1178817
275 * Sun Jan 04 2015 Kevin Fenzi <kevin@scrye.com> 11.0-1
276 - Update to 11.0. Fixes bug #1178421
278 * Fri Dec 26 2014 Kevin Fenzi <kevin@scrye.com> 8.2.1-1
279 - Update to 8.2.1. Fixes bug #1175229
281 * Thu Oct 23 2014 Ralph Bean <rbean@redhat.com> - 7.0-1
282 - Latest upstream. Fixes bug #1154590.
284 * Mon Oct 13 2014 Ralph Bean <rbean@redhat.com> - 6.1-1
285 - Latest upstream. Fixes bug #1152130.
287 * Sat Oct 11 2014 Ralph Bean <rbean@redhat.com> - 6.0.2-2
288 - Modernized python2 macros.
289 - Inlined locale environment variables in the %%check section.
290 - Remove bundled egg-info and .exes.
292 * Fri Oct 03 2014 Kevin Fenzi <kevin@scrye.com> 6.0.2-1
295 * Sat Sep 27 2014 Kevin Fenzi <kevin@scrye.com> 6.0.1-1
296 - Update to 6.0.1. Fixes bug #1044444
298 * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-8
299 - Remove the python-setuptools-devel Virtual Provides as per this Fedora 21
300 Change: http://fedoraproject.org/wiki/Changes/Remove_Python-setuptools-devel
302 * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-7
303 - And another bug in sdist
305 * Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-6
306 - Fix a bug in the sdist command
308 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-5
309 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
311 * Fri Apr 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.0-4
312 - Rebuild as wheel for Python 3.4
314 * Thu Apr 24 2014 Tomas Radej <tradej@redhat.com> - 2.0-3
315 - Rebuilt for tag f21-python
317 * Wed Apr 23 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.0-2
318 - Add a switch to build setuptools as wheel
320 * Mon Dec 9 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-1
321 - Update to new upstream release with a few things removed from the API:
322 Changelog: https://pypi.python.org/pypi/setuptools#id139
324 * Mon Nov 18 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.4-1
325 - Update to 1.4 that gives easy_install pypi credential handling
327 * Thu Nov 7 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3.1-1
328 - Minor upstream update to reign in overzealous warnings
330 * Mon Nov 4 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.3-1
331 - Upstream update that pulls in our security patches
333 * Mon Oct 28 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.7-1
334 - Update to newer upstream release that has our patch to the unittests
335 - Fix for http://bugs.python.org/issue17997#msg194950 which affects us since
336 setuptools copies that code. Changed to use
337 python-backports-ssl_match_hostname so that future issues can be fixed in
340 * Sat Oct 26 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 1.1.6-1
341 - Update to newer upstream release. Some minor incompatibilities listed but
342 they should affect few, if any consumers.
344 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-2
345 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
347 * Tue Jul 23 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.9.6-1
348 - Upstream update -- just fixes python-2.4 compat
350 * Tue Jul 16 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.9.5-1
352 - package_index can handle hashes other than md5
353 - Fix security vulnerability in SSL certificate validation
354 - https://bugzilla.redhat.com/show_bug.cgi?id=963260
356 * Fri Jul 5 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.8-1
357 - Update to upstream 0.8 release. Codebase now runs on anything from
358 python-2.4 to python-3.3 without having to be translated by 2to3.
360 * Wed Jul 3 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7.7-1
361 - Update to 0.7.7 upstream release
363 * Mon Jun 10 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.7.2-2
364 - Update to the setuptools-0.7 branch that merges distribute and setuptools
366 * Thu Apr 11 2013 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.36-1
367 - Update to upstream 0.6.36. Many bugfixes
369 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.28-4
370 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
372 * Fri Aug 03 2012 David Malcolm <dmalcolm@redhat.com> - 0.6.28-3
373 - rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
375 * Fri Aug 3 2012 David Malcolm <dmalcolm@redhat.com> - 0.6.28-2
376 - remove rhel logic from with_python3 conditional
378 * Mon Jul 23 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.28-1
379 - New upstream release:
381 - honor umask when setuptools is used to install other modules
383 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.27-3
384 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
386 * Mon Jun 11 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.27-2
387 - Fix easy_install.py having a python3 shebang in the python2 package
389 * Thu Jun 7 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.27-1
392 * Tue May 15 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.24-2
395 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.24-2
396 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
398 * Mon Oct 17 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.24-1
400 - Compile the win32 launcher binary using mingw
402 * Sun Aug 21 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.21-1
403 - Upstream bugfix release
405 * Thu Jul 14 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.19-1
406 - Upstream bugfix release
408 * Tue Feb 22 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.14-7
409 - Switch to patch that I got in to upstream
411 * Tue Feb 22 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.14-6
412 - Fix build on python-3.2
414 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-5
415 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
417 * Sun Aug 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6.14-4
418 - rebuild with python3.2
419 http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
421 * Tue Aug 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.14-3
422 - Update description to mention this is distribute
424 * Thu Jul 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6.14-2
425 - bump for building against python 2.7
427 * Thu Jul 22 2010 Thomas Spura <tomspur@fedoraproject.org> - 0.6.14-1
428 - update to new version
429 - all patches are upsteam
431 * Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.13-7
432 - generalize path of easy_install-2.6 and -3.1 to -2.* and -3.*
434 * Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.13-6
435 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
437 * Sat Jul 3 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-5
438 - Upstream patch for compatibility problem with setuptools
439 - Minor spec cleanups
440 - Provide python-distribute for those who see an import distribute and need
441 to get the proper package.
443 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-4
444 - Fix race condition in unittests under the python-2.6.x on F-14.
446 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-3
447 - Fix few more buildroot macros
449 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-2
450 - Include data that's needed for running tests
452 * Thu Jun 10 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.13-1
453 - Update to upstream 0.6.13
454 - Minor specfile formatting fixes
456 * Thu Feb 04 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-3
457 - First build with python3 support enabled.
459 * Fri Jan 29 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-2
460 - Really disable the python3 portion
462 * Fri Jan 29 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-1
463 - Update the python3 portions but disable for now.
465 - Remove %%pre scriptlet as the file has a different name than the old
468 * Tue Jan 26 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.9-4
469 - Fix install to make /usr/bin/easy_install the py2 version
470 - Don't need python3-tools since the library is now in the python3 package
471 - Few other changes to cleanup style
473 * Fri Jan 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.9-2
474 - add python3 subpackage
476 * Mon Dec 14 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.9-1
477 - New upstream bugfix release.
479 * Sun Dec 13 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.8-2
482 * Mon Nov 16 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.8-1
484 - Fix directory => file transition when updating from setuptools-0.6c9.
486 * Tue Nov 3 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.7-2
487 - Fix duplicate inclusion of files.
488 - Only Obsolete old versions of python-setuptools-devel
490 * Tue Nov 3 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.7-1
491 - Move easy_install back into the main package as the needed files have been
492 moved from python-devel to the main python package.
493 - Update to 0.6.7 bugfix.
495 * Fri Oct 16 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.6-1
496 - Upstream bugfix release.
498 * Mon Oct 12 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.4-1
499 - First build from the distribute codebase -- distribute-0.6.4.
500 - Remove svn patch as upstream has chosen to go with an easier change for now.
502 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6c9-5
503 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
505 * Tue Jul 14 2009 Konstantin Ryabitsev <icon@fedoraproject.org> - 0.6c9-4
506 - Apply SVN-1.6 versioning patch (rhbz #511021)
508 * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6c9-3
509 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild