Advertisement
albertmatyi

install lib-svn 1.7

Dec 20th, 2011
3,530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.64 KB | None | 0 0
  1. #!/bin/bash +x
  2. # WANdisco Subversion Installer V0.1
  3.  
  4. echo 'WANdisco Subversion Installer v0.1 for Ubuntu 9.10, 10.04, 10.10'
  5. echo 'Please report problems and bugs to [email protected]'
  6. echo
  7. echo 'Gathering some information about your system…'
  8.  
  9. MINVERSION='1'
  10. SVNVER='1.7.0'
  11. ARCH=`uname -m`
  12. SVNSTATUS=`dpkg -l|grep " libsvn1 " | awk '{print $1}'`
  13.  
  14. #functions
  15. check_is_root ()
  16. {
  17. if [[ $EUID -ne 0 ]]; then
  18. echo "This script must be run as root" 1>&2
  19. exit 1
  20. fi
  21. }
  22. svn_remove_old ()
  23. {
  24. echo Removing old packages…
  25. apt-get -y remove libsvn1 subversion libapache2-svn libsvn-dev libsvn-doc libsvn-perl subversion-tools
  26. }
  27. add_repo_config ()
  28. {
  29. echo Adding repository configuration to /etc/apt/sources.list.d/
  30. if [ -f /etc/apt/sources.list.d/WANdisco.list ]; then
  31. rm /etc/apt/sources.list.d/WANdisco.list
  32. fi
  33. echo "Installing Apt repo…."
  34. echo "# WANdisco Open Source Repo" > /etc/apt/sources.list.d/WANdisco.list
  35. echo "deb http://opensource.wandisco.com/ubuntu lucid svn17" >> /etc/apt/sources.list.d/WANdisco.list
  36. echo "Importing GPG key"
  37. wget http://opensource.wandisco.com/wandisco-debian.gpg -O /tmp/wandisco-debian.gpg &>/dev/null
  38. apt-key add /tmp/wandisco-debian.gpg
  39. rm -rf /tmp/wandisco-debian.gpg
  40. apt-get update
  41. }
  42. install_svn ()
  43. {
  44. echo Checking to see if you already have Subversion installed via dpkg
  45. if [ "$SVNSTATUS" == "ii" ]; then
  46. echo
  47. echo Subversion is already installed on the system.
  48. echo Do you wish to replace the version of subversion currently installed with the WANdisco version?
  49. echo This action will remove the previous version from your system
  50. echo \[y/n\]:
  51. read svn_install_confirm
  52. if [ "$svn_install_confirm" == "y" -o "$svn_install_confirm" == "Y" ]; then
  53. svn_remove_old
  54. add_repo_config
  55. echo
  56. echo Installing Subversion $SVNVER-$MINVERSION
  57. echo
  58. apt-get -y -force=yes install subversion libsvn-perl subversion-tools libsvn-java
  59. echo Would you like to install apache and the apache SVN modules? \[y/n\]
  60. read dav_svn_confirm
  61. if [ "$dav_svn_confirm" == "y" -o "$dav_svn_confirm" == "Y" ]; then
  62. echo Installing apache and subversion modules
  63. apt-get -y -force=yes install apache2 libapache2-svn
  64. echo Installation complete. Restart apache? \[y/n\]
  65. read apache_restart_confirm
  66. if [ $apache_restart_confirm == "y" -o $apache_restart_confirm == "Y" ]; then
  67. /etc/init.d/apache2 restart
  68. fi
  69. fi
  70.  
  71. else
  72. echo "Install Cancelled"
  73. exit 1
  74. fi
  75.  
  76. else
  77. # Install SVN
  78. echo "Subversion is not currently installed"
  79. echo "Starting installation, are you sure you wish to continue? [y/n]"
  80. read svn_install_confirm
  81. if [ "$svn_install_confirm" == "y" -o "$svn_install_confirm" == "Y" ]; then
  82. add_repo_config
  83. echo
  84. echo Installing Subversion $SVNVER-$MINVERSION
  85. echo
  86. apt-get -y -force=yes install subversion libsvn-perl subversion-tools
  87. echo Would you like to install apache and the apache SVN modules? \[y/n\]
  88. read dav_svn_confirm
  89. if [ "$dav_svn_confirm" == "y" -o "$dav_svn_confirm" == "Y" ]; then
  90. echo Installing apache and subversion modules
  91. apt-get -y -force=yes install apache2 libapache2-svn libsvn-dev
  92. echo Installation complete. Restart apache? \[y/n\]
  93. read apache_restart_confirm
  94. if [ $apache_restart_confirm == "y" -o $apache_restart_confirm == "Y" ]; then
  95. /etc/init.d/apache2 restart
  96. fi
  97. fi
  98.  
  99. else
  100. echo "Install Cancelled"
  101. exit 1
  102. fi
  103.  
  104. fi
  105.  
  106. }
  107.  
  108. install_32 ()
  109. {
  110. echo Installing for $ARCH
  111. install_svn
  112. }
  113. install_64 ()
  114. {
  115. echo Installing for $ARCH
  116. install_svn
  117. }
  118.  
  119. #Main
  120. check_is_root
  121.  
  122. echo Checking your system arch
  123. if [ "$ARCH" == "i686" -o "$ARCH" == "i386" ]; then
  124. install_32
  125. elif [ "$ARCH" == "x86_64" ];
  126. then
  127. install_64
  128. else
  129. echo Unsupported platform: $ARCH
  130. exit 1
  131. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement