#!/bin/bash debian=false; arch=false; mac=false; # get operating system os_info() { declare -A osInfo; osInfo[/etc/arch-release]=arch osInfo[/etc/debian_version]=debian osInfo[/usr/local/Homebrew]=mac for f in ${!osInfo[@]} do if [[ -f $f ]];then if [[ ${osInfo[$f]} == 'arch' ]]; then arch=true; elif [[ ${osInfo[$f]} == 'debian' ]]; then debian=true; elif [[ ${osInfo[$f]} == 'mac' ]]; then mac=true; fi fi done } # installing package, $1 = pacman; $2 = apt-get, $3 = homebrew install() { if [ $debian == true ] && [ $2 != 'null' ]; then sudo apt-get install $2 elif [ $arch == true ] && [ $1 != 'null' ]; then sudo pacman -S $1 elif [ $mac == true ] && [ $3 != 'null' ]; then sudo brew install $3 fi } os_info install 'clang' 'clang' 'clang' install 'make' 'make' 'make' install 'cmake' 'cmake' 'cmake' install 'null' 'clang-tidy' 'clang-tidy' install 'fltk' 'libfltk1.3 libfltk1.3-dev' 'fltk' install 'catch2' 'null' 'catch2' if [[ $apt ]]; then git clone https://github.com/catchorg/Catch2.git cd Catch2 cmake -Bbuild -H. -DBUILD_TESTING=OFF sudo cmake --build build/ --target install fi echo "cloning repositories" cd .. git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/library.git mkdir library/build git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/shared-memory.git mkdir shared-memory/build git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/text-renderer.git mkdir text-renderer/build git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/gui.git mkdir gui/build git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/terminal.git mkdir terminal/build git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/simple-draw.git mkdir simple-draw/build git clone ssh://git@gitlab.repo.digitech.hs-emden-leer.de:2222/link/projekte/ws19/vkvm-new/demo.git mkdir demo/build cd Scripts echo "installation completed" ./build.sh