]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
build/ops: rpm: stop install-deps.sh clobbering spec file Python build setting 25294/head
authorNathan Cutler <ncutler@suse.com>
Tue, 20 Nov 2018 10:43:13 +0000 (11:43 +0100)
committerNathan Cutler <ncutler@suse.com>
Tue, 27 Nov 2018 22:42:31 +0000 (23:42 +0100)
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 <bhubbard@redhat.com>
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 7d4916618c419e4c85823cf259b96e49d9203035)

Conflicts:
ceph.spec.in
install-deps.sh
- no WITH_SEASTAR in mimic

ceph.spec.in
install-deps.sh

index 3a9824b7dde92b6c9b55ed55662414971b96d160..05f8936dfbe23d81df01f16946e142408ff21ab8 100644 (file)
 %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}
index 425d34cff624be0c3ac4ca66c01cb0ff7854632a..97b30eb796bcaf91aa97b660d62827299de7a490 100755 (executable)
@@ -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