From e2599943a248bfa9705fefa287c3f434bfb2b555 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Aug 11 2019 09:37:21 +0000 Subject: 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). --- diff --git a/python3.spec b/python3.spec index 8cd0bcd..7910dd3 100644 --- a/python3.spec +++ b/python3.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 4%{?dist} +Release: 5%{?dist} License: Python @@ -440,11 +440,12 @@ 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 -Requires: python3-rpm-generators -%{?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) +Requires: (python3-rpm-generators if rpm-build) # This is not "API" (packages that need setuptools should still BuildRequire it) # However some packages apparently can build both with and without setuptools @@ -453,7 +454,9 @@ Requires: python3-rpm-generators # 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) + +%{?python_provide:%python_provide python3-devel} Provides: %{name}-2to3 = %{version}-%{release} Provides: 2to3 = %{version}-%{release} @@ -1536,6 +1539,9 @@ CheckPython optimized # ====================================================== %changelog +* Sun Aug 11 2019 Miro Hrončok - 3.7.4-5 +- Conditionalize python3-devel runtime dependencies on RPM packages and setuptools + * Fri Jul 26 2019 Fedora Release Engineering - 3.7.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild