RHEL: Convert from Fedora for the Python 3.11 stack in RHEL
Resolves: rhbz#2157725
This commit is contained in:
parent
214825ed26
commit
e44f89fcb8
@ -1,10 +1,13 @@
|
||||
%global __python3 /usr/bin/python3.11
|
||||
%global python3_pkgversion 3.11
|
||||
|
||||
%if 0%{?rhel}
|
||||
%bcond_with tests
|
||||
%else
|
||||
%bcond_without tests
|
||||
%endif
|
||||
|
||||
Name: python-setuptools-rust
|
||||
Name: python%{python3_pkgversion}-setuptools-rust
|
||||
Version: 1.5.2
|
||||
Release: 1%{?dist}
|
||||
Summary: Setuptools Rust extension plugin
|
||||
@ -15,17 +18,22 @@ Source0: %{pypi_source setuptools-rust}
|
||||
BuildArch: noarch
|
||||
ExclusiveArch: %{rust_arches}
|
||||
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3dist(setuptools) > 46.1
|
||||
BuildRequires: python3dist(semantic-version) >= 2.8.2
|
||||
BuildRequires: python3dist(typing-extensions) >= 3.7.4.4
|
||||
BuildRequires: python%{python3_pkgversion}-devel
|
||||
BuildRequires: python%{python3_pkgversion}-rpm-macros
|
||||
BuildRequires: python%{python3_pkgversion}-setuptools > 46.1
|
||||
BuildRequires: python%{python3_pkgversion}-semantic_version >= 2.8.2
|
||||
BuildRequires: python%{python3_pkgversion}-wheel
|
||||
|
||||
Requires: python%{python3_pkgversion}-semantic_version >= 2.8.2
|
||||
Requires: python%{python3_pkgversion}-setuptools >= 62.4
|
||||
# RHEL: Dependency is missing
|
||||
#BuildRequires: python3dist(typing-extensions) >= 3.7.4.4
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: python3dist(setuptools-scm) >= 3.4.3
|
||||
BuildRequires: python3dist(wheel)
|
||||
BuildRequires: rust-packaging >= 1.45
|
||||
%else
|
||||
# RHEL has rust-toolset and neither setuptools-scm nor wheel
|
||||
# RHEL has rust-toolset
|
||||
BuildRequires: rust-toolset >= 1.45
|
||||
Requires: rust-toolset >= 1.45
|
||||
%endif
|
||||
%if %{with tests}
|
||||
BuildRequires: rust-pyo3+default-devel
|
||||
@ -35,17 +43,6 @@ BuildRequires: rust-pyo3+default-devel
|
||||
Setuptools helpers for Rust Python extensions. Compile and distribute Python
|
||||
extensions written in Rust as easily as if they were written in C.
|
||||
|
||||
%package -n python3-setuptools-rust
|
||||
Summary: %{summary}
|
||||
%if 0%{?fedora}
|
||||
Requires: rust-packaging >= 1.45
|
||||
%else
|
||||
Requires: rust-toolset >= 1.45
|
||||
%endif
|
||||
|
||||
%description -n python3-setuptools-rust
|
||||
Setuptools helpers for Rust Python extensions. Compile and distribute Python
|
||||
extensions written in Rust as easily as if they were written in C.
|
||||
|
||||
%prep
|
||||
%autosetup -n setuptools-rust-%{version}
|
||||
@ -53,16 +50,15 @@ extensions written in Rust as easily as if they were written in C.
|
||||
rm -rf setuptools-rust.egg-info
|
||||
|
||||
%if ! 0%{?fedora}
|
||||
# RHEL doesn't have setuptools-scm
|
||||
# remove setuptools-scm
|
||||
rm pyproject.toml
|
||||
sed -i 's/setup_requires.*//' setup.cfg
|
||||
# remove dependency on typing extensions and use
|
||||
# stdlib instead
|
||||
sed -i 's/typing_extensions.*$//g' setup.cfg
|
||||
|
||||
sed -i -e 's/typing_extensions/typing/' \
|
||||
setuptools_rust/setuptools_ext.py \
|
||||
setuptools_rust/build.py \
|
||||
setuptools_rust/extension.py
|
||||
|
||||
# create version.py without setuptools-scm
|
||||
cat > setuptools_rust/version.py << EOF
|
||||
version = '%{VERSION}'
|
||||
version_tuple = ($(echo %{VERSION} | sed 's/\./, /g'))
|
||||
EOF
|
||||
%endif
|
||||
|
||||
|
||||
@ -84,12 +80,16 @@ cd ../..
|
||||
%endif
|
||||
|
||||
|
||||
%files -n python3-setuptools-rust
|
||||
%files -n python%{python3_pkgversion}-setuptools-rust
|
||||
%doc README.md CHANGELOG.md
|
||||
%license LICENSE
|
||||
%{python3_sitelib}/setuptools_rust/
|
||||
%{python3_sitelib}/setuptools_rust-%{version}-py%{python3_version}.egg-info/
|
||||
|
||||
%changelog
|
||||
* Fri Dec 02 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.5.2-1
|
||||
- Import from Fedora
|
||||
* Thu Nov 03 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.5.2-1
|
||||
- Initial import
|
||||
- Fedora contributions by:
|
||||
Christian Heimes <cheimes@redhat.com>
|
||||
Gwyn Ciesla <limb@fedoraproject.org>
|
||||
Tomáš Hrnčiar <thrnciar@redhat.com>
|
||||
|
Loading…
Reference in New Issue
Block a user