[1115] | 1 |
|
---|
| 2 | %global with_check 0
|
---|
| 3 | %global build_wheel 0
|
---|
| 4 |
|
---|
| 5 | %global with_python3 0
|
---|
| 6 |
|
---|
[1564] | 7 | %global main_name setuptools
|
---|
[1115] | 8 | %if 0%{?build_wheel}
|
---|
[1564] | 9 | %global python2_wheelname %{main_name}-%{version}-py2.py3-none-any.whl
|
---|
| 10 | %global python2_record %{python2_sitelib}/%{main_name}-%{version}.dist-info/RECORD
|
---|
[1115] | 11 | %if 0%{?with_python3}
|
---|
| 12 | %global python3_wheelname %python2_wheelname
|
---|
[1564] | 13 | %global python3_record %{python3_sitelib}/%{main_name}-%{version}.dist-info/RECORD
|
---|
[1115] | 14 | %endif
|
---|
| 15 | %endif
|
---|
| 16 |
|
---|
| 17 | Name: python-setuptools
|
---|
| 18 | Version: 34.4.1
|
---|
[1564] | 19 | Release: 2%{?dist}
|
---|
[1115] | 20 | Summary: Easily build and distribute Python packages
|
---|
| 21 |
|
---|
| 22 | Group: Applications/System
|
---|
| 23 | License: MIT
|
---|
[1564] | 24 | URL: https://pypi.python.org/pypi/%{main_name}
|
---|
[1115] | 25 | Vendor: bww bitwise works GmbH
|
---|
[1564] | 26 | %scm_source github https://github.com/bitwiseworks/%{main_name}-os2 %{version}-os2
|
---|
[1115] | 27 |
|
---|
| 28 |
|
---|
| 29 | BuildArch: noarch
|
---|
[1564] | 30 | BuildRequires: python-rpm-macros >= 1-3
|
---|
[1115] | 31 | BuildRequires: python2-devel
|
---|
| 32 | BuildRequires: python2-packaging
|
---|
| 33 | BuildRequires: python2-appdirs
|
---|
| 34 | %if 0%{?build_wheel}
|
---|
| 35 | BuildRequires: python-pip
|
---|
| 36 | BuildRequires: python-wheel
|
---|
| 37 | %endif
|
---|
| 38 | %if 0%{?with_check}
|
---|
| 39 | BuildRequires: python2-pytest
|
---|
| 40 | BuildRequires: python2-mock
|
---|
| 41 | BuildRequires: python2-backports-unittest_mock
|
---|
| 42 | %endif # with_check
|
---|
| 43 |
|
---|
| 44 | %if 0%{?with_python3}
|
---|
| 45 | BuildRequires: python3-devel
|
---|
| 46 | BuildRequires: python3-packaging
|
---|
| 47 | BuildRequires: python3-appdirs
|
---|
| 48 | %if 0%{?with_check}
|
---|
| 49 | BuildRequires: python3-pytest
|
---|
| 50 | BuildRequires: python3-mock
|
---|
| 51 | %endif # with_check
|
---|
| 52 | %if 0%{?build_wheel}
|
---|
| 53 | BuildRequires: python3-pip
|
---|
| 54 | BuildRequires: 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
|
---|
| 61 | Provides: python-distribute = %{version}-%{release}
|
---|
| 62 | Obsoletes: python-distribute < 0.6.36-2
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | %description
|
---|
| 66 | Setuptools is a collection of enhancements to the Python distutils that allow
|
---|
| 67 | you to more easily build and distribute Python packages, especially ones that
|
---|
| 68 | have dependencies on other packages.
|
---|
| 69 |
|
---|
| 70 | This package also contains the runtime components of setuptools, necessary to
|
---|
| 71 | execute the software that requires pkg_resources.py.
|
---|
| 72 |
|
---|
| 73 | %package -n python2-setuptools
|
---|
| 74 | Summary: Easily build and distribute Python packages
|
---|
| 75 | %{?python_provide:%python_provide python2-setuptools}
|
---|
| 76 | Requires: python2-packaging >= 16.8
|
---|
| 77 | Requires: python2-six >= 1.6.0
|
---|
| 78 | Requires: python2-appdirs >= 1.4.0
|
---|
| 79 | %description -n python2-setuptools
|
---|
| 80 | Setuptools is a collection of enhancements to the Python distutils that allow
|
---|
| 81 | you to more easily build and distribute Python packages, especially ones that
|
---|
| 82 | have dependencies on other packages.
|
---|
| 83 |
|
---|
| 84 | This package also contains the runtime components of setuptools, necessary to
|
---|
| 85 | execute the software that requires pkg_resources.py.
|
---|
| 86 |
|
---|
| 87 | %if 0%{?with_python3}
|
---|
| 88 | %package -n python3-setuptools
|
---|
| 89 | Summary: Easily build and distribute Python 3 packages
|
---|
| 90 | Requires: python3-packaging >= 16.8
|
---|
| 91 | Requires: python3-six >= 1.6.0
|
---|
| 92 | Requires: python3-appdirs >= 1.4.0
|
---|
| 93 | Group: 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
|
---|
| 101 | Setuptools is a collection of enhancements to the Python 3 distutils that allow
|
---|
| 102 | you to more easily build and distribute Python 3 packages, especially ones that
|
---|
| 103 | have dependencies on other packages.
|
---|
| 104 |
|
---|
| 105 | This package also contains the runtime components of setuptools, necessary to
|
---|
| 106 | execute the software that requires pkg_resources.py.
|
---|
| 107 |
|
---|
| 108 | %endif # with_python3
|
---|
| 109 |
|
---|
| 110 | %prep
|
---|
| 111 | %scm_setup
|
---|
| 112 | python 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
|
---|
| 127 | find setuptools -name \*.py | xargs sed -i -e '1 {/^#!\//d}'
|
---|
| 128 | # Remove bundled exes
|
---|
| 129 | rm -f setuptools/*.exe
|
---|
| 130 | # These tests require internet connection
|
---|
| 131 | rm 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)
|
---|
| 159 | rm %{buildroot}%{_bindir}/easy_install
|
---|
| 160 |
|
---|
| 161 | sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
|
---|
| 162 | %else
|
---|
| 163 | %py3_install
|
---|
| 164 | %endif
|
---|
| 165 |
|
---|
| 166 | rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
|
---|
| 167 | %if 0%{?build_wheel}
|
---|
| 168 | sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
|
---|
| 169 | %endif
|
---|
| 170 |
|
---|
| 171 | find %{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 |
|
---|
| 180 | rm -rf %{buildroot}%{python2_sitelib}/setuptools/tests
|
---|
| 181 | %if 0%{?build_wheel}
|
---|
| 182 | sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record}
|
---|
| 183 | %endif
|
---|
| 184 |
|
---|
| 185 | find %{buildroot}%{python2_sitelib} -name '*.exe' | xargs rm -f
|
---|
| 186 |
|
---|
| 187 | # Don't ship these
|
---|
| 188 | rm -r docs/Makefile
|
---|
| 189 | rm -r docs/conf.py
|
---|
| 190 | rm -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}
|
---|
| 197 | LANG=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
|
---|
[1564] | 220 | * Mon Jan 21 2019 Silvan Scherrer <silvan.scherrer@aroa.ch> 34.4.1-2
|
---|
| 221 | - rebuilt with latest python macros
|
---|
| 222 |
|
---|
[1127] | 223 | * Mon May 08 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 34.4.1-1
|
---|
[1115] | 224 | - moved source to github
|
---|
[1127] | 225 | - rebuilt with latest python macros
|
---|
[1115] | 226 |
|
---|
| 227 | * Mon Feb 27 2017 Silvan Scherrer <silvan.scherrer@aroa.ch> 34.2-0
|
---|
| 228 | - first rpm version (internal version only)
|
---|