From 338549e6f5cef43de3695e3a0049fc5c96b3c4e0 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Thu, 10 Dec 2020 21:50:09 +0100 Subject: [PATCH 1/5] Minor improvements --- _posts/2020-09-20-Linux-Install-Script.md | 140 ++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 _posts/2020-09-20-Linux-Install-Script.md diff --git a/_posts/2020-09-20-Linux-Install-Script.md b/_posts/2020-09-20-Linux-Install-Script.md new file mode 100644 index 000000000..aa48796f0 --- /dev/null +++ b/_posts/2020-09-20-Linux-Install-Script.md @@ -0,0 +1,140 @@ +--- +layout: post +title: "Linux Bash Installation Script" +heading: "Bash Installation Script" +author: "niebert" +lang: "en" +--- + +If you plan to be installing Jamulus on many Linux machines, you may want to try this script. + + +The following example was tested on Linux Mint and combines all the needed steps in one script for Ubuntu/Linux Mint. To incorporate the different command for different Linux distributions, variables define the distribution and the release for which the installation should be performed. This example focuses on Ubuntu release 18.04. The suggested script name for the release is e.g. `install4ubuntu18_4.sh`. The script commands are generic so that the installation could also be modified so that they work on other Linux distributions. + +### Installation dependent on Linux Distribution +The following script calls different installation commands dependent on the Linux distribution. +The variable `DISTRO` defines which commands are executed. Set the variable dependent on your Linux distribution you are using e.g. +* `DISTRO="Ubuntu` for Ubuntu or Linux Mint +* `DISTRO="Debian` for Debian or Raspbian Linux +* `DISTRO="Fedora` for Fedora +Furthermore if the installation is dependent on the release, the variable `LINVERSION` is introduced but currently not used. In Ubuntu the if statement is an example how version dependent installation calls can be performed: +```bash +if [ "$LINVERSION" = "18.4" ] +then + echo "Perform Installation Specifics for $DISTRO Version $DISTRO" +fi +``` +The variable `LINVERSION` is currently not used and just a demo how to use the version specific installation commands. + +### Adaptation of the Installation Script +If you want to create an installation script for Debian just copy the script `install4ubuntu18_4.sh` to `install4debian10_6.sh` and modify the distro variables to +```bash +#!/bin/sh +# set DISTRO either to "Ubuntu", "Debian" or "Fedora" +DISTRO="Debian" +LINVERSION="10.6" +``` +After that, test the installation on Debian and modify the commands so that the installation script works on Debian. You can share working installation scripts in this Wiki. The maintainer of the Jamulus Repository might add a folder in the repository `/install_scripts` for working installation scripts. Create a pull request for new installation scripts or create an issue with a request to add a documented and tested installation script. + +### The Installation Script +Copy the following installation script into a file and save it to the filename `install4ubuntu18_4.sh`. After saving the file e.g. in your `Download` directory change to the directory (`cd`) and call the following script with `sh install4ubuntu18_4.sh`. +```bash +#!/bin/sh +# set DISTRO either to "Ubuntu", "Debian" or "Fedora" +DISTRO="Ubuntu" +LINVERSION="18.04" + +# Get Jamulus Release Name with "curl" and "grep" +R=`curl -s https://api.github.com/repos/corrados/jamulus/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")'` +echo "Jamulus Installation Script for $DISTRO $LINVERSION" +echo "Release: $R" +INSTALLJAMULUS="no" +while true; do + read -p "Do you wish to install Jamulus on $DISTRO $LINVERSION? (y/n) " yn + case $yn in + [Yy]* ) + echo "Start Installation $DISTRO $LINVERSION" + echo "(1) Fetch Release $R from GitHub" + wget https://github.com/corrados/jamulus/archive/$R.tar.gz + echo "(2) Extract Source Code for Jamulus Release $R from GitHub" + tar -xvf $R.tar.gz + echo "(3) Delete ${R}.tar.gz from GitHub" + rm $R.tar.gz + echo "(4) Update Repository" + sudo apt-get update + INSTALLJAMULUS="yes" + break;; + [Nn]* ) + echo "Cancelled Jamulus Installation on $DISTRO $LINVERSION" + exit;; + * ) echo "Please answer yes or no.";; + esac +done + +# echo "Check Variable: $INSTALLJAMULUS" + +if [ "$INSTALLJAMULUS" = "yes" ]; then + echo "(5) Install Build Essentials for $DISTRO" + + if [ "$DISTRO" = "Ubuntu" ] + then + echo "Installation for $DISTRO" + sudo apt-get install cmake qmake gcc g++ + sudo apt-get install build-essential qt5-qmake qtdeclarative5-dev qt5-default qttools5-dev-tools libjack-jackd2-dev + sudo apt-get install qjackctl + if [ "$LINVERSION" = "18.4" ] + then + echo "Perform Installation Specifics for $DISTRO Version $DISTRO" + fi + + elif [ "$DISTRO" = "Debian" ] + then + sudo apt-get install build-essential qtdeclarative5-dev qt5-default qttools5-dev-tools libjack-jackd2-dev + sudo apt-get install qjackctl + elif [ "$DISTRO" = "Fedora" ] + then + sudo dnf install qt5-qtdeclarative-devel jack-audio-connection-kit-dbus jack-audio-connection-kit-devel + sudo dnf install qjackctl + fi + + echo "(6) Compile Jamulus $R" + echo "Change to Directory jamulus-$R" + cd "jamulus-$R" + # ls + qmake Jamulus.pro + make clean + make + sudo make install + echo "Compilation DONE" + cd .. + echo "(6) Delete the Source Files after Installation" + rm -R "jamulus-$R" + +else + + echo "Installation cancelled" + +fi + +``` + + +## Possible Improvements of the Installation Script for Jamulus +This script checks in the very beginning for which linux distribution the installation should be called. +This can be tested with the command `lsb_release` + +With the `lsb_release` command the command returns the distribution specific information about a Linux distro. +With a `grep` command with regular expression the variable `DISTRO` and `LINVERSION`. +E.g. the Ubuntu based systems return with the command the following information. +```bash +$ lsb_release -a +No LSB modules are available. +Distributor ID: Ubuntu +Description: Ubuntu 11.04 +Release: 11.04 +Codename: natty +``` + +The challenge is, that `lsb_release` command must be available on your Linux system. On CentOS/Fedora based systems `lsb_release` command is only available, if the `lsb` core packages are installed. So the automated Linux version detected might no work. + +Reading the `DISTRO` and `LINVERION` with the `read` command might be the better distribution dependent improvement than an automated setting with `lsb_release`. From 137597c6c2efee7b005a9cedc224740c37fddbb7 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Thu, 10 Dec 2020 22:08:47 +0100 Subject: [PATCH 2/5] Use @trebmuh changes --- _posts/2020-09-20-Linux-Install-Script.md | 30 ++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/_posts/2020-09-20-Linux-Install-Script.md b/_posts/2020-09-20-Linux-Install-Script.md index aa48796f0..d0d7301b0 100644 --- a/_posts/2020-09-20-Linux-Install-Script.md +++ b/_posts/2020-09-20-Linux-Install-Script.md @@ -9,22 +9,24 @@ lang: "en" If you plan to be installing Jamulus on many Linux machines, you may want to try this script. -The following example was tested on Linux Mint and combines all the needed steps in one script for Ubuntu/Linux Mint. To incorporate the different command for different Linux distributions, variables define the distribution and the release for which the installation should be performed. This example focuses on Ubuntu release 18.04. The suggested script name for the release is e.g. `install4ubuntu18_4.sh`. The script commands are generic so that the installation could also be modified so that they work on other Linux distributions. +If you plan to be installing Jamulus on many Linux machines, you may want to try this script. + +The following example was tested on Linux Mint and combines all the commands above into one script for Ubuntu/Linux Mint. To incorporate the different commands for different Linux distributions, variables define the distribution and the release for which the installation script should be performed. The following focuses on Ubuntu with release 18.04 as example. So the suggested script name for the release is e.g. `install4ubuntu18_4.sh`. The script commands are generic so that the installation could also be modified so that they work on other linux distributions. ### Installation dependent on Linux Distribution -The following script calls different installation commands dependent on the Linux distribution. -The variable `DISTRO` defines which commands are executed. Set the variable dependent on your Linux distribution you are using e.g. -* `DISTRO="Ubuntu` for Ubuntu or Linux Mint -* `DISTRO="Debian` for Debian or Raspbian Linux -* `DISTRO="Fedora` for Fedora -Furthermore if the installation is dependent on the release, the variable `LINVERSION` is introduced but currently not used. In Ubuntu the if statement is an example how version dependent installation calls can be performed: +The following script call different installation commands dependent on the Linux distribution. +The variable `DISTRO` defines which commands are executed. Set the variable dependent on the Linux distribution you are using. +* `DISTRO="Ubuntu"` for a Ubuntu or Linux Mint +* `DISTRO="Debian"` for a Debian or Raspbian Linux +* `DISTRO="Fedora"` for a Fedora Linux +Furthermore if the installation is dependent of the release the variable `LINVERSION` is introduced but is currently not used. In the Ubuntu `if` statement there is an example how version dependent installation calls can be performed. ```bash if [ "$LINVERSION" = "18.4" ] then echo "Perform Installation Specifics for $DISTRO Version $DISTRO" fi ``` -The variable `LINVERSION` is currently not used and just a demo how to use the version specific installation commands. +The variable `LINVERSION` is currently not used in the following script but it is just a demo how to use the version specific installation commands. ### Adaptation of the Installation Script If you want to create an installation script for Debian just copy the script `install4ubuntu18_4.sh` to `install4debian10_6.sh` and modify the distro variables to @@ -34,10 +36,10 @@ If you want to create an installation script for Debian just copy the script `in DISTRO="Debian" LINVERSION="10.6" ``` -After that, test the installation on Debian and modify the commands so that the installation script works on Debian. You can share working installation scripts in this Wiki. The maintainer of the Jamulus Repository might add a folder in the repository `/install_scripts` for working installation scripts. Create a pull request for new installation scripts or create an issue with a request to add a documented and tested installation script. +After that test the installation on Debian and modify the commands so that the installation script works on Debian. Please share working installation scripts in this Wiki. The maintainer of this repository might add a folder in this repository `/install_scripts` for working installation scripts. Create a pull request for new installation scripts or create an issue with a request to add a documented and tested installation script to this repository. ### The Installation Script -Copy the following installation script into a file and save it to the filename `install4ubuntu18_4.sh`. After saving the file e.g. in your `Download` directory change to the directory (`cd`) and call the following script with `sh install4ubuntu18_4.sh`. +Copy the following installation script into a file and save it to the filename `install4ubuntu18_4.sh`. After saving the file e.g. in your `Download` directory change to the directory and call the following script with `sh install4ubuntu18_4.sh`. ```bash #!/bin/sh # set DISTRO either to "Ubuntu", "Debian" or "Fedora" @@ -120,10 +122,10 @@ fi ## Possible Improvements of the Installation Script for Jamulus -This script checks in the very beginning for which linux distribution the installation should be called. +The script can ask in the very beginning for which linux distribution the installation script should be called. This can be tested with the command `lsb_release` -With the `lsb_release` command the command returns the distribution specific information about a Linux distro. +The `lsb_release` command returns the distribution specific information about a Linux distro. With a `grep` command with regular expression the variable `DISTRO` and `LINVERSION`. E.g. the Ubuntu based systems return with the command the following information. ```bash @@ -135,6 +137,6 @@ Release: 11.04 Codename: natty ``` -The challenge is, that `lsb_release` command must be available on your Linux system. On CentOS/Fedora based systems `lsb_release` command is only available, if the `lsb` core packages are installed. So the automated Linux version detected might no work. +The challenge is, that `lsb_release` command must be available on Linux system. On CentOS/Fedora based systems `lsb_release` command is only available, if the `lsb` core packages are installed. So the automated Linux version detected might no work. -Reading the `DISTRO` and `LINVERION` with the `read` command might be the better distribution dependent improvement than an automated setting with `lsb_release`. +So reading the `DISTRO` and `LINVERION` with the `read` command might be the better distribution dependent improvement than an automated setting with `lsb_release`. From d593bfcee0956051139c67db0a31ba9431800c0f Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Sat, 12 Dec 2020 20:18:12 +0100 Subject: [PATCH 3/5] Update 2020-09-20-Linux-Install-Script.md --- _posts/2020-09-20-Linux-Install-Script.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_posts/2020-09-20-Linux-Install-Script.md b/_posts/2020-09-20-Linux-Install-Script.md index d0d7301b0..a44a095fe 100644 --- a/_posts/2020-09-20-Linux-Install-Script.md +++ b/_posts/2020-09-20-Linux-Install-Script.md @@ -6,11 +6,9 @@ author: "niebert" lang: "en" --- -If you plan to be installing Jamulus on many Linux machines, you may want to try this script. +IThanks to niebert, if you plan to install Jamulus on many Linux machines, you can try this script. -If you plan to be installing Jamulus on many Linux machines, you may want to try this script. - The following example was tested on Linux Mint and combines all the commands above into one script for Ubuntu/Linux Mint. To incorporate the different commands for different Linux distributions, variables define the distribution and the release for which the installation script should be performed. The following focuses on Ubuntu with release 18.04 as example. So the suggested script name for the release is e.g. `install4ubuntu18_4.sh`. The script commands are generic so that the installation could also be modified so that they work on other linux distributions. ### Installation dependent on Linux Distribution From fb5ac99d84ac1abd4ec9c11e79a554ed71bb3516 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Mon, 14 Dec 2020 21:47:43 +0100 Subject: [PATCH 4/5] small changes --- _posts/2020-09-20-Linux-Install-Script.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/_posts/2020-09-20-Linux-Install-Script.md b/_posts/2020-09-20-Linux-Install-Script.md index a44a095fe..0d38b55ec 100644 --- a/_posts/2020-09-20-Linux-Install-Script.md +++ b/_posts/2020-09-20-Linux-Install-Script.md @@ -6,13 +6,17 @@ author: "niebert" lang: "en" --- -IThanks to niebert, if you plan to install Jamulus on many Linux machines, you can try this script. +Thanks to niebert, if you plan to install Jamulus on many Linux machines, you can try this script. -The following example was tested on Linux Mint and combines all the commands above into one script for Ubuntu/Linux Mint. To incorporate the different commands for different Linux distributions, variables define the distribution and the release for which the installation script should be performed. The following focuses on Ubuntu with release 18.04 as example. So the suggested script name for the release is e.g. `install4ubuntu18_4.sh`. The script commands are generic so that the installation could also be modified so that they work on other linux distributions. +The following example was tested on Linux Mint and combines all the commands to install Jamulus on Linux into one script (currently for Ubuntu/Linux Mint). + +## How it works + +To incorporate the different commands for different Linux distributions, variables define the distribution and the release for which the installation script should be performed. The following focuses on Ubuntu with release 18.04 as example. So the suggested script name for the release is e.g. `install4ubuntu18_4.sh`. The script commands are generic so that the installation could also be modified so that they work on other Linux distributions. ### Installation dependent on Linux Distribution -The following script call different installation commands dependent on the Linux distribution. +The following script calls different installation commands dependent on the Linux distribution. The variable `DISTRO` defines which commands are executed. Set the variable dependent on the Linux distribution you are using. * `DISTRO="Ubuntu"` for a Ubuntu or Linux Mint * `DISTRO="Debian"` for a Debian or Raspbian Linux @@ -34,7 +38,7 @@ If you want to create an installation script for Debian just copy the script `in DISTRO="Debian" LINVERSION="10.6" ``` -After that test the installation on Debian and modify the commands so that the installation script works on Debian. Please share working installation scripts in this Wiki. The maintainer of this repository might add a folder in this repository `/install_scripts` for working installation scripts. Create a pull request for new installation scripts or create an issue with a request to add a documented and tested installation script to this repository. +After that, test the installation on Debian and modify the commands so that the installation script works on Debian. You can share working scripts, if you like. **Edit by Jamulus-Website maintainers:** You should contact [niebert](https://github.com/niebert) if you want to share scripts. ### The Installation Script Copy the following installation script into a file and save it to the filename `install4ubuntu18_4.sh`. After saving the file e.g. in your `Download` directory change to the directory and call the following script with `sh install4ubuntu18_4.sh`. @@ -120,7 +124,7 @@ fi ## Possible Improvements of the Installation Script for Jamulus -The script can ask in the very beginning for which linux distribution the installation script should be called. +The script can ask in the very beginning for which Linux distribution the installation script should be called. This can be tested with the command `lsb_release` The `lsb_release` command returns the distribution specific information about a Linux distro. From 876e27dfcacf415e48ec1f91e2710e2029aa3fd5 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Mon, 14 Dec 2020 22:22:36 +0100 Subject: [PATCH 5/5] Add review changes --- _posts/2020-09-20-Linux-Install-Script.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/_posts/2020-09-20-Linux-Install-Script.md b/_posts/2020-09-20-Linux-Install-Script.md index 0d38b55ec..b50278962 100644 --- a/_posts/2020-09-20-Linux-Install-Script.md +++ b/_posts/2020-09-20-Linux-Install-Script.md @@ -6,7 +6,7 @@ author: "niebert" lang: "en" --- -Thanks to niebert, if you plan to install Jamulus on many Linux machines, you can try this script. +Thanks to [niebert](https://github.com/niebert), if you plan to install Jamulus on many Linux machines, you can try this script. The following example was tested on Linux Mint and combines all the commands to install Jamulus on Linux into one script (currently for Ubuntu/Linux Mint). @@ -16,12 +16,12 @@ The following example was tested on Linux Mint and combines all the commands to To incorporate the different commands for different Linux distributions, variables define the distribution and the release for which the installation script should be performed. The following focuses on Ubuntu with release 18.04 as example. So the suggested script name for the release is e.g. `install4ubuntu18_4.sh`. The script commands are generic so that the installation could also be modified so that they work on other Linux distributions. ### Installation dependent on Linux Distribution -The following script calls different installation commands dependent on the Linux distribution. -The variable `DISTRO` defines which commands are executed. Set the variable dependent on the Linux distribution you are using. +The following script calls different installation commands depending on the Linux distribution. +The variable `DISTRO` defines which commands are executed. Set the variable depending on the Linux distribution you are using. * `DISTRO="Ubuntu"` for a Ubuntu or Linux Mint * `DISTRO="Debian"` for a Debian or Raspbian Linux * `DISTRO="Fedora"` for a Fedora Linux -Furthermore if the installation is dependent of the release the variable `LINVERSION` is introduced but is currently not used. In the Ubuntu `if` statement there is an example how version dependent installation calls can be performed. +Furthermore if the installation is dependent of the release the variable `LINVERSION` is introduced but is currently not used. In the Ubuntu `if` statement there is an example how version depending installation calls can be performed. ```bash if [ "$LINVERSION" = "18.4" ] then