]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build/ops: rpm: put mgr python build dependencies in make_check bcond
authorNathan Cutler <ncutler@suse.com>
Tue, 27 Jun 2017 07:45:09 +0000 (09:45 +0200)
committerNathan Cutler <ncutler@suse.com>
Mon, 17 Jul 2017 11:12:54 +0000 (13:12 +0200)
Fixes: http://tracker.ceph.com/issues/20425
Signed-off-by: Nathan Cutler <ncutler@suse.com>
Signed-off-by: Tim Serong <tserong@suse.com>
ceph.spec.in
install-deps.sh

index 07231917f0ac6c8ecef9033fd26b398a5d1e9cda..f68fb0a4f752b9351c4ab1d6fd55a4d81fa0fd58 100644 (file)
@@ -102,6 +102,17 @@ BuildRequires:     checkpolicy
 BuildRequires: selinux-policy-devel
 BuildRequires: /usr/share/selinux/devel/policyhelp
 %endif
+%if 0%{with make_check}
+%if 0%{?fedora} || 0%{?rhel}
+BuildRequires: python-cherrypy
+BuildRequires: python-werkzeug
+%endif
+%if 0%{?suse_version}
+BuildRequires: python-CherryPy
+BuildRequires: python-Werkzeug
+%endif
+BuildRequires: python-pecan
+%endif
 BuildRequires: bc
 BuildRequires: gperf
 BuildRequires:  cmake
@@ -127,10 +138,8 @@ BuildRequires:     pkgconfig
 BuildRequires: python
 BuildRequires: python-devel
 BuildRequires: python-nose
-BuildRequires: python-pecan
 BuildRequires: python-requests
 BuildRequires: python-virtualenv
-BuildRequires: python-werkzeug
 BuildRequires: socat
 BuildRequires: snappy-devel
 BuildRequires: udev
@@ -159,7 +168,6 @@ BuildRequires:      keyutils-devel
 BuildRequires:  libopenssl-devel
 BuildRequires:  lsb-release
 BuildRequires:  openldap2-devel
-BuildRequires: python-CherryPy
 BuildRequires: python-Cython
 BuildRequires: python-PrettyTable
 BuildRequires: python-Sphinx
@@ -176,7 +184,6 @@ BuildRequires:  openldap-devel
 BuildRequires:  openssl-devel
 BuildRequires:  redhat-lsb-core
 BuildRequires: Cython
-BuildRequires: python-cherrypy
 BuildRequires: python-prettytable
 BuildRequires: python-sphinx
 %endif
index 315848d905262519ee618394552a6926174faa78..87457874c3958be637af9a33325e81afedc6352a 100755 (executable)
@@ -19,6 +19,11 @@ if test $(id -u) != 0 ; then
 fi
 export LC_ALL=C # the following is vulnerable to i18n
 
+function munge_ceph_spec_in {
+    local OUTFILE=$1
+    sed -e 's/@//g' -e 's/%bcond_with make_check/%bcond_without make_check/g' < ceph.spec.in > $OUTFILE
+}
+
 if [ x`uname`x = xFreeBSDx ]; then
     $SUDO pkg install -yq \
         devel/git \
@@ -129,14 +134,14 @@ else
                 fi
                 ;;
         esac
-        sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec
+        munge_ceph_spec_in $DIR/ceph.spec
         $SUDO $builddepcmd $DIR/ceph.spec 2>&1 | tee $DIR/yum-builddep.out
         ! grep -q -i error: $DIR/yum-builddep.out || exit 1
         ;;
     opensuse|suse|sles)
         echo "Using zypper to install dependencies"
         $SUDO zypper --gpg-auto-import-keys --non-interactive install lsb-release systemd-rpm-macros
-        sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec
+        munge_ceph_spec_in $DIR/ceph.spec
         $SUDO zypper --non-interactive install $(rpmspec -q --buildrequires $DIR/ceph.spec) || exit 1
         ;;
     alpine)