Provides automatic installation scripts for OpenRA with Tiberian Sun & Red Alert 2 + Dune 2 (Windows, Linux)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

396 lines
18 KiB

  1. #!/bin/bash
  2. # Allow interruption of the script at any time (Ctrl + C)
  3. trap "exit" INT
  4. #*********************************************************************************************************
  5. ## VARIABLES USED IN THE SCRIPT
  6. #
  7. # Package name & version
  8. PACKAGE_NAME=openra-bleed-tibsunra2
  9. PACKAGE_VERSION=1
  10. PACKAGE=$PACKAGE_NAME-$PACKAGE_VERSION
  11. # Get our Linux distribution
  12. DISTRO=$(cat /etc/os-release | sed -n '/PRETTY_NAME/p' | grep -o '".*"' | sed -e 's/"//g' -e s/'([^)]*)'/''/g -e 's/ .*//' -e 's/[ \t]*$//')
  13. UBUNTU="Ubuntu"
  14. DEBIAN="Debian"
  15. OPENSUSE="openSUSE"
  16. FEDORA="Fedora"
  17. # Get the current directory
  18. WORKING_DIR=$(pwd)
  19. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
  20. # Find out used Linux distribution
  21. RELEASE=$(lsb_release -d | sed 's/Description:\t//g')
  22. # Check if the used OS is Ubuntu 14.04 LTS/14.10 or Linux Mint
  23. RELEASE_VERSION=$(lsb_release -r | sed 's/[^0-9]*//g')
  24. RELEASE_MINT=$(lsb_release -i 2>/dev/null |grep -c "Mint")
  25. # Check for critical build dependencies (especially for Ubuntu 14.04 LTS/14.10 & Linux Mint)
  26. PKG1_CHECK=$(dpkg-query -W -f='${Status}' libnuget-core-cil 2>/dev/null | grep -c "ok installed")
  27. PKG2_CHECK=$(dpkg-query -W -f='${Status}' mono-devel 2>/dev/null | grep -c "ok installed")
  28. PKG3_CHECK=$(dpkg-query -W -f='${Status}' nuget 2>/dev/null | grep -c "ok installed")
  29. # Do we have any OpenRA packages on the system?
  30. PKG4_CHECK=$(dpkg-query -W -f='${Status}' openra 2>/dev/null | grep -c "ok installed")
  31. PKG5_CHECK=$(dpkg-query -W -f='${Status}' openra-playtest 2>/dev/null | grep -c "ok installed")
  32. PKG6_CHECK=$(dpkg-query -W -f='${Status}' openra-bleed 2>/dev/null | grep -c "ok installed")
  33. elif [[ $DISTRO =~ $OPENSUSE ]]; then
  34. # Find out used OpenSUSE version
  35. RELEASE=$(cat /etc/os-release | sed -n 4p | grep -o '".*"' | sed -e 's/"//g' -e s/'([^)]*)'/''/g -e 's/[ \t]*$//')
  36. # Do we have any OpenRA packages on the system?
  37. PKG1_CHECK=$(rpm -qa openra | wc -l)
  38. PKG2_CHECK=$(rpm -qa openra-playtest | wc -l)
  39. PKG3_CHECK=$(rpm -qa openra-bleed | wc -l)
  40. elif [[ $DISTRO =~ $FEDORA ]]; then
  41. # Find out used Fedora version
  42. RELEASE=$(cat /etc/os-release | sed -n '/PRETTY_NAME/p' | grep -o '".*"' | sed -e 's/"//g' -e s/'([^)]*)'/''/g -e 's/[ \t]*$//')
  43. # Do we have any OpenRA packages on the system?
  44. PKG1_CHECK=$(rpm -qa openra | wc -l)
  45. PKG2_CHECK=$(rpm -qa openra-playtest | wc -l)
  46. PKG3_CHECK=$(rpm -qa openra-bleed | wc -l)
  47. fi
  48. # Check for missing RA2 directories.
  49. RA2_MISSINGDIR1="$HOME/openra-master/$PACKAGE/mods/ra2/bits/vehicles"
  50. RA2_MISSINGDIR2="$HOME/openra-master/$PACKAGE/mods/ra2/bits/themes"
  51. # Check if we already have sudo password in memory (timeout/timestamp check)
  52. SUDO_CHECK=$(sudo -n uptime 2>&1|grep "load"|wc -l)
  53. BASH_CHECK=$(ps | grep `echo $$` | awk '{ print $4 }')
  54. bold_in='\e[1m'
  55. line_in='\e[4m'
  56. dim_in='\e[2m'
  57. green_in='\e[32m'
  58. red_in='\e[91m'
  59. out='\e[0m'
  60. #*********************************************************************************************************
  61. ## PRE-CHECK
  62. #
  63. # Check if we're using bash or sh to run the script. If bash, OK. If sh, ask user to run the script with bash.
  64. if [ ! $BASH_CHECK = "bash" ]; then
  65. echo "
  66. Please run this script using bash (/usr/bin/bash).
  67. "
  68. exit 1
  69. fi
  70. # Check if we are root or not. If yes, then terminate the script.
  71. if [[ $UID = 0 ]]; then
  72. echo -e "\nPlease run this script as a regular user. Do not use root or sudo. Some commands used in the script require regular user permissions.\n"
  73. exit 1
  74. fi
  75. #If package dir exists already, delete it.
  76. if [ -d "$HOME/openra-master/" ]; then
  77. rm -rf "$HOME/openra-master"
  78. fi
  79. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
  80. #If deb package exists already, delete it.
  81. if [ -f $HOME/$PACKAGE_NAME*.deb ]; then
  82. rm -f $HOME/$PACKAGE_NAME*.deb
  83. fi
  84. elif [[ $DISTRO =~ $OPENSUSE ]] || [[ $DISTRO =~ $FEDORA ]]; then
  85. if [ -f $HOME/$PACKAGE_NAME*.rpm ]; then
  86. rm -f $HOME/$PACKAGE_NAME*.rpm
  87. fi
  88. fi
  89. # Stop execution if we encounter an error
  90. set -e
  91. #*********************************************************************************************************
  92. ## PART 1/7
  93. #
  94. ## Installation of OpenRA compilation dependencies and user notification message
  95. echo -e "\n$bold_in***Welcome Comrade*** $out\n"
  96. echo -e "This script compiles and installs OpenRA from source with Tiberian Sun & Red Alert 2.\n
  97. - The script is NOT made by the developers of OpenRA and may contain bugs.
  98. - The script creates an installation package using OpenRA source code and additional Red Alert 2 mod files from Github.\n\nNOTE: As the development of OpenRA & Red Alert 2 continues, this script will likely become unusable some day. Please, feel free to modify it if necessary."
  99. if [[ $DISTRO =~ $UBUNTU ]]; then
  100. echo -e "$line_in\nThe script has been tested on:\n\nDistribution\t\tStatus$out\nUbuntu 16.04 LTS$green_in\tOK$out\nUbuntu 15.10$green_in\t\tOK$out\nUbuntu 15.04 LTS$green_in\tOK$out\nUbuntu 14.10$green_in\t\tOK$out\nUbuntu 14.04 LTS$green_in\tOK$out\nLinux Mint 17.3$green_in\t\tOK$out\nLinux Mint 17.2$green_in\t\tOK$out\nLinux Mint 17.1$green_in\t\tOK$out\nLinux Mint 16$red_in\t\tFailure$out$dim_in (can't find required packages)$out\n"
  101. elif [[ $DISTRO =~ $DEBIAN ]]; then
  102. echo -e "$line_in\nThe script has been tested on:\n\nDistribution\t\tStatus$out\nDebian 8.3 $green_in\t\tOK$out\n"
  103. elif [[ $DISTRO =~ $OPENSUSE ]]; then
  104. echo -e "$line_in\nThe script has been tested on:\n\nDistribution\t\tStatus$out\nOpenSUSE Tumbleweed $green_in\tOK$out\nOpenSUSE Leap 42.1 $green_in\tOK$out\nOpenSUSE 13.2 $green_in\t\tOK$out\nOpenSUSE 13.1 $red_in\t\tFailure$out$dim_in (can't find required packages)$out\n"
  105. elif [[ $DISTRO =~ $FEDORA ]]; then
  106. echo -e "$line_in\nThe script has been tested on:\n\nDistribution\t\tStatus$out\nFedora 23 $green_in\t\tOK$out\nFedora 22 $green_in\t\tOK$out\n"
  107. fi
  108. echo -e "You are using $RELEASE.\n"
  109. read -r -p "Do you want to continue? [y/N] " response
  110. if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
  111. sleep 1
  112. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
  113. echo -e "\nAllright, let's continue. Do you want $bold_in\n\n1.$out manually check which OpenRA build dependencies (packages) will be installed on your system and manually install OpenRA after compilation? $dim_in(manual apt-get + deb packages installation)$bold_in\n2.$out automatically accept the installation of the OpenRA build dependencies during the script execution and automatically install OpenRA after compilation? $dim_in(apt-get with -y option + automatic .deb packages installation)$out\n"
  114. elif [[ $DISTRO =~ $OPENSUSE ]] || [[ $DISTRO =~ $FEDORA ]]; then
  115. echo -e "\nAllright, let's continue. Do you want $bold_in\n\n1.$out manually check which OpenRA build dependencies (packages) will be installed on your system and manually install OpenRA after compilation? $dim_in(manual rpm packages installation)$bold_in\n2.$out automatically accept the installation of the OpenRA build dependencies during the script execution and automatically install OpenRA after compilation? $dim_in(automatic installation of rpm packages)$out\n"
  116. fi
  117. read -r -p "Please type 1 or 2 (Default: 2): " number
  118. sleep 1
  119. if [[ ! $(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | wc -l) -eq 0 ]]; then
  120. echo -e "\nHotfixes -- Question\n"
  121. echo -e "Use custom hotfixes if added by the user (Default: No)?\nNOTE: If you choose YES (y), be aware that your OpenRA/RA2 version will likely not be compatible with the other players unless they've applied exactly same hotfixes in their game versions, too!"
  122. echo -e "\nAvailable hotfixes are:\n"
  123. echo -e $green_in$(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | sed -e 's/.*\///' -e 's/\.[^\.]*$//')$out
  124. echo -e ""
  125. read -r -p "Use these hotfixes? (y/N) " hotfixes
  126. if [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then
  127. echo -e "\nHotfixes applied. Continuing."
  128. sleep 2
  129. else
  130. echo -e "\nHotfixes ignored and skipped. Continuing."
  131. sleep 2
  132. fi
  133. fi
  134. if [[ $number -eq 1 ]]; then
  135. METHOD=''
  136. echo -e "\nSelected installation method:$bold_in Manual$out"
  137. else
  138. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]] || [[ $DISTRO =~ $FEDORA ]]; then
  139. METHOD=-y
  140. echo -e "\nSelected installation method:$bold_in Automatic$out"
  141. elif [[ $DISTRO =~ $OPENSUSE ]]; then
  142. METHOD='--non-interactive --no-gpg-checks'
  143. echo -e "\nSelected installation method:$bold_in Automatic$out"
  144. fi
  145. fi
  146. if [[ $(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | wc -l) -eq 0 ]]; then
  147. echo -e "Available hotfixes:$bold_in None$out"
  148. else
  149. if [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then
  150. echo -e "Use hotfixes:$bold_in Yes$out"
  151. else
  152. echo -e "Use hotfixes:$bold_in No$out"
  153. fi
  154. fi
  155. if [ $SUDO_CHECK -eq 0 ]; then
  156. if [[ -z $METHOD ]]; then
  157. echo -e "\nOpenRA compilation requires that you install some packages first. Your permission for installation is asked (yes/no) everytime it's needed. This script asks for a required root password now, so you don't have to type it multiple times later on while the script is running.\n\nPlease type sudo/root password now.\n"
  158. else
  159. echo -e "\nOpenRA compilation requires that you install some packages first. This script asks for a required root password now, so you don't have to type it multiple times later on while the script is running.\n\nPlease type sudo/root password now.\n"
  160. fi
  161. sudo echo -e "\nRoot password OK."
  162. sleep 1
  163. else
  164. true
  165. fi
  166. sleep 2
  167. #-----------------------------------------------------------------------------------------------------------------------------------------------------------
  168. echo -e "$bold_in\n1/7 ***OpenRA build dependencies***\n$out"
  169. sleep 2
  170. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
  171. echo -e "Updating package lists with APT.\n"
  172. sleep 2
  173. sudo apt-get update || true
  174. fi
  175. echo -e "Installing required OpenRA build dependencies.\n"
  176. sleep 4
  177. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
  178. sudo apt-get $METHOD install git dpkg-dev dh-make mono-devel libfreetype6 libopenal1 libsdl2-2.0-0 curl liblua5.1-0 zenity xdg-utils build-essential gcc make libfile-fcntllock-perl
  179. mozroots --import --sync && \
  180. sudo apt-key update || exit 1
  181. elif [[ $DISTRO =~ $OPENSUSE ]]; then
  182. if [[ ! $RELEASE = "openSUSE Leap 42.1" ]] || [[ ! $RELEASE = "openSUSE Tumbleweed" ]]; then
  183. sudo zypper $METHOD install rpm-build git mono-devel libfreetype6 libopenal1 libSDL2-2_0-0 curl lua51 liblua5_1 zenity xdg-utils gcc make
  184. else
  185. sudo zypper $METHOD install rpm-build git mono-devel libfreetype6 libopenal1 libSDL2-2_0-0 curl lua51 liblua5_1 zenity xdg-utils gcc make
  186. fi
  187. mozroots --import --sync
  188. elif [[ $DISTRO =~ $FEDORA ]]; then
  189. sudo dnf $METHOD install rpm-build git mono-devel freetype openal-soft SDL2 libgdiplus-devel libcurl compat-lua zenity xdg-utils gcc make
  190. cd /etc/yum.repos.d/
  191. if [[ $RELEASE = "Fedora 23" ]]; then
  192. sudo wget http://download.opensuse.org/repositories/games:openra/Fedora_23/games:openra.repo
  193. sudo dnf $METHOD --best --allowerasing install mono-core
  194. elif [[ $RELEASE = "Fedora 22" ]]; then
  195. sudo wget http://download.opensuse.org/repositories/games:openra/Fedora_22/games:openra.repo
  196. sudo dnf $METHOD --best --allowerasing install mono-core
  197. fi
  198. cd $WORKING_DIR
  199. mozroots --import --sync
  200. fi
  201. #*********************************************************************************************************
  202. ## PART 2/7
  203. #
  204. ## Download the latest OpenRA & Red Alert 2 source files from Github, create build directories to the user's home directory.
  205. ## Once Red Alert 2 source files have been downloaded, move them to the OpenRA parent source directory.
  206. ## Add several missing directories for Red Alert 2.
  207. echo -e "$bold_in\n2/7 ***Downloading OpenRA source code & Red Alert 2 mod files from Github***\n$out"
  208. sleep 2
  209. echo -e "Part 1 (OpenRA source code):\n"
  210. mkdir -p $HOME/openra-master/{$PACKAGE,ra2} && \
  211. git clone -b bleed https://github.com/OpenRA/OpenRA.git $HOME/openra-master/$PACKAGE
  212. echo -e "\nPart 2 (Red Alert 2 mod files):\n"
  213. git clone -b master https://github.com/OpenRA/ra2.git $HOME/openra-master/ra2 && \
  214. mv $HOME/openra-master/ra2/OpenRA.Mods.RA2 $HOME/openra-master/$PACKAGE && \
  215. mv $HOME/openra-master/ra2 $HOME/openra-master/$PACKAGE/mods/
  216. if [ ! -d "$RA2_MISSINGDIR1" ]; then
  217. mkdir "$RA2_MISSINGDIR1"
  218. fi
  219. if [ ! -d "$RA2_MISSINGDIR2" ]; then
  220. mkdir "$RA2_MISSINGDIR2"
  221. fi
  222. cp ./data/patches/linux/*.patch $HOME/openra-master/
  223. if [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then
  224. cp ./data/hotfixes/linux/*.patch $HOME/openra-master/
  225. fi
  226. #*********************************************************************************************************
  227. ## PART 3/7
  228. #
  229. ## Patch several OpenRA source files (Makefile and such) for Tiberian Sun & Red Alert 2
  230. echo -e "$bold_in\n3/7 ***Preparing OpenRA source files for Tiberian Sun & Red Alert 2***\n$out"
  231. sleep 2
  232. for i in $HOME/openra-master/*.patch; do patch -d $HOME/openra-master/$PACKAGE -Np1 < $i; done
  233. # Get version number for Red Alert 2 mod (Github)
  234. RA2_VERSION=git-$(git ls-remote https://github.com/OpenRA/ra2.git | head -1 | sed "s/HEAD//" | sed 's/^\(.\{7\}\).*/\1/')
  235. sed -i "s/Version: {DEV_VERSION}/Version: $RA2_VERSION/g" $HOME/openra-master/$PACKAGE/mods/ra2/mod.yaml
  236. sed -i "s/maps\/ra2\/{DEV_VERSION}/maps\/ra2\/$RA2_VERSION/g" $HOME/openra-master/$PACKAGE/mods/ra2/mod.yaml
  237. #*********************************************************************************************************
  238. ## PART 4/7
  239. #
  240. ## Compile the game
  241. echo -e "$bold_in\n4/7 ***Starting OpenRA compilation with Tiberian Sun & Red Alert 2***$out"
  242. sleep 2
  243. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
  244. cd $HOME/openra-master/$PACKAGE && \
  245. make version && \
  246. make dependencies && \
  247. make all [DEBUG=false]
  248. echo -e "$bold_in\n5/7 ***Preparing OpenRA deb package. This takes a while. Please wait.***\n$out"
  249. dh_make --createorig -s -y && \
  250. echo -e "\noverride_dh_auto_install:\n\tmake install-all install-linux-shortcuts prefix='$HOME/openra-master/$PACKAGE/debian/$PACKAGE_NAME/usr'\n\tsed -i '2s%.*%cd /usr/lib/openra%' '$HOME/openra-master/$PACKAGE/debian/$PACKAGE_NAME/usr/bin/openra'\noverride_dh_usrlocal:\noverride_dh_auto_test:" >> $HOME/openra-master/$PACKAGE/debian/rules && \
  251. sed -i 's/Depends: ${shlibs:Depends}, ${misc:Depends}/Depends: libopenal1, mono-runtime (>= 2.10), libmono-system-core4.0-cil, libmono-system-drawing4.0-cil, libmono-system-data4.0-cil, libmono-system-numerics4.0-cil, libmono-system-runtime-serialization4.0-cil, libmono-system-xml-linq4.0-cil, libfreetype6, libc6, libasound2, libgl1-mesa-glx, libgl1-mesa-dri, xdg-utils, zenity, libsdl2 | libsdl2-2.0-0, liblua5.1-0/g' $HOME/openra-master/$PACKAGE/debian/control && \
  252. sed -i 's/<insert up to 60 chars description>/A multiplayer re-envisioning of early RTS games by Westwood Studios\nConflicts: openra, openra-playtest, openra-bleed/g' $HOME/openra-master/$PACKAGE/debian/control && \
  253. sed -i 's/ <insert long description, indented with spaces>/ ./g' $HOME/openra-master/$PACKAGE/debian/control && \
  254. dpkg-buildpackage -rfakeroot -b -nc -uc -us
  255. #*********************************************************************************************************
  256. ## PART 6/7
  257. #
  258. ## Remove temporary OpenRA build files & directories
  259. echo -e "$bold_in\n6/7 ***Compilation process completed. Moving compiled deb package into '$HOME'***\n$out"
  260. sleep 2
  261. mv $HOME/openra-master/$PACKAGE_NAME*.deb $HOME
  262. elif [[ $DISTRO =~ $OPENSUSE ]] || [[ $DISTRO =~ $FEDORA ]]; then
  263. echo -e "$bold_in\n5/7 ***Compiling OpenRA rpm package.***\n$out"
  264. mkdir -p $HOME/openra-master/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
  265. cp ./data/linux/opensuse/openra.spec $HOME/openra-master/rpmbuild/SPECS/
  266. cp ./data/linux/opensuse/{GeoLite2-Country.mmdb.gz,thirdparty.tar.gz} $HOME/openra-master/rpmbuild/SOURCES/
  267. cd $HOME/openra-master
  268. tar -czf $HOME/openra-master/rpmbuild/SOURCES/$PACKAGE.tar.gz ./$PACKAGE
  269. cd $WORKING_DIR
  270. rpmbuild --define "_topdir $HOME/openra-master/rpmbuild" -bb --clean $HOME/openra-master/rpmbuild/SPECS/openra.spec
  271. echo -e "$bold_in\n6/7 ***Compilation process completed. Moving compiled rpm package into '$HOME'***\n$out"
  272. sleep 2
  273. mv $HOME/openra-master/rpmbuild/RPMS/noarch/$PACKAGE_NAME*.rpm $HOME
  274. fi
  275. echo -e "Removing temporary files."
  276. rm -rf $HOME/openra-master
  277. #*********************************************************************************************************
  278. ## PART 7/7
  279. #
  280. ## Install OpenRA
  281. echo -e "$bold_in\n7/7 ***Starting OpenRA installation process***\n$out"
  282. sleep 2
  283. if [[ $DISTRO =~ $UBUNTU ]] || [[ $DISTRO =~ $DEBIAN ]]; then
  284. if [ $PKG4_CHECK -eq 1 ] || [ $PKG5_CHECK -eq 1 ] || [ $PKG6_CHECK -eq 1 ] ; then
  285. echo -e "\nCan't install '$PACKAGE_NAME' because of conflicting packages.\nPlease remove previously installed openra package from your system and try again.\nBuilt $PACKAGE_NAME deb package can be found in '$HOME'.\n"
  286. else
  287. if [[ $number -eq 1 ]]; then
  288. read -r -p "Install '$PACKAGE_NAME' now? [y/N] " response4
  289. if [[ $response4 =~ ^([yY][eE][sS]|[yY])$ ]]; then
  290. sudo dpkg -i $HOME/$PACKAGE_NAME*.deb
  291. else
  292. echo -e "\nPlease install '$PACKAGE_NAME' manually. You find the compiled package in '$HOME'."
  293. sleep 2
  294. fi
  295. else
  296. sudo dpkg -i $HOME/$PACKAGE_NAME*.deb
  297. fi
  298. fi
  299. elif [[ $DISTRO =~ $OPENSUSE ]] || [[ $DISTRO =~ $FEDORA ]]; then
  300. if [ $PKG1_CHECK -eq 1 ] || [ $PKG2_CHECK -eq 1 ] || [ $PKG3_CHECK -eq 1 ] ; then
  301. echo -e "\nCan't install '$PACKAGE_NAME' because of conflicting packages.\nPlease remove previously installed openra package from your system and try again.\nBuilt $PACKAGE_NAME rpm package can be found in '$HOME'.\n"
  302. else
  303. if [[ $number -eq 1 ]]; then
  304. read -r -p "Install '$PACKAGE_NAME' now? [y/N] " response4
  305. if [[ $response4 =~ ^([yY][eE][sS]|[yY])$ ]]; then
  306. if [[ $DISTRO =~ $FEDORA ]]; then
  307. sudo dnf $METHOD --best --allowerasing install $HOME/$PACKAGE_NAME*.rpm
  308. elif [[ $DISTRO =~ $OPENSUSE ]]; then
  309. sudo zypper $METHOD install $HOME/$PACKAGE_NAME*.rpm
  310. fi
  311. else
  312. echo -e "\nPlease install '$PACKAGE_NAME' manually. You find the compiled package in '$HOME'."
  313. sleep 2
  314. fi
  315. else
  316. if [[ $DISTRO =~ $FEDORA ]]; then
  317. sudo dnf $METHOD --best --allowerasing install $HOME/$PACKAGE_NAME*.rpm
  318. elif [[ $DISTRO =~ $OPENSUSE ]]; then
  319. sudo zypper $METHOD install $HOME/$PACKAGE_NAME*.rpm
  320. fi
  321. fi
  322. fi
  323. fi
  324. #*********************************************************************************************************
  325. else
  326. echo -e "\nAborted.\n"
  327. fi