github.com/kchristidis/fabric@v1.0.4-0.20171028114726-837acd08cde1/devenv/setupUbuntuOnPPC64le.sh (about) 1 #!/bin/bash 2 # 3 # Copyright IBM Corp. All Rights Reserved. 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 # 7 8 9 # Development on Power (ppc64le) systems is done outside of vagrant, on the 10 # native OS. This script helps setup the dev env on ppc64le Ubuntu. 11 # 12 # See https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/install.md#building-outside-of-vagrant- 13 # 14 # NOTE: This script assumes that 15 # - OS specific apt-sources / repositories are already set appropriately. 16 # - Host's GOPATH environment variable is set. 17 # 18 # To get started on a fresh Ubuntu install: 19 # mkdir -p $GOPATH/src/github.com/hyperledger 20 # cd $GOPATH/src/github.com/hyperledger 21 # git clone http://gerrit.hyperledger.org/r/fabric 22 # sudo ./fabric/devenv/setupUbuntuOnPPC64el.sh 23 # cd $GOPATH/src/github.com/hyperledger/fabric 24 # make dist-clean all 25 26 if [ xroot != x$(whoami) ] 27 then 28 echo "You must run as root (Hint: Try prefix 'sudo' while executing the script)" 29 exit 30 fi 31 32 if [ ! -d "$GOPATH/src/github.com/hyperledger/fabric" ] 33 then 34 echo "Ensure fabric code is under $GOPATH/src/github.com/hyperledger/fabric" 35 exit 36 fi 37 38 ##################################### 39 # Install pre-requisite OS packages # 40 ##################################### 41 apt-get update 42 apt-get -y install software-properties-common curl git sudo wget "build-essential" zlib1g-dev libbz2-dev 43 44 ##################################### 45 # Install and setup Docker services # 46 ##################################### 47 # Along with docker.io, aufs-tools also needs to be installed as 'auplink' which is part of aufs-tools package gets invoked during behave tests. 48 apt-get -y install docker.io aufs-tools 49 50 # Set DOCKER_OPTS and restart Docker daemon. 51 sed -i '/#DOCKER_OPTS=/a DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"' /etc/default/docker 52 systemctl restart docker 53 54 #################################### 55 # Install Go and set env variable # 56 #################################### 57 # Golang binaries for ppc64le are publicly available from Unicamp and is recommended as it includes certain platform specific tuning/optimization. 58 # Alternativley package part of Ubuntu disto repo can also be used. 59 wget ftp://ftp.unicamp.br/pub/linuxpatch/toolchain/at/ubuntu/dists/xenial/at10.0/binary-ppc64el/advance-toolchain-golang-at_10.0-2_ppc64el.deb 60 dpkg -i advance-toolchain-golang-at_10.0-2_ppc64el.deb 61 rm -f advance-toolchain-golang-at_10.0-2_ppc64el.deb 62 63 # Create links under /usr/bin using update-alternatives 64 update-alternatives --install /usr/bin/go go /usr/local/go/bin/go 10 65 update-alternatives --install /usr/bin/gofmt gofmt /usr/local/go/bin/gofmt 10 66 67 # Set the GOROOT env variable 68 export GOROOT="/opt/go" 69 ln -s /usr/local/go $GOROOT 70 71 ################################################ 72 # Install PIP tools, behave and docker-compose # 73 ################################################ 74 75 apt-get -y install python-pip libssl-dev libffi-dev libltdl-dev 76 pip install --upgrade pip 77 pip install behave nose docker-compose 78 79 pip install -I flask==0.10.1 python-dateutil==2.2 pytz==2014.3 pyyaml==3.10 couchdb==1.0 flask-cors==2.0.1 requests==2.4.3 grpcio==1.0.4 pyOpenSSL==16.2.0 pysha3==1.0b1 80 81 #PIP packages required for some behave tests 82 pip install urllib3 ndg-httpsclient pyasn1 ecdsa python-slugify grpcio-tools jinja2 b3j0f.aop six