Advertisement
Guest User

Untitled

a guest
Jan 7th, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.34 KB | None | 0 0
  1. ###
  2. ### Functions to simplify stuff :)
  3. ###
  4. function() debianDeps {
  5. apt-get install git cmake build-essential liblua5.2-dev libgmp3-dev libmysqlclient-dev libboost-system-dev }
  6.    
  7. function() fedoraDeps {
  8. yum install git cmake gcc-c++ boost-devel gmp-devel community-mysql-devel lua-devel}
  9.    
  10. function() bsdDeps {
  11.     cd /usr/ports/shells/bash && make install clean BATCH=yes
  12.     cd /usr/ports/devel/git && make install clean BATCH=yes
  13.     cd /usr/ports/devel/cmake && make install clean BATCH=yes
  14.     cd /usr/ports/lang/gcc47 && make install clean BATCH=yes
  15.     cd /usr/ports/lang/luajit && make install clean BATCH=yes
  16.     cd /usr/ports/devel/boost-libs && make install clean BATCH=yes
  17.     cd /usr/ports/math/gmp && make install clean BATCH=yes
  18.     cd /usr/ports/databases/mysql-connector-c && make install clean BATCH=yes}
  19.  
  20. function() libInstall {
  21.     echo "Libraries and Build Tools... Installed"}
  22.  
  23. function() bsdBuild {
  24.     echo "Building on FreeBSD"
  25.     mkdir build && cd build
  26.     CXX=g++47 cmake ..
  27.     make}
  28.    
  29. function() genBuild {
  30.     echo "Building..."
  31.     mkdir build && cd build
  32.     cmake ..
  33.     make}
  34.    
  35. function() clean {
  36.     mv *.cpp *.h src/ && mv *.o objs/
  37.     echo "There might be a few leftover files."}
  38.    
  39. ###
  40. ### Script starts here
  41. ###
  42.  
  43. if [[ $EUID -ne 0 ]]; then
  44.     echo "You must be root to use this script, press enter to exit."
  45.     read end
  46.     exit 1
  47.  
  48.         echo "Chose your Operating System. {Supported OS: Debian, Ubuntu, Fedora, CentOS, FreeBSD} "
  49.             read ans1
  50.            
  51.                 if [ $ans1 = "Fedora" ] || [ $nas1 = "CentOS" ]; then
  52.                     echo -n "Should the script install dependencies? y/n"
  53.                         if [ $ans1_1 = "y" ]; then
  54.                             fedoraDeps
  55.                         elif [ $ans1_1 = "n" ]; then
  56.                             break
  57.                         else
  58.                             echo "Answer '\y\' or \'n\' "
  59.                         fi
  60.                 elif [ $ans1 = "Debian" || $ans1 = "Ubuntu" ]; then
  61.                     echo -n "Should the script install dependencies? y/n"
  62.                         if [ $ans1_1 = "y" ]; then
  63.                             debianDeps
  64.                         elif [ $ans1_1 = "n" ]; then
  65.                             break
  66.                         else
  67.                             echo "Answer '\y\' or \'n\' "
  68.                         fi
  69.                 elif [ $ans1 = "FreeBSD" ]; then
  70.                     echo -n "Should the script install dependencies? y/n"
  71.                         if [ $ans1_1 = "y" ]; then
  72.                             bsdDeps
  73.                         elif [ $ans1_1 = "n" ]; then
  74.                             break
  75.                         else
  76.                             echo "Answer '\y\' or \'n\' "
  77.                         fi
  78.                        
  79.                 else
  80.                     echo "Pick a valid OS"
  81.                    
  82.                 fi
  83.                 ## temporary fi
  84.                 fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement