From 7d4916618c419e4c85823cf259b96e49d9203035 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Tue, 20 Nov 2018 11:43:13 +0100 Subject: [PATCH] build/ops: rpm: stop install-deps.sh clobbering spec file Python build setting Fedora 29 still ships a Python 2 binary, but some of Ceph's build dependencies are only available in py3 versions there. In other words, from F29 on, it is no longer possible to do a py2 Ceph build on Fedora, even if a python2 binary exists on the system. If that were not enough, the Python 2 that ships with Fedora 29 is linked against a non-compatible version of OpenSSL. Before this commit, install-deps.sh was overriding the spec file's Python build setting based on the presence or absence of a python2 binary. As the bug cited below indicates, this was not a good idea. It's better for the spec file to be explicit about which OS versions are py2 and which are py3, and just stick to that. Fixes: http://tracker.ceph.com/issues/37301 Signed-off-by: Brad Hubbard Signed-off-by: Nathan Cutler --- ceph.spec.in | 6 +++--- install-deps.sh | 7 +------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index 3ab90a1f7c7..a5ef095f34a 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -50,11 +50,11 @@ %endif %endif %bcond_with seastar -%if 0%{?fedora} || 0%{?suse_version} >= 1500 -# distros where py2 is _optional_ +%if 0%{?fedora} >= 29 || 0%{?suse_version} >= 1500 +# distros that need a py3 Ceph build %bcond_with python2 %else -# distros where py2 is _mandatory_ +# distros that need a py2 Ceph build %bcond_without python2 %endif %if 0%{?fedora} || 0%{?suse_version} >= 1500 diff --git a/install-deps.sh b/install-deps.sh index 82bce59efe6..31c7c1249fd 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -33,13 +33,9 @@ function install_seastar_deps { } function munge_ceph_spec_in { + # http://rpm.org/user_doc/conditional_builds.html local OUTFILE=$1 sed -e 's/@//g' -e 's/%bcond_with make_check/%bcond_without make_check/g' < ceph.spec.in > $OUTFILE - if type python2 > /dev/null 2>&1 ; then - sed -i -e 's/%bcond_with python2/%bcond_without python2/g' $OUTFILE - else - sed -i -e 's/%bcond_without python2/%bcond_with python2/g' $OUTFILE - fi if [ $WITH_SEASTAR ]; then sed -i -e 's/%bcond_with seastar/%bcond_without seastar/g' $OUTFILE fi @@ -293,7 +289,6 @@ else $SUDO yum-config-manager --disable centos-sclo-rh || true $SUDO yum remove centos-release-scl || true fi - case $ID in fedora) if test $yumdnf = yum; then -- 2.39.5