From 2544a6fc59a86d3f02dcd67d3c84a72d7a1100a0 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Tue, 16 Jun 2015 18:27:20 +0200 Subject: [PATCH] ceph.spec.in: python-argparse only in Python 2.6 argparse is a widely-used Python module for parsing command-line arguments. Ceph makes heavy use of Python scripts, both in the build environment and on cluster nodes and clients. Until Python 2.6, argparse was distributed separately from Python proper. As of 2.7 it is part of the Python standard library. Although the python package in a given distro may or may not Provide: python-argparse, this cannot be relied upon. Therefore, this commit puts appropriate conditionals around Requires: python-argparse and BuildRequires: python-argparse. It does so for Red Hat/CentOS and SUSE only, because the last Fedora version with Python 2.6 was Fedora 13, which is EOL. argparse is required by both the ceph and ceph-common packages, but since ceph requires ceph-common, the argparse Requires and BuildRequires need only appear once, under ceph-common. http://tracker.ceph.com/issues/12034 Fixes: #12034 Signed-off-by: Nathan Cutler (cherry picked from commit 23171c952997d104cfa6b5700ec0bb658a8e0915) Conflicts: ceph.spec.in --- ceph.spec.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index b1372aa422a5c..15392865453f4 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -24,7 +24,6 @@ Requires: librados2 = %{version}-%{release} Requires: libcephfs1 = %{version}-%{release} Requires: ceph-common = %{version}-%{release} Requires: python -Requires: python-argparse Requires: python-ceph Requires: python-requests Requires: python-flask @@ -44,7 +43,6 @@ BuildRequires: gdbm BuildRequires: pkgconfig BuildRequires: python BuildRequires: python-nose -BuildRequires: python-argparse BuildRequires: libaio-devel BuildRequires: libcurl-devel BuildRequires: libxml2-devel @@ -107,6 +105,11 @@ Requires: librados2 = %{version}-%{release} Requires: python-ceph = %{version}-%{release} Requires: python-requests Requires: redhat-lsb-core +# python-argparse is only needed in distros with Python 2.6 or lower +%if (0%{?rhel} && 0%{?rhel} <= 6) || (0%{?suse_version} && 0%{?suse_version} <= 1110) +Requires: python-argparse +BuildRequires: python-argparse +%endif %description -n ceph-common common utilities to mount and interact with a ceph storage cluster -- 2.39.5