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