Skip to content

Commit

Permalink
Merge pull request #715 from kmehant/common-setup-script
Browse files Browse the repository at this point in the history
Common setup shell script for linux distros and MacOS
  • Loading branch information
vivonk authored Apr 1, 2019
2 parents 4e74549 + 8e73941 commit bafe0d8
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 21 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Bassa solves the problem of wasting internet bandwidth by queuing a download if

Note:
* Windows users can check the installation guide [here](https://github.com/scorelab/Bassa/wiki/Windows-Installation-Guide).
* MacOS users can check the installation guide [here](https://github.com/scorelab/Bassa/wiki/MacOS-Installation-Guide).


First clone the Repository
`git clone https://github.com/scorelab/Bassa.git`
Expand All @@ -42,7 +40,7 @@ First clone the Repository
Use python 3 instead of Python 2

```
$ ./setup.sh
$ sudo ./setup.sh
$ cd components/core/
$ sudo python3 setup.py develop
Expand Down
31 changes: 31 additions & 0 deletions package-list-brew
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

echo "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Homebrew Installed"

echo "Installing python3 and pip"
brew install python3
echo "python3 and pip Installed"

echo "Installing Aria2"
brew install aria2
echo "Aria2 Installed"

echo "Installing and starting MySQL"
brew install mysql
brew services start mysql
echo "MySQL Installed and Started"

echo "Installing Node"
brew install node
echo "Node Installed"

echo "Installing Bower"
npm install -g bower
echo "Bower Installed"

echo "Installing Gulp"
npm install -g gulp
npm install -g gulp-cli
echo "Gulp Installed"
47 changes: 47 additions & 0 deletions package-list-dnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

echo "Installing pip"
dnf install python-pip #Python 2
dnf install python3 #Python 3
echo "pip installed"

echo "Upgrading setuptools"
dnf upgrade python-setuptools
echo "setuptools upgraded"

echo "Installing Aria2"
yum install aria2
echo "Aria2 installed"

echo "Installing mysql-server"
## Fedora 29 ##
dnf install https://dev.mysql.com/get/mysql80-community-release-fc29-1.noarch.rpm
# choose accordingly
## Fedora 28 ##
#dnf install https://dev.mysql.com/get/mysql80-community-release-fc28-1.noarch.rpm

## Fedora 27 ##
#dnf install https://dev.mysql.com/get/mysql80-community-release-fc27-1.noarch.rpm

dnf install mysql-community-server
systemctl start mysqld.service ## use restart after update
systemctl enable mysqld.service
echo "mysql-server installed"

echo "Installing libmysqlclient"
yum install mysql-devel
echo "libmysqlclient installed"

echo "Installing node"
dnf install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
dnf install nodejs
echo "NodeJS installed"

echo "Installing bower globally"
npm install -g bower
echo "bower installed"

echo "Installing gulp globally"
npm install -g gulp
echo "gulp installed"
58 changes: 58 additions & 0 deletions package-list-yum
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# Documented for centOS 7
# Updating yum
echo "Setting up yum"
yum -y update
yum -y install yum-utils
yum -y groupinstall development
echo "yum is ready"

#Installing Python
echo "Installing Python"
yum install centos-release-scl
yum install rh-python36
scl enable rh-python36 bash
python --version
echo "Python successfully installed"

#Installing pip
echo "Installing pip"
yum install epel-release -y
yum install python-pip
echo "pip successfully installed"

#Installing setup tools
echo "Installing setuptools"
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-1.1.6.tar.gz --no-check-certificate
tar xf setuptools-1.1.6.tar.gz
cd setuptools-1.1.6
python3.3 setup.py install
echo "setuptools installed"

echo "Installing Aria2"
yum --enablerepo=rpmforge install aria2 -y
echo "Aria2 installed"

echo "Installing mysql-server"
rpm -ivh https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
yum install mysql-server -y
echo "mysql-server installed"

echo "Installing libmysqlclient"
yum install mysql-devel -y
echo "libmysqlclient installed"

echo "Installing node"
yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -
yum install nodejs
echo "NodeJS installed"

echo "Installing bower globally"
npm install -g bower
echo "bower installed"

echo "Installing gulp globally"
npm install -g gulp
echo "gulp installed"
60 changes: 42 additions & 18 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
#!/bin/sh

YUM=$(which yum)
DNF=$(which dnf)
APT_GET=$(which apt-get)
PACMAN=$(which pacman)
BREW=$(which brew)

# Variable for package manager used by the user
PACKAGE_MANAGER="package_manager"

if ! [ $(id -u) = 0 ]; then
printf "Please run as root to proceed with installations... \n1. Type in: su\n2. Enter your password\n3. Execute: sh setup.sh\n"
printf "Please run as root to proceed with installations... \n1. Type in: su\n2. Enter your password\n3. Execute: sh setup.sh\n"

else
echo "Starting Installation..."

echo "Finding the package manager"
APT_GET_CMD=$(which apt-get)
PACMAN_CMD=$(which pacman)

if [ ! -z $APT_GET_CMD ]; then
echo -e "apt-get found\n"
./package-list-aptget

elif [ ! -z $PACMAN_CMD ]; then
echo -e "pacman found\n"
./package-list-pacman
else
echo "Please manually install packages in package-list-aptget file"
exit 1;
fi
echo "Starting dependency installation..."
echo "Finding the package manager"

if [ ! -z $APT_GET ]; then
echo -e "apt-get found\n"
PACKAGE_MANAGER="apt-get"
./package-list-aptget

elif [ ! -z $PACMAN ]; then
echo -e "pacman found\n"
PACKAGE_MANAGER="pacman"
./package-list-pacman

elif [ ! -z $DNF ]; then
echo -e "dnf found\n"
PACKAGE_MANAGER="dnf"
./package-list-dnf

elif [ ! -z $YUM ]; then
echo -e "yum found\n"
PACKAGE_MANAGER="yum"
./package-list-yum

elif [ ! -z $BREW ]; then
echo -e "brew found\n"
PACKAGE_MANAGER="brew"
./package-list-brew

else
echo "Please manually install packages in package-list-$PACKAGE_MANAGER file"
exit 1
fi
fi

0 comments on commit bafe0d8

Please sign in to comment.