#!/bin/bash if [ "`file distfiles | grep directory`" != "distfiles: directory" ]; then echo echo "There's no 'distfiles' directory here. I'm creating one..." mkdir -v distfiles echo sleep 1 fi cd distfiles if [ ! -n "$1" ]; then echo "Usage: $0 " exit else export _FILENAME=`basename $1` wget -c $1 --passive && cd .. if [ "`echo $1 | grep -o .tar.bz2`" == ".tar.bz2" ]; then tar -jxvf distfiles/$_FILENAME elif [ "`echo $1 | grep -o .tar.gz`" == ".tar.gz" ]; then tar -zxvf distfiles/$_FILENAME else echo error: .tar.bz2 and .tar.gz support only. fi export _D=1 while [ -z "`echo $_FILENAME | cut -d "." -f $_D | grep tar`" ] do export _DIRNAME=$_DIRNAME`echo -n $_FILENAME | cut -d "." -f $_D` export _D=$((_D + 1)) if [ "`echo $_FILENAME | cut -d "." -f $_D | grep tar`" != "tar" ]; then export _DIRNAME=$_DIRNAME. fi done fi cd `echo $_DIRNAME` && ./configure && make && echo echo Enter your root password to install this package. echo su -c "make install"