Accepting request 847489 from home:mcepl:branches:devel:languages:python

- Add wheel subpackage with the generated wheel for this package.

OBS-URL: https://build.opensuse.org/request/show/847489
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=201
This commit is contained in:
Matej Cepl 2020-11-10 12:57:57 +00:00 committed by Git OBS Bridge
parent a8de44f268
commit cd821b8dc3
2 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Nov 10 09:21:02 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Add wheel subpackage with the generated wheel for this package.
-------------------------------------------------------------------
Thu Aug 13 11:03:41 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>

View File

@ -22,9 +22,11 @@
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%bcond_with wheel
%else
%define psuffix %{nil}
%bcond_with test
%bcond_without wheel
%endif
%bcond_without python2
Name: python-setuptools%{psuffix}
@ -32,6 +34,7 @@ Version: 44.1.1
Release: 0
Summary: Enhancements to distutils for building and distributing Python packages
License: MIT
Group: Development/Languages/Python
URL: https://github.com/pypa/setuptools
Source: https://files.pythonhosted.org/packages/source/s/setuptools/setuptools-%{version}.zip
Source3: testdata.tar.gz
@ -80,6 +83,9 @@ Recommends: ca-certificates-mozilla
Provides: %{oldpython}-distribute = %{version}
Obsoletes: %{oldpython}-distribute < %{version}
%endif
%if %{with wheel}
BuildRequires: %{python_module wheel}
%endif
%python_subpackages
%description
@ -87,6 +93,16 @@ setuptools is a collection of enhancements to the Python distutils that
allow you to build and distribute Python packages,
especially ones that have dependencies on other packages.
%if %{with wheel}
%package wheel
Summary: Wheels for %{name}
Group: Development/Languages/Python
BuildArch: noarch
%description wheel
Generated wheels for %{name}.
%endif
%prep
%setup -q -n setuptools-%{version}
tar -xzvf %{SOURCE3}
@ -122,11 +138,19 @@ find ./ -type f -name \*.py -exec sed -i \
%build
%python_build
%if %{with wheel}
%python_exec setup.py bdist_wheel --universal
%endif
%install
%if !%{with test}
%python_install
%prepare_alternative easy_install
%if %{with wheel}
%python_expand install -D -m 0644 -t %{buildroot}%{$python_sitelib}/../wheels dist/*.whl
%endif
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
@ -159,4 +183,10 @@ export PYTHONPATH=$(pwd)
%{python_sitelib}/pkg_resources/*
%endif
%if %{with wheel}
%files %{python_files wheel}
%dir %{python_sitelib}/../wheels
%{python_sitelib}/../wheels/*
%endif
%changelog