]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: python-argparse only in Python 2.6 4970/head
authorNathan Cutler <ncutler@suse.com>
Tue, 16 Jun 2015 16:27:20 +0000 (18:27 +0200)
committerNathan Cutler <ncutler@suse.com>
Fri, 26 Jun 2015 10:46:46 +0000 (12:46 +0200)
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 <ncutler@suse.com>
ceph.spec.in

index 638b0b9b34077cb1643b33b686ac7d6cc970ae05..b540287718c2f280ccc866e2e9dc4fda9eacc4c7 100644 (file)
@@ -41,7 +41,6 @@ Requires:     python-rados = %{epoch}:%{version}-%{release}
 Requires:      python-rbd = %{epoch}:%{version}-%{release}
 Requires:      python-cephfs = %{epoch}:%{version}-%{release}
 Requires:      python
-Requires:      python-argparse
 Requires:      python-requests
 Requires:      python-flask
 Requires:      xfsprogs
@@ -77,7 +76,6 @@ BuildRequires:        perl
 BuildRequires: parted
 BuildRequires: pkgconfig
 BuildRequires: python
-BuildRequires: python-argparse
 BuildRequires: python-nose
 BuildRequires: python-requests
 %if ( 0%{?rhel} > 0 && 0%{?rhel} < 7 ) || ( 0%{?centos} > 0 && 0%{?centos} < 7 )
@@ -149,15 +147,17 @@ Requires: python-rados = %{epoch}:%{version}-%{release}
 Requires:      python-rbd = %{epoch}:%{version}-%{release}
 Requires:      python-cephfs = %{epoch}:%{version}-%{release}
 Requires:      python-requests
-%if 0%{defined suse_version}
-Requires:  python-argparse
-%endif
 %if 0%{?rhel} || 0%{?fedora}
 Requires:      redhat-lsb-core
 %endif
 %if 0%{defined suse_version}
 Requires:      lsb-release
 %endif
+# 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.