Advertisement
vertrex

create_server.sh

Jan 28th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.38 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. root="/path/to"
  4.  
  5. if [ -z "$1" ]; then
  6.     echo -e "Usage:\t$0 <source>"
  7.     exit 1
  8. fi
  9.  
  10. src=$1
  11.  
  12. cd $root
  13.  
  14. if [ $src = "sty+ct" ]; then
  15.     source="0.2.8-armagetronad-sty+ct"
  16.     branch="lp:~armagetronad-ct/armagetronad/0.2.8-armagetronad-sty+ct"
  17.  
  18. elif [ $src = "sty+ct+ap" ]; then
  19.     source="0.2.9-armagetronad-sty+ct+ap"
  20.     branch="lp:~armagetronad-ap/armagetronad/0.2.9-armagetronad-sty+ct+ap"
  21. else
  22.     echo -x "Unrecognised source tag \""$src"\""
  23.     exit 1
  24. fi
  25.  
  26. saveto=$root
  27.  
  28. echo -e "Downloading "$src"..."
  29. rm -rf $source
  30. bzr branch $branch
  31. if [ $? -ne 0 ]; then
  32.     echo -e "Error while downloading."
  33.     exit 1
  34. fi
  35.  
  36. cd $root"/"$source
  37.  
  38. echo -e "Bootstrappng..."
  39. ./bootstrap.sh
  40. if [ $? -ne 0 ]; then
  41.     echo -e "Error while bootstrapping."
  42.     exit 1
  43. fi
  44.  
  45. echo -e "Configuring..."
  46. CXXFLAGS="-pipe" ./configure --enable-dedicated --enable-armathentication --disable-automakedefaults --disable-sysinstall --disable-useradd --disable-etc --disable-desktop --disable-initscripts --disable-uninstall --disable-games --prefix=$saveto
  47. if [ $? -ne 0 ]; then
  48.     echo -e "Error while configuring."
  49.     exit 1
  50. fi
  51.  
  52. echo -e "Compiling..."
  53. make
  54. if [ $? -ne 0 ]; then
  55.     echo -e "Error while compiling."
  56.     exit 1
  57. fi
  58.  
  59. echo -e "Installing..."
  60. make install
  61. if [ $? -ne 0 ]; then
  62.     echo -e "Error while installing."
  63.     exit 1
  64. fi
  65.  
  66. echo -e "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement