Conditionalize python3-devel runtime dependencies on RPM packages and setuptools

Installing python3-devel currently brings in:

- annobin
- dwz
- efi-srpm-macros
- fpc-srpm-macros
- ghc-srpm-macros
- gnat-srpm-macros
- go-srpm-macros
- nim-srpm-macros
- ocaml-srpm-macros
- openblas-srpm-macros
- perl-srpm-macros
- python-rpm-macros
- python-srpm-macros
- python3-rpm-generators
- python3-rpm-macros
- qt5-srpm-macros
- redhat-rpm-config
- rust-srpm-macros

For somebody who needs python3-devel to build extension modules,
those are all useless, so we conditionalize it on rpm-build.

Based on the reason for setuptools dependency, we do the same here
(but note that python3 already recommends it).
This commit is contained in:
Miro Hrončok 2019-08-11 11:23:07 +02:00
parent 2d970f424c
commit e9ba67b74b

View File

@ -415,10 +415,10 @@ Summary: Libraries and header files needed for Python development
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: python-rpm-macros
Requires: python-rpm-macros
Requires: python3-rpm-macros
%{?python_provide:%python_provide python3-devel}
# The RPM related dependencies bring nothing to a non-RPM Python developer
# But we want them when packages BuildRequire python3-devel
Requires: (python-rpm-macros if rpm-build)
Requires: (python3-rpm-macros if rpm-build)
%if %{without bootstrap}
# This is not "API" (packages that need setuptools should still BuildRequire it)
@ -428,11 +428,13 @@ Requires: python3-rpm-macros
# installed when -devel is required.
# See https://bugzilla.redhat.com/show_bug.cgi?id=1623914
# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
Requires: python3-setuptools
Requires: (python3-setuptools if rpm-build)
Requires: python3-rpm-generators
Requires: (python3-rpm-generators if rpm-build)
%endif
%{?python_provide:%python_provide python3-devel}
Provides: %{name}-2to3 = %{version}-%{release}
Provides: 2to3 = %{version}-%{release}