Skip to content

Instantly share code, notes, and snippets.

@blackskye-sx
Forked from todgru/_readme.md
Last active March 18, 2020 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackskye-sx/2c107ba92ff6ddf892bdcf992d4bf677 to your computer and use it in GitHub Desktop.
Save blackskye-sx/2c107ba92ff6ddf892bdcf992d4bf677 to your computer and use it in GitHub Desktop.
Installing Tmux on Dreamhost tmux dreamhost
#!/bin/bash
# Based on this: http://blennd.com/post/the-pains-of-installing-tmux-on-a-shared-server/
# Script forked from https://gist.github.com/shime/5706655/
# Forked from https://gist.github.com/todgru/7854665
# Script for installing tmux and dependencies.
# tmux will be executable from ~/local/lib.
# Prerequisites: - gcc
# - wget
# define versions
tmux_version="3.0a"
libevent_version="2.0.21"
tmux_name="tmux-$tmux_version"
libevent_name="libevent-$libevent_version-stable"
# set the installation directory
target_dir="~/local/bin"
# Create working directories
mkdir -p ~/local
mkdir -p ~/temp
# download source files for tmux, libevent
# save them in ~/temp
cd ~/temp
#https://github.com/tmux/tmux/releases/download/3.0a/tmux-3.0a.tar.gz
wget -O $tmux_name.tar.gz https://github.com/tmux/tmux/releases/download/$tmux_version/$tmux_name.tar.gz
wget -O $libevent_name.tar.gz https://github.com/downloads/libevent/libevent/$libevent_name.tar.gz
# extract files, configure, and compile
# libevent installation
tar xvzf $libevent_name.tar.gz
cd $libevent_name
./configure --prefix=$HOME/local
make
make install
cd -
# tmux installation
tar xvzf $tmux_name.tar.gz
cd $tmux_name
DIR="$HOME/local"
./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib"
make
cp tmux $target_dir
cd -
# Add path to .bashrc
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH="$HOME/local/lib"' >> ~/.bashrc
cd ~
source ~/.bashrc
echo
echo "//////////////////////////////////////////////////////////"
echo "Post installation message:"
echo "----------------------------------------------------------"
echo "Installed tmux v$tmux_version with success! \o/"
echo
echo "Hit 'tmux -V' to make sure you're using the right version."
echo "//////////////////////////////////////////////////////////"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment