Created
March 20, 2019 05:36
-
-
Save jimyang2008/c688c0369f161303a981af693c4d6dc3 to your computer and use it in GitHub Desktop.
install tmux script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
FTP_BASE='ftp://ftp.yangjian.net/pub' | |
LIBEVENT=libevent-2.1.8-stable | |
NCURSES=ncurses | |
TMUX=tmux-2.6 | |
OPT_DIR=$HOME/opt | |
build() { | |
case $1 in | |
ncurses*) | |
./configure --prefix=$OPT_DIR --with-shared \ | |
&& make && make install | |
;; | |
tmux*) | |
./configure --prefix=$OPT_DIR \ | |
CFLAGS="-I$OPT_DIR/include -I$OPT_DIR/include/ncurses" \ | |
LDFLAGS="-L$OPT_DIR/lib" \ | |
&& make && make install | |
;; | |
*) | |
./configure --prefix=$OPT_DIR && make && make install | |
;; | |
esac | |
} | |
deb() { | |
s=$1 | |
test -e ${s}.tar.gz || curl -LOk $FTP_BASE/${s}.tar.gz | |
test -d ${s}* || tar -xzf ${s}.tar.gz | |
( cd ${s}*; build $s ) | |
} | |
deb $LIBEVENT | |
deb $NCURSES | |
deb $TMUX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment