From: Nathan Cutler Date: Tue, 20 Nov 2018 10:43:13 +0000 (+0100) Subject: build/ops: rpm: stop install-deps.sh clobbering spec file Python build setting X-Git-Tag: v13.2.3~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25294%2Fhead;p=ceph.git 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 (cherry picked from commit 7d4916618c419e4c85823cf259b96e49d9203035) Conflicts: ceph.spec.in install-deps.sh - no WITH_SEASTAR in mimic --- diff --git a/ceph.spec.in b/ceph.spec.in index 3a9824b7dde9..05f8936dfbe2 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -49,9 +49,11 @@ %endif %endif %endif -%if 0%{?suse_version} >= 1500 +%if 0%{?fedora} >= 29 || 0%{?suse_version} >= 1500 +# distros that need a py3 Ceph build %bcond_with python2 %else +# distros that need a py2 Ceph build %bcond_without python2 %endif %if 0%{without python2} diff --git a/install-deps.sh b/install-deps.sh index 425d34cff624..97b30eb796bc 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -24,13 +24,9 @@ export LC_ALL=C # the following is vulnerable to i18n ARCH=`uname -m` 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 } function ensure_decent_gcc_on_ubuntu { @@ -211,7 +207,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