Skip to content

Commit

Permalink
Add arch
Browse files Browse the repository at this point in the history
  • Loading branch information
thebugcatcher committed May 7, 2018
1 parent cf92c1b commit 1cb1181
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 192 deletions.
183 changes: 2 additions & 181 deletions adify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ OS is $OS.. Adify is supported for $OS! :)
echo """
OS is $OS.. Adify is supported for $OS! :)
"""
source "./linux/centos.sh"
source ".os/linux/centos.sh"
;;
"\"Fedora\"")
echo """
Expand All @@ -60,7 +60,7 @@ OS is $OS.. Adify is supported for $OS! :)
echo """
OS is $OS.. Adify is supported for $OS! :)
"""
source "./linux/arch.sh"
source ".os/linux/arch.sh"
;;
esac

Expand Down Expand Up @@ -103,182 +103,3 @@ OS is AIX.. Adify isn't supported for AIX.
;;
esac


echo """
==========================================================
Detecting Shell type.........
==========================================================
"""
case $SHELL in
"/bin/zsh")
shell="zsh"
echo """
Shell is $shell.. Adify is supported for $shell! :)
"""
;;
"/bin/bash")
shell="bash"
echo """
Shell is $shell.. Adify is supported for $shell! :)
"""
;;
esac

### CURL ###
# Install curl, as it's an important tool!!
echo """
==========================================================
Installing Curl.. Can't live without that!
==========================================================
"""
$pm install -y curl


### GIT ###
# Running all three package manager commands.
echo """
==========================================================
Installing Git to get adify.
==========================================================
"""
$pm install -y git

ex_version="1.5.2"
otp_version="20.2"
asdf_version="0.4.0"

if [ ! -d "$HOME/adify" ]; then
echo """
==========================================================
Adifying for the first time....
This script is responsible for running all the commands required to setup an ubuntu computer
for me to work effectively. Hence, it adifies the computer.
This script doesn't include the tools required to do 'work' elated stuff by default
==========================================================
"""

echo """
==========================================================
Fetching Adifying files...
==========================================================
"""
git clone --depth=1 https://github.com/aditya7iyengar/adify.git "$HOME/adify"

cd "$HOME/adify"
[ "$1" = "ask" ] && export ADIFYASK="true"
[ "$1" = "work" ] && export ADIFYWORK="true"


echo """
==========================================================
Installing Asdf $asdf_version for Elixir and Erlang...
==========================================================
"""
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v${asdf_version}

case $OS in
'Mac')
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.${shell}rc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.${shell}rc
source ~/.${shell}rc
;;
"\"Ubuntu\"")
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.${shell}rc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.${shell}rc
source ~/.${shell}rc
;;
"\"Centos\"")
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.${shell}rc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.${shell}rc
source ~/.${shell}rc
;;
esac

chmod 777 $HOME/.asdf/asdf.sh
chmod 777 $HOME/.asdf/completions/asdf.bash

. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash

echo """
==========================================================
Preparing to install ERLANG $otp_version.
Installing dependencies for ERLANG $otp_version....
==========================================================
"""
case $OS in
'Mac')
xcode-select --install
$pm install wxmac
;;
"\"Ubuntu\"")
$pm -y install build-essential git wget libssl-dev libreadline-dev \
libncurses5-dev zlib1g-dev m4 curl wx-common libwxgtk3.0-dev autoconf \
openjdk-8-jdk fop xsltproc
;;
"\"Centos\"")
$pm -y install libwxgtk3.0-dev libgl1-mesa-dev libglu1-mesa-dev libpng3
$pm -y install build-essential
$pm -y install autoconf
$pm -y install m4
$pm -y install libncurses5-dev
$pm -y install openjdk-9-jdk fop xsltproc
;;
esac
$pm -y install libssh-dev
$pm -y install unixodbc-dev


echo """
==========================================================
Installing ERLANG $otp_version to run Adifier app....
==========================================================
"""
case $OS in
"\"Ubuntu\"")
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y erlang
;;
*)
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang ${otp_version}
esac

echo """
==========================================================
Installing ELIXIR $ex_version to run Adifier app....
==========================================================
"""
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir ${ex_version}

case $OS in
"\"Ubuntu\"")
echo """
==========================================================
Installing askpass ofr Linux machines
==========================================================
"""
$pm -y install ssh-askpass
;;
esac
echo """
==========================================================
Running Adifier... (mix adify)
==========================================================
"""
cd adifier
mix deps.get
mix compile
mix adify
else
echo """
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The system is already Adified.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
"""
fi

122 changes: 122 additions & 0 deletions os/linux/arch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#!/usr/bin/env bash

### ABOUT ###
# CentOS version of the adify script


echo """
==============================================================================
Installing tools for Arch....
==============================================================================
"""
pm="sudo pacman"

echo """
==========================================================
Detecting Shell type.........
==========================================================
"""
case $SHELL in
"/bin/zsh")
shell="zsh"
echo """
Shell is $shell.. Adify is supported for $shell! :)
"""
;;
"/bin/bash")
shell="bash"
echo """
Shell is $shell.. Adify is supported for $shell! :)
"""
;;
esac

ex_version="1.6.3"
otp_version="20.3"
asdf_version="0.4.2"

if [ ! -d "$HOME/adify" ]; then
echo """
==========================================================
Adifying for the first time....
==========================================================
"""

echo """
==========================================================
Installing Asdf $asdf_version for Elixir and Erlang...
==========================================================
"""
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v${asdf_version}

case $OS in
'Mac')
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.${shell}rc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.${shell}rc
source ~/.${shell}rc
;;
"\"Ubuntu\"")
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.${shell}rc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.${shell}rc
source ~/.${shell}rc
;;
"\"Centos\"")
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.${shell}rc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.${shell}rc
source ~/.${shell}rc
;;
esac

chmod 777 $HOME/.asdf/asdf.sh
chmod 777 $HOME/.asdf/completions/asdf.bash

. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash

echo """
==========================================================
Preparing to install ERLANG $otp_version.
Installing dependencies for ERLANG $otp_version....
==========================================================
"""
$pm -S libwxgtk3.0-dev libgl1-mesa-dev libglu1-mesa-dev libpng3 --noconfirm
$pm -S build-essential --noconfirm
$pm -S autoconf --noconfirm
$pm -S m4 --noconfirm
$pm -S libncurses5-de --noconfirmv
$pm -S openjdk-9-jdk fop xsltproc --noconfirm
$pm -S libssh-dev --noconfirm
$pm -S unixodbc-dev --noconfirm

echo """
==========================================================
Installing ERLANG $otp_version to run Adifier app....
==========================================================
"""
asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang ${otp_version}

echo """
==========================================================
Installing ELIXIR $ex_version to run Adifier app....
==========================================================
"""
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir ${ex_version}

echo """
==========================================================
Running Adifier... (mix adify)
==========================================================
"""
cd adifier
mix deps.get
mix compile
mix adify
else
echo """
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The system is already Adified.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
"""
fi
11 changes: 0 additions & 11 deletions os/linux/centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ Adifying for the first time....

echo """
==========================================================
Fetching Adifying files...
==========================================================
"""
git clone --depth=1 https://github.com/aditya7iyengar/adify.git "$HOME/adify"

cd "$HOME/adify"
[ "$1" = "ask" ] && export ADIFYASK="true"
[ "$1" = "work" ] && export ADIFYWORK="true"

echo """
==========================================================
Installing Asdf $asdf_version for Elixir and Erlang...
==========================================================
"""
Expand Down

0 comments on commit 1cb1181

Please sign in to comment.