github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/containers/compilers/includeos/cpp/patches/install.sh (about) 1 #!/bin/sh 2 3 # OPTIONS: 4 # 5 # Location of the IncludeOS repo (assumes current folder if not defined), e.g.: 6 # $ export INCLUDEOS_SRC=your/github/cloned/IncludeOS 7 export INCLUDEOS_SRC=${INCLUDEOS_SRC-`pwd`} 8 9 echo "uniK installation" 10 11 SYSTEM=`uname -s` 12 13 RELEASE=$([ $SYSTEM = "Darwin" ] && echo `sw_vers -productVersion` || echo `lsb_release -is`) 14 15 check_os_support() { 16 SYSTEM=$1 17 RELEASE=$2 18 19 case $SYSTEM in 20 "Darwin") 21 return 0; 22 ;; 23 "Linux") 24 case $RELEASE in 25 "Ubuntu"|"LinuxMint") 26 return 0; 27 ;; 28 "Fedora") 29 export INCLUDEOS_SRC=`pwd` 30 return 0; 31 ;; 32 "Arch") 33 return 0; 34 ;; 35 esac 36 esac 37 return 1; 38 } 39 40 # check if sudo is available 41 if ! command -v sudo > /dev/null 2>&1; then 42 echo -e ">>> Sorry <<< \n\ 43 The command sudo was not found. \n" 44 exit 1 45 fi 46 47 # check if system is supported at all 48 if ! check_os_support $SYSTEM $RELEASE; then 49 echo -e ">>> Sorry <<< \n\ 50 Currently only Ubuntu, Fedora, Arch, and OSX are actively supported for *building* IncludeOS. \n\ 51 On other Linux distros it shouldn't be that hard to get it to work - take a look at\n \ 52 ./etc/install_from_bundle.sh \n" 53 exit 1 54 fi 55 56 # now install build requirements (compiler, etc). This was moved into 57 # a function of its own as it can easen the setup. 58 if ! ./etc/install_build_requirements.sh $SYSTEM $RELEASE; then 59 echo -e ">>> Sorry <<< \n\ 60 Could not install build requirements. \n" 61 exit 1 62 fi 63 64 # if the --all-source parameter was given, build it the hard way 65 if [ "$1" = "--all-source" ]; then 66 echo ">>> Installing everything from source" 67 ./etc/install_all_source.sh 68 69 elif [ "Darwin" = "$SYSTEM" ]; then 70 # TODO: move build dependencies to the install build requirements step 71 ./etc/install_osx.sh 72 73 elif [ "Linux" = "$SYSTEM" ]; then 74 echo -e "\n\n>>> Calling install_from_bundle.sh script" 75 if ! ./etc/install_from_bundle.sh; then 76 echo -e ">>> Sorry <<< \n\ 77 Could not install from bundle. \n" 78 exit 1 79 fi 80 81 echo -e "\n\n>>> Done! Test your installation with ./test.sh" 82 fi 83 84 exit 0