From e9ba67b74b9849d00cfc8e332b711db142dfd3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 11 Aug 2019 11:23:07 +0200 Subject: [PATCH] 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). --- python38.spec | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/python38.spec b/python38.spec index 3013707..85512cf 100644 --- a/python38.spec +++ b/python38.spec @@ -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}