BIGTOP-2088: Support protobuf installation for OPENPOWER
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/2c2579cf Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/2c2579cf Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/2c2579cf Branch: refs/heads/master Commit: 2c2579cf5d1a3dc8589543298318e5c2757bab67 Parents: 2bf76ff Author: Olaf Flebbe <[email protected]> Authored: Tue Oct 13 22:26:48 2015 +0200 Committer: Olaf Flebbe <[email protected]> Committed: Wed Oct 21 16:12:26 2015 +0200 ---------------------------------------------------------------------- bigtop_toolchain/manifests/protobuf.pp | 41 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/2c2579cf/bigtop_toolchain/manifests/protobuf.pp ---------------------------------------------------------------------- diff --git a/bigtop_toolchain/manifests/protobuf.pp b/bigtop_toolchain/manifests/protobuf.pp index e69d909..ca5ec27 100644 --- a/bigtop_toolchain/manifests/protobuf.pp +++ b/bigtop_toolchain/manifests/protobuf.pp @@ -19,35 +19,40 @@ class bigtop_toolchain::protobuf { case $operatingsystem{ /Ubuntu|Debian/: { - exec { '/usr/bin/wget https://launchpad.net/ubuntu/+archive/primary/+files/libprotobuf8_2.5.0-9ubuntu1_amd64.deb': + case $architecture { + 'amd64' : { $url = "https://launchpad.net/ubuntu/+archive/primary/+files" + $arch= "amd64" } + 'ppc64le' : { $url = "https://bintray.com/artifact/download/oflebbe/bigtop-protobuf" + $arch= "ppc64el" } + } + } + } + + case $operatingsystem{ + /Ubuntu|Debian/: { + exec { "/usr/bin/wget $url/libprotobuf8_2.5.0-9ubuntu1_$arch.deb": cwd => "/usr/src", - require => Package[$packages::pkgs], - unless => "/usr/bin/test -f /usr/src/libprotobuf8_2.5.0-9ubuntu1_amd64.deb", + creates => "/usr/src/libprotobuf8_2.5.0-9ubuntu1_$arch.deb", } - exec { '/usr/bin/wget https://launchpad.net/ubuntu/+archive/primary/+files/libprotoc8_2.5.0-9ubuntu1_amd64.deb': + exec { "/usr/bin/wget $url/libprotoc8_2.5.0-9ubuntu1_$arch.deb": cwd => "/usr/src", - require => Package[$packages::pkgs], - unless => "/usr/bin/test -f /usr/src/libprotoc8_2.5.0-9ubuntu1_amd64.deb", + creates => "/usr/src/libprotoc8_2.5.0-9ubuntu1_$arch.deb", } - exec { '/usr/bin/wget https://launchpad.net/ubuntu/+archive/primary/+files/protobuf-compiler_2.5.0-9ubuntu1_amd64.deb': + exec { "/usr/bin/wget $url/protobuf-compiler_2.5.0-9ubuntu1_$arch.deb": cwd => "/usr/src", - require => Package[$packages::pkgs], - unless => "/usr/bin/test -f /usr/src/protobuf-compiler_2.5.0-9ubuntu1_amd64.deb", + creates => "/usr/src/protobuf-compiler_2.5.0-9ubuntu1_$arch.deb", } - exec {'/usr/bin/dpkg -i protobuf-compiler_2.5.0-9ubuntu1_amd64.deb': - unless => "/usr/bin/test -f /usr/bin/protoc", + exec {"/usr/bin/dpkg -i protobuf-compiler_2.5.0-9ubuntu1_$arch.deb": cwd => "/usr/src", - require => [ EXEC["/usr/bin/dpkg -i libprotoc8_2.5.0-9ubuntu1_amd64.deb"],EXEC["/usr/bin/wget https://launchpad.net/ubuntu/+archive/primary/+files/protobuf-compiler_2.5.0-9ubuntu1_amd64.deb"] ] + require => [ EXEC["/usr/bin/dpkg -i libprotoc8_2.5.0-9ubuntu1_$arch.deb"],EXEC["/usr/bin/wget $url/protobuf-compiler_2.5.0-9ubuntu1_$arch.deb"] ] } - exec {'/usr/bin/dpkg -i libprotoc8_2.5.0-9ubuntu1_amd64.deb': - unless => "/usr/bin/test -f /usr/bin/protoc", + exec {"/usr/bin/dpkg -i libprotoc8_2.5.0-9ubuntu1_$arch.deb": cwd => "/usr/src", - require => [ EXEC["/usr/bin/dpkg -i libprotobuf8_2.5.0-9ubuntu1_amd64.deb"],EXEC["/usr/bin/wget https://launchpad.net/ubuntu/+archive/primary/+files/libprotoc8_2.5.0-9ubuntu1_amd64.deb"] ] + require => [ EXEC["/usr/bin/dpkg -i libprotobuf8_2.5.0-9ubuntu1_$arch.deb"],EXEC["/usr/bin/wget $url/libprotoc8_2.5.0-9ubuntu1_$arch.deb"] ] } - exec {'/usr/bin/dpkg -i libprotobuf8_2.5.0-9ubuntu1_amd64.deb': - unless => "/usr/bin/test -f /usr/bin/protoc", + exec {"/usr/bin/dpkg -i libprotobuf8_2.5.0-9ubuntu1_$arch.deb": cwd => "/usr/src", - require => EXEC["/usr/bin/wget https://launchpad.net/ubuntu/+archive/primary/+files/libprotobuf8_2.5.0-9ubuntu1_amd64.deb"], + require => EXEC["/usr/bin/wget $url/libprotobuf8_2.5.0-9ubuntu1_$arch.deb"], } } default: {
