# Dependencies for check and wheel introduce circular dependencies # Set this to 0 after we've bootstrapped. %{!?_with_bootstrap: %global bootstrap 0} %if ! 0%{?bootstrap} %global with_check 1 %global build_wheel 1 %else %global with_check 0 %global build_wheel 0 %endif # define some macros for RHEL 6 %global __python2 %__python %global python2_sitelib %python_sitelib %global srcname setuptools %if 0%{?build_wheel} %global python2_wheelname %{srcname}-%{version}-py2.py3-none-any.whl %global python2_record %{python2_sitelib}/%{srcname}-%{version}.dist-info/RECORD %endif Name: python-setuptools Version: 25.1.1 Release: 2%{?dist} Summary: Easily build and distribute Python packages Group: Applications/System # LIcensing is in flux, see https://bitbucket.org/pypa/setuptools/issues/132/missing-license License: (Python or ZPLv2.0) and ASL 2.0 URL: https://pypi.python.org/pypi/%{srcname} Source0: https://files.pythonhosted.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz # PSFL Source1: https://hg.python.org/cpython/raw-file/tip/LICENSE # ZPL Source2: https://raw.githubusercontent.com/zopefoundation/Zope/master/LICENSE.txt # ASL 2.0 Source3: https://www.apache.org/licenses/LICENSE-2.0 BuildArch: noarch BuildRequires: python2-devel %if 0%{?build_wheel} BuildRequires: python-pip BuildRequires: python-wheel %endif %if 0%{?with_check} BuildRequires: pytest BuildRequires: python-mock %endif # with_check # We're now back to setuptools as the package. # Keep the python-distribute name active for a few releases. Eventually we'll # want to get rid of the Provides and just keep the Obsoletes Provides: python-distribute = %{version}-%{release} Obsoletes: python-distribute < 0.6.36-2 %description Setuptools is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python packages, especially ones that have dependencies on other packages. This package also contains the runtime components of setuptools, necessary to execute the software that requires pkg_resources.py. %package -n python2-setuptools Summary: Easily build and distribute Python packages %{?python_provide:%python_provide python2-setuptools} %description -n python2-setuptools Setuptools is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python packages, especially ones that have dependencies on other packages. This package also contains the runtime components of setuptools, necessary to execute the software that requires pkg_resources.py. %prep %setup -q -n %{srcname}-%{version} # We can't remove .egg-info (but it doesn't matter, since it'll be rebuilt): # The problem is that to properly execute setuptools' setup.py, # it is needed for setuptools to be loaded as a Distribution # (with egg-info or .dist-info dir), it's not sufficient # to just have them on PYTHONPATH # Running "setup.py install" without having setuptools installed # as a distribution gives warnings such as # ... distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points' # and doesn't create "easy_install" and .egg-info directory # Note: this is only a problem if bootstrapping wheel or building on RHEL, # otherwise setuptools are installed as dependency into buildroot # Strip shbang find setuptools -name \*.py | xargs sed -i -e '1 {/^#!\//d}' # Remove bundled exes rm -f setuptools/*.exe # These tests require internet connection rm setuptools/tests/test_integration.py %build %if 0%{?build_wheel} %{__python} setup.py bdist_wheel %else %{__python} setup.py build %endif %install %if 0%{?build_wheel} pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot} %else %{__python2} setup.py install --skip-build --root %{buildroot} %endif rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests %if 0%{?build_wheel} sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record} %endif install -p -m 0644 %{SOURCE1} psfl.txt install -p -m 0644 %{SOURCE2} zpl.txt install -p -m 0644 %{SOURCE3} asl.txt find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f # Don't ship these rm -r docs/{Makefile,conf.py,_*} %if 0%{?with_check} %check LANG=en_US.utf8 PYTHONPATH=$(pwd) py.test %endif # with_check %files -n python2-setuptools %license psfl.txt zpl.txt asl.txt %doc docs/* %{python2_sitelib}/* %{_bindir}/easy_install %{_bindir}/easy_install-2.* %changelog * Tue Feb 26 2019 Martin Kutlak - 25.1.1-2 * Fri Jul 29 2016 Kevin Fenzi - 25.1.1-1 - Update to 25.1.1. Fixes bug #1361465