Skip to content

Commit

Permalink
added binary installer
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbarth committed Dec 20, 2012
1 parent e0768af commit c91b88c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
27 changes: 25 additions & 2 deletions lib/common/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,46 @@ package_install()
eval "yum install -y $@"
}

# Adds an executable path to the bashrc.
#
# $1 - A path containing executables.
exec_path()
{
$exec_path=$1
echo "PATH=$PATH:$exec_path" >> ~/.bashrc
echo "export" >> ~/.bashrc
}

# Makes application from source.
#
# path - Directory to cd; make too.
# url - URL of tarball package.
# config (optional) - Configuration flags for configure.
source_install()
{
path=$1; url=$2; config=$3
name=$1; url=$2; config=$3
wget $url -O temp.tar.gz
tar xzvf temp.tar.gz -C /etc/
rm -f temp.tar.gz
cd "/etc/$path"
cd "/etc/$name"
./configure $config
make; make install
cd $DIRECTORY
}

# Installs an application using its binaries.
#
# path - Directory to cd; make too.
# url - URL of tarball package.
source_install()
{
name=$1; url=$2
wget $url -O temp.tar.gz
tar xzvf temp.tar.gz -C /etc/
rm -f temp.tar.gz
exec_path "/etc/$name/bin"
}

# Runs a includes scripts in package subdirectories and runs them.
#
# $1 - Name of current folder.
Expand Down
2 changes: 1 addition & 1 deletion lib/common/install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Common Installer
common_install()
{
dependency_install 'common' 'hostname' 'setup' 'packages'
dependency_install 'common' 'setup' 'packages'
}

0 comments on commit c91b88c

Please sign in to comment.