]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec: declare PyYAML and Jinja2 Requires for cephadm RPM 68368/head
authorKobi Ginon <kginon@redhat.com>
Wed, 20 May 2026 13:09:53 +0000 (16:09 +0300)
committerKobi Ginon <kginon@redhat.com>
Thu, 4 Jun 2026 00:06:06 +0000 (03:06 +0300)
cephadm's zipapp imports yaml and jinja2. When the package is built
with cephadm_bundling and RPM-sourced deps (--without cephadm_pip_deps),
only BuildRequires were listed for jinja2 and no runtime Requires were
declared for PyYAML or Jinja2, so minimal "dnf install cephadm" could
fail with ModuleNotFoundError. The unbundled cephadm case also lacked
PyYAML.

Add matching BuildRequires/Requires in the rpm-bundle branch and
Requires (plus SUSE naming for Jinja2/PyYAML) in the no-bundle branch.

Fixes: https://tracker.ceph.com/issues/75389
Signed-off-by: Kobi Ginon <kginon@redhat.com>
ceph.spec.in

index 18cd57b26833e0181627f59ff6f3c901c0b6d298..b170edf93f704538687b6d4a91e35936262170dc 100644 (file)
@@ -558,13 +558,39 @@ Requires:       which
 %if 0%{?weak_deps}
 Recommends:     podman >= 2.0.2
 %endif
+# Cephadm zipapp: CMake sets CEPHADM_BUNDLED_DEPENDENCIES to pip, rpm, or none
+# (see build / cmake block below):
+#  - with cephadm_bundling, with cephadm_pip_deps: pip at build, no stanzas here
+#  - with cephadm_bundling, without cephadm_pip_deps: build-time RPM deps only
+#  - without cephadm_bundling: unbundled cephadm, runtime Requires for yaml/jinja2
+# CentOS Storage SIG #75389 needs the unbundled branch (--without cephadm_bundling)
+# after dropping downstream patch 0036; pip-mode SIG builds are a separate SIG fix.
 %if 0%{with cephadm_bundling}
 %if 0%{without cephadm_pip_deps}
-BuildRequires: python3-jinja2 >= 2.10
+# Zipapp built from system RPMs at build time; bundled zipapp is self-contained at runtime.
+# SUSE and RHEL/Fedora use different PyPI RPM names (Jinja2/PyYAML vs jinja2/pyyaml).
+%if 0%{?suse_version}
+BuildRequires: python%{python3_pkgversion}-Jinja2 >= 2.10
+BuildRequires: python%{python3_pkgversion}-PyYAML
+%else
+BuildRequires: python%{python3_pkgversion}-jinja2 >= 2.10
+BuildRequires: python%{python3_pkgversion}-pyyaml
+%endif
+%dnl suse/else: rpm bundle, distinct RPM names only (not duplicate stanzas)
 %endif
+%dnl end without cephadm_pip_deps (CEPHADM_BUNDLED_DEPENDENCIES=rpm)
 %else
-Requires: python3-jinja2 >= 2.10
+# Unbundled cephadm: host must provide yaml and jinja2 at runtime.
+%if 0%{?suse_version}
+Requires: python%{python3_pkgversion}-Jinja2 >= 2.10
+Requires: python%{python3_pkgversion}-PyYAML
+%else
+Requires: python%{python3_pkgversion}-jinja2 >= 2.10
+Requires: python%{python3_pkgversion}-pyyaml
+%endif
+%dnl suse/else: unbundled cephadm (CEPHADM_BUNDLED_DEPENDENCIES=none)
 %endif
+%dnl end with cephadm_bundling
 %description -n cephadm
 Utility to bootstrap a Ceph cluster and manage Ceph daemons deployed
 with systemd and podman.