Skip to content

Instantly share code, notes, and snippets.

@tyr0chen
Last active August 29, 2015 14:15
Show Gist options
  • Save tyr0chen/cd9a827fbc4ba8e24081 to your computer and use it in GitHub Desktop.
Save tyr0chen/cd9a827fbc4ba8e24081 to your computer and use it in GitHub Desktop.
This script will automatically install asciiauarium
#!/bin/bash
#description:auto-install scripts for asciiquarium.
#asciiquarm author is http://robobunny.com/wp/
#2014-11-22
#scripts writed by Tyr (http://tyr.so)
do_exit() {
cp $logfile $HOME/install_asciiquarium.log
rm $HOME/asciiquarium -rf
echo "
sorry install failed!
please refer to the $HOME/install_asciiquarium.log
"
exit 1
}
mkdir $HOME/asciiquarium
cd $HOME/asciiquarium
logfile="$HOME/asciiquarium/install.log"
echo "downloading source code ..."
if ! dpkg --list | grep libncurses5-dev
then
sudo apt-get update
sudo apt-get install libncurses5-dev -y
fi
wget http://download.chenhd.com/linux/asciiquarium.tar.gz >> $logfile 2>&1
wget http://download.chenhd.com/linux/Term-Animation-2.6.tar.gz >> $logfile 2>&1
wget http://download.chenhd.com/linux/Curses-1.32.tgz >> $logfile 2>&1
echo "decompressing tar file ..."
tar zxvf asciiquarium.tar.gz >> $logfile 2>&1
tar zxvf Term-Animation-2.6.tar.gz >> $logfile 2>&1
tar zxvf Curses-1.32.tgz >> $logfile 2>&1
cd Curses-1.32
echo "compiling modules,please waitting ..."
cp hints/c-linux.ncurses.h ../c-config.h
perl Makefile.PL |tee $logfile || do_exit
make |tee $logfile || do_exit
make install |tee $logfile || do_exit
cd ../Term-Animation-2.6
perl Makefile.PL |tee $logfile || do_exit
make |tee $logfile || do_exit
make test |tee $logfile || do_exit
make install |tee $logfile || do_exit
cd ..
cp asciiquarium_1.1/asciiquarium /usr/local/bin
chmod +x /usr/local/bin/asciiquarium
echo "cleaning temp file ..."
cd ..
rm asciiquarium -rf
echo "finished!
now you can run asciiquarium by the command asciiquarium
enjoy!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment