]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps: support OpenSUSE 4068/head
authorLoic Dachary <ldachary@redhat.com>
Mon, 23 Mar 2015 20:28:20 +0000 (21:28 +0100)
committerLoic Dachary <ldachary@redhat.com>
Tue, 24 Mar 2015 13:11:47 +0000 (14:11 +0100)
OpenSUSE must be separated as it uses zypper and does not have a
functional yum-builddep

Signed-off-by: Loic Dachary <ldachary@redhat.com>
install-deps.sh

index 944781e16787743cebae306a6a163a881e5cc094..c741425b4c364593401a43bb0210d6e384af12b6 100755 (executable)
@@ -23,10 +23,14 @@ if test -f /etc/redhat-release ; then
     $SUDO yum install -y redhat-lsb-core
 fi
 
-if which apt-get > /dev/null ; then
+if type apt-get > /dev/null 2>&1 ; then
     $SUDO apt-get install -y lsb-release
 fi
 
+if type zypper > /dev/null 2>&1 ; then
+    $SUDO zypper --gpg-auto-import-keys --non-interactive install openSUSE-release lsb-release
+fi
+
 case $(lsb_release -si) in
 Ubuntu|Debian|Devuan)
         $SUDO apt-get install -y dpkg-dev
@@ -49,11 +53,8 @@ Ubuntu|Debian|Devuan)
         packages=$(echo $packages) # change newlines into spaces
         $SUDO bash -c "DEBIAN_FRONTEND=noninteractive apt-get install -y $packages"
         ;;
-CentOS|Fedora|SUSE*|RedHatEnterpriseServer)
+CentOS|Fedora|RedHatEnterpriseServer)
         case $(lsb_release -si) in
-            SUSE*)
-                $SUDO zypper -y yum-utils
-                ;;
             Fedora)
                 $SUDO yum install -y yum-utils
                 ;;
@@ -73,6 +74,10 @@ CentOS|Fedora|SUSE*|RedHatEnterpriseServer)
         sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec
         $SUDO yum-builddep -y $DIR/ceph.spec
         ;;
+*SUSE*)
+        sed -e 's/@//g' < ceph.spec.in > $DIR/ceph.spec
+        $SUDO zypper --non-interactive install $(rpmspec -q --buildrequires $DIR/ceph.spec)
+        ;;
 *)
         echo "$(lsb_release -si) is unknown, dependencies will have to be installed manually."
         ;;