]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rpm: put numpy and scipy deps in distro conditionals
authorNathan Cutler <ncutler@suse.com>
Fri, 1 Mar 2019 12:54:07 +0000 (13:54 +0100)
committerNathan Cutler <ncutler@suse.com>
Wed, 6 Mar 2019 14:13:23 +0000 (15:13 +0100)
Without this patch, attempts to install the ceph-mgr-diskprediction-local RPM
fail on SUSE platforms with the following error:

can't install ceph-mgr-diskprediction-local-14.1.0.402+ga396e8bf3b-3742.1.noarch:
  nothing provides numpy needed by ceph-mgr-diskprediction-local-14.1.0.402+ga396e8bf3b-3742.1.noarch
  nothing provides scipy needed by ceph-mgr-diskprediction-local-14.1.0.402+ga396e8bf3b-3742.1.noarch

Also take into account package naming differences between Fedora and
RHEL/CentOS.

Signed-off-by: Kefu Chai <kchai@redhat.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
ceph.spec.in

index 0cf3e580936c4d90da25234d502d4db9be5e229e..95ea2c08fe728648d79189afe836d7b31bae719e 100644 (file)
@@ -493,8 +493,18 @@ BuildArch:      noarch
 Group:          System/Filesystems
 %endif
 Requires:       ceph-mgr = %{_epoch_prefix}%{version}-%{release}
+%if 0%{?fedora} || 0%{?rhel} > 7 || 0%{?suse_version}
+Requires:       python%{_python_buildid}-numpy
+%if 0%{without python2}
+Requires:       python3-scipy
+%else
+Requires:       python2-scipy
+%endif
+%endif
+%if 0%{?rhel} <= 7
 Requires:       numpy
 Requires:       scipy
+%endif
 %description mgr-diskprediction-local
 ceph-mgr-diskprediction-local is a ceph-mgr plugin that tries to predict
 disk failures using local algorithms and machine-learning databases.