python-setuptools/python-setuptools.spec

159 lines
4.5 KiB
RPMSpec
Raw Normal View History

%global _with_bootstrap 1
2021-11-25 16:12:02 +08:00
%bcond_with bootstrap
2019-11-06 19:50:25 +08:00
%bcond_with tests
2019-09-30 11:15:33 -04:00
%global python3_record %{python3_sitelib}/setuptools-%{version}.dist-info/RECORD
%global python_whldir %{_datadir}/python-wheels
2021-03-29 18:42:46 +08:00
%global python_whlname setuptools-%{version}-py3-none-any.whl
2019-09-30 11:15:33 -04:00
Name: python-setuptools
2021-12-01 16:49:05 +08:00
Version: 59.4.0
Release: 3
2019-09-30 11:15:33 -04:00
Summary: Easily build and distribute Python packages
License: MIT and (BSD or ASL 2.0)
URL: https://pypi.python.org/pypi/setuptools
2021-03-29 18:42:46 +08:00
Source0: %{pypi_source setuptools %{version}}
2020-08-25 13:01:54 +08:00
Patch9000: bugfix-eliminate-random-order-in-metadata.patch
2019-09-30 11:15:33 -04:00
BuildArch: noarch
BuildRequires: python3-devel
%if %{with tests}
BuildRequires: python3-pip, python3-mock
BuildRequires: python3-pytest, python3-pytest-fixture-config
BuildRequires: python3-pytest-virtualenv
%endif
2021-11-25 16:12:02 +08:00
%if %{without bootstrap}
2019-09-30 11:15:33 -04:00
BuildRequires: python3-pip, python3-wheel
2021-11-25 16:12:02 +08:00
%endif
2019-09-30 11:15:33 -04:00
Provides: python-distribute = %{version}-%{release}, %{name}-wheel
Obsoletes: python-distribute < 0.6.36-2, %{name}-wheel
%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 contains a python wheel of setuptools to use with venv.
%package -n python3-setuptools
Summary: Easily build and distribute Python 3 packages
Conflicts: python-setuptools < %{version}-%{release}
%if %{with bootstrap}
Provides: python%{python3_pkgversion}dist(setuptools) = %{version}
Provides: python%{python3_version}dist(setuptools) = %{version}
%endif
2019-09-30 11:15:33 -04:00
%description -n python3-setuptools
Setuptools is a collection of enhancements to the Python 3 distutils that allow
you to more easily build and distribute Python 3 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_help
%prep
%autosetup -n setuptools-%{version} -p1
find setuptools pkg_resources -name \*.py | xargs sed -i -e '1 {/^#!\//d}'
rm -f setuptools/*.exe
rm setuptools/tests/test_integration.py
chmod -x README.rst
%build
2021-11-25 16:12:02 +08:00
%if %{without bootstrap}
2019-09-30 11:15:33 -04:00
%py3_build_wheel
2021-11-25 16:12:02 +08:00
%else
%py3_build
%endif
2019-09-30 11:15:33 -04:00
%install
2021-11-25 16:12:02 +08:00
%if %{without bootstrap}
2019-09-30 11:15:33 -04:00
%py3_install_wheel %{python_whlname}
sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
2021-03-29 18:42:46 +08:00
rm -rf %{buildroot}%{python3_sitelib}/{setuptools, pkg_resources}/tests
2019-09-30 11:15:33 -04:00
sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
2021-03-29 18:42:46 +08:00
rm -r docs/{conf.py,_*}
2019-09-30 11:15:33 -04:00
mkdir -p %{buildroot}%{python_whldir}
install -p dist/%{python_whlname} -t %{buildroot}%{python_whldir}
2021-11-25 16:12:02 +08:00
%else
%py3_install
%endif
2019-09-30 11:15:33 -04:00
%if %{with tests}
%check
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore=setuptools/tests/test_virtualenv.py --ignore=pavement.py
%endif
%files
%defattr(-,root,root)
%license LICENSE
2021-11-25 16:12:02 +08:00
%if %{without bootstrap}
2019-09-30 11:15:33 -04:00
%dir %{python_whldir}/
%{python_whldir}/%{python_whlname}
2021-11-25 16:12:02 +08:00
%endif
2019-09-30 11:15:33 -04:00
%files -n python3-setuptools
%defattr(-,root,root)
%{python3_sitelib}/pkg_resources/
%{python3_sitelib}/setuptools*/
2021-03-29 18:42:46 +08:00
%{python3_sitelib}/distutils-precedence.pth
%{python3_sitelib}/_distutils_hack/
2019-09-30 11:15:33 -04:00
%files help
%defattr(-,root,root)
%doc docs/* CHANGES.rst README.rst
%changelog
* Fri Dec 03 2021 shixuantong<shixuantong@huawei.com> - 59.4.0-3
- Provide pythonXdist(setuptools) when bootstrapping
2021-12-01 10:59:29 +00:00
* Wed Dec 01 2021 shixuantong<shixuantong@huawei.com> - 59.4.0-2
- Bootstrap for Python 3.10
2021-12-01 16:49:05 +08:00
* Wed Dec 01 2021 shixuantong<shixuantong@huawei.com> - 59.4.0-1
- update version to 59.4.0
2021-11-25 16:12:02 +08:00
* Thu Nov 25 2021 shixuantong<shixuantong@huawei.com> - 54.2.0-2
- add bootstrap for rebuild python3-3.10
2021-03-29 18:42:46 +08:00
* Mon Mar 29 2021 shixuantong<shixuantong@huawei.com> - 54.2.0-1
- upgrade version to 54.2.0
* Mon Nov 2 2020 wangjie<wangjie294@huawei.com> -44.1.1-2
- Type:NA
- ID:NA
- SUG:NA
- DESC:remove python2
2020-09-02 11:35:33 +08:00
* Wed Sep 2 2020 shixuantong<shixuantong@huawei.com> - 44.1.1 - 1
- update version to 44.1.1
2020-08-25 13:01:54 +08:00
* Tue Aug 25 2020 wenzhanli<wenzhanli2@huawei.com> - 41.5.0-1
- update version and add python2 require
* Thu Jun 4 2020 chengzihan <chengzihan2@huawei.com> - 41.2.0-3
- bugfix eliminate random order in metadata
2020-06-04 15:53:26 +08:00
* Thu Jun 4 2020 chengzihan <chengzihan2@huawei.com> - 41.2.0-2
- Upgrade package to version 41.2.0
2019-11-06 19:50:25 +08:00
* Wed Oct 30 2019 hexiaowen <hexiaowen@huawei.com> - 40.4.3-4
- disable tests
2019-09-30 11:15:33 -04:00
* Mon Sep 23 2019 openEuler Buildteam <buildteam@openeuler.org> - 40.4.3-3
- Fix python-setuptools-wheel dependency problems
* Wed Sep 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 40.4.3-2
- Package init