diff --git a/README.md b/README.md index c6cdb45f..6b3daa3c 100644 --- a/README.md +++ b/README.md @@ -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` @@ -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 diff --git a/package-list-brew b/package-list-brew new file mode 100755 index 00000000..6531e481 --- /dev/null +++ b/package-list-brew @@ -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" diff --git a/package-list-dnf b/package-list-dnf new file mode 100755 index 00000000..209111fa --- /dev/null +++ b/package-list-dnf @@ -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" diff --git a/package-list-yum b/package-list-yum new file mode 100755 index 00000000..7f94d1ee --- /dev/null +++ b/package-list-yum @@ -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" diff --git a/setup.sh b/setup.sh index 6dab3fa9..e65e5069 100755 --- a/setup.sh +++ b/setup.sh @@ -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