Advertisement
MrTorchon

install_bitchx.sh

Sep 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.74 KB | None | 0 0
  1. #!/bin/sh
  2. ####################################################################################
  3. #
  4. # Download Compile and Install BitchX on Ubuntu
  5. #
  6. ####################################################################################
  7.  
  8. # download bitchx source
  9.  
  10. # @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)
  11. DOWNLOAD_URL=$(curl -s http://bitchx.sourceforge.net |\
  12.         grep "http://sourceforge.net" |\
  13.          sed -e "s|.*href=\"||g" |\
  14.          sed -e "s|\".*||g" |\
  15.          grep "/download" | uniq) # should only be one
  16.  
  17. if [ "${DOWNLOAD_URL}" = "" ]; then
  18.   echo "ERROR: Could not find DOWNLOAD_URL from http://bitchx.sourceforge.net"
  19.   exit 255;
  20. fi
  21.  
  22. # @todo make smarter, i.e. regexp, though now uses _always_ available commands (sic)
  23. VERSION=$(echo ${DOWNLOAD_URL} | sed -e "s|.*ircii-pana/bitchx-||g" | sed -e "s|\/.*||g")
  24.  
  25. if [ "${VERSION}" = "" ]; then
  26.   echo "ERROR: Could not find VERSION from ${DOWNLOAD_URL}"
  27.   exit 255;
  28. fi
  29.  
  30. echo "Will try to download and install version ${VERSION}";
  31.  
  32. DOWNLOAD_URL=http://downloads.sourceforge.net/project/bitchx/ircii-pana/bitchx-${VERSION}/bitchx-${VERSION}.tar.gz
  33.  
  34. echo "Downloading: ${DOWNLOAD_URL}"
  35. curl -L -s "${DOWNLOAD_URL}" -o bitchx-${VERSION}.tar.gz
  36.  
  37. # install required dev libraries
  38. sudo apt-get install libssl-dev ncurses-dev
  39.  
  40. # unpack source
  41. tar -xzf bitchx-${VERSION}.tar.gz
  42.  
  43. # go to source dir
  44. cd bitchx-${VERSION}
  45.  
  46. # configure
  47. ./configure --prefix=/usr --with-ssl --with-plugins --enable-ipv6
  48.  
  49. # build
  50. make
  51.  
  52. # install (change to "make install_local" for local installation; in your own $HOME)
  53. sudo make install
  54.  
  55. # remove src + build
  56. cd $OLDPWD && rm -rf bitchx-${VERSION}*
  57.  
  58. # done use "BitchX" to run...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement