install.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/sh
  2. if [ "$1" == "" ]; then
  3. echo "Usage $0 executable branch ethereum develop"
  4. echo "executable ethereum or ethereal"
  5. echo "branch develop or master"
  6. exit
  7. fi
  8. exe=$1
  9. branch=$2
  10. # Test if go is installed
  11. command -v go >/dev/null 2>&1 || { echo >&2 "Unable to find 'go'. This script requires go."; exit 1; }
  12. # Test if $GOPATH is set
  13. if [ "$GOPATH" == "" ]; then
  14. echo "\$GOPATH not set"
  15. exit
  16. fi
  17. echo "go get -u -d github.com/ethereum/go-ethereum/$exe"
  18. go get -v -u -d github.com/ethereum/go-ethereum/$exe
  19. if [ $? != 0 ]; then
  20. echo "go get failed"
  21. exit
  22. fi
  23. echo "serpent-go"
  24. cd $GOPATH/src/github.com/obscuren/serpent-go
  25. echo "init submodule"
  26. git submodule init
  27. git submodule update
  28. echo "eth-go"
  29. cd $GOPATH/src/github.com/ethereum/eth-go
  30. git checkout $branch
  31. echo "go-ethereum"
  32. cd $GOPATH/src/github.com/ethereum/go-ethereum/$exe
  33. git checkout $branch
  34. if [ "$exe" == "ethereal" ]; then
  35. echo "Building ethereal GUI. Assuming Qt is installed. If this step"
  36. echo "fails; please refer to: https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go)"
  37. else
  38. echo "Building ethereum CLI."
  39. fi
  40. go install
  41. if [ $? == 0 ]; then
  42. echo "go install failed"
  43. exit
  44. fi
  45. echo "done. Please run $exe :-)"