Skip to content

Instantly share code, notes, and snippets.

@slack4u
Created May 18, 2014 13:22
Show Gist options
  • Save slack4u/8d316d92d448a8c4cc39 to your computer and use it in GitHub Desktop.
Save slack4u/8d316d92d448a8c4cc39 to your computer and use it in GitHub Desktop.
#!/bin/bash
# fork from https://community.webfaction.com/questions/8894/installing-mosh
# set up standard build environment
mkdir -p $HOME/src $HOME/tmp
export C_INCLUDE_PATH="$HOME/include:$C_INCLUDE_PATH"
export LIBRARY_PATH="$HOME/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
export CPPFLAGS="-I$HOME/include $CPPFLAGS"
export LDFLAGS="-L$HOME/lib $LDFLAGS"
export PKG_CONFIG_PATH="$HOME/lib/pkgconfig"
export PYTHON=python2.7
mkdir -p $HOME/lib/${PYTHON}
mkdir -p $HOME/lib/perl5
export PERL5LIB="$HOME/lib/perl5"
export CFLAGS="-O2 -pipe"
# fix lib64
if [ ! -L "$HOME/lib64" ]; then ln -s $HOME/lib $HOME/lib64; fi
###########################################################
# protobuf
###########################################################
cd $HOME/src
wget 'https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2'
tar -xjf protobuf-2.5.0.tar.bz2
cd protobuf-2.5.0
./configure --prefix=$HOME
make
#make install
paco -lD "make install"
###########################################################
# IO-Tty Perl module
###########################################################
cd $HOME/src
wget 'http://www.cpan.org/authors/id/R/RG/RGIERSIG/IO-Tty-1.08.tar.gz'
tar -xzf IO-Tty-1.08.tar.gz
cd IO-Tty-1.08
perl Makefile.PL PREFIX=$HOME
make
#make install
paco -lD "make install"
###########################################################
# mosh
###########################################################
cd $HOME/src
wget 'http://mosh.mit.edu/mosh-1.2.4.tar.gz'
tar -xzf mosh-1.2.4.tar.gz
cd mosh-1.2.4
./configure --prefix=$HOME
make
#make install
paco -lD "make install"
# make wrapper
cd $HOME/bin
mv mosh-server mosh-server.bin
cat << "EOF" > mosh-server
#!/bin/bash
export PATH="$HOME/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
exec $HOME/bin/mosh-server.bin $@
EOF
chmod 755 mosh-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment