Advertisement
Guest User

Untitled

a guest
Sep 11th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.67 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Script for installing tmux on systems where you don't have root access.
  4. # tmux will be installed in $HOME/local/bin.
  5. # It's assumed that wget and a C/C++ compiler are installed.
  6.  
  7. # exit on error
  8. set -e
  9.  
  10. TMUX_VERSION=2.7
  11.  
  12. # create our directories
  13. mkdir -p $HOME/local $HOME/tmux_tmp
  14. cd $HOME/tmux_tmp
  15.  
  16. # download source files for tmux, libevent, and ncurses
  17. wget -O tmux-${TMUX_VERSION}.tar.gz https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz
  18. wget -O libevent-2.1.8-stable.tar.gz https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
  19. wget -O ncurses.tar.gz http://invisible-island.net/datafiles/release/ncurses.tar.gz
  20.  
  21. # extract files, configure, and compile
  22.  
  23. ############
  24. # libevent #
  25. ############
  26. tar xvzf libevent-2.1.8-stable.tar.gz
  27. cd libevent-2.1.8-stable
  28. ./configure --prefix=$HOME/local --disable-shared
  29. make
  30. make install
  31. cd ..
  32.  
  33. ############
  34. # ncurses  #
  35. ############
  36. tar xvzf ncurses.tar.gz
  37. cd ncurses-6.1
  38. ./configure --prefix=$HOME/local
  39. make
  40. make install
  41. cd ..
  42.  
  43. ############
  44. # tmux     #
  45. ############
  46. tar xvzf tmux-${TMUX_VERSION}.tar.gz
  47. cd tmux-${TMUX_VERSION}
  48. ./configure CFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include"
  49. CPPFLAGS="-I$HOME/local/include -I$HOME/local/include/ncurses" LDFLAGS="-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib" make
  50. cp tmux $HOME/local/bin
  51. cd ..
  52.  
  53. # cleanup
  54. rm -rf $HOME/tmux_tmp
  55.  
  56. echo "$HOME/local/bin/tmux is now available. You can optionally add $HOME/local/bin to your PATH."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement