jphilipz

Bash Script to Parallel Extract LibreOffice on Linux

Jun 10th, 2014
972
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # Summary : Bash script to parallel extract versions of LibreOffice on Linux
  4. # Version : 0.6.1 [2017-06-11]
  5. # Author  : Yousuf Philips
  6. # Wiki    : https://wiki.documentfoundation.org/Installing_in_parallel/Linux
  7. # -----------------------
  8. # This bash script can be run within the console or in a gui file manager
  9.  
  10. if [ ! -d "readmes" ]; then
  11.    echo "This script must be run within the main extraction folder of the .tar.gz, which should contain a 'readmes' folder, as well as either a 'DEBS' or 'RPMS' folder in it."
  12.    exit
  13. fi
  14.  
  15. mkdir installs
  16. cd installs
  17.  
  18. if [ -d '../DEBS' ]; then
  19.    echo "Installing DEB Packages"
  20.    for i in ../DEBS/*.deb; do dpkg-deb -x $i . ; done
  21.    #rm ../DEBS/*.deb
  22. else
  23.    echo "Installing RPM Packages"
  24.    for i in ../RPMS/*.rpm; do rpm2cpio $i | cpio -id; done
  25.    rm ../RPMS/*.rpm
  26. fi
  27.  
  28. cd ..
  29.  
  30. if [ -d 'installs/opt/libreoffice' ]; then
  31.    echo 'Patching bootstraprc: Success [LibO 3.3]'
  32.    chmod 644 installs/opt/libreoffice/program/bootstraprc
  33.    sed -i 's/.libreoffice\/3/libreoffice\/3_3/g' installs/opt/libreoffice/program/bootstraprc
  34.    ln -s installs/opt/libreoffice/program/soffice LibO\ 3_3
  35.  
  36. elif [ -d 'installs/opt/libreoffice3.5' ]; then
  37.    echo 'Patching bootstraprc: Success [LibO 3.5]'
  38.    sed -i '$s/$/_5/' installs/opt/libreoffice3.5/program/bootstraprc
  39.    ln -s installs/opt/libreoffice3.5/program/soffice LibO\ 3_5
  40.  
  41. elif [ -d 'installs/opt/libreoffice3.6' ]; then
  42.    echo 'Patching bootstraprc: Success [LibO 3.6]'
  43.    sed -i '$s/$/_6/' installs/opt/libreoffice3.6/program/bootstraprc
  44.    ln -s installs/opt/libreoffice3.6/program/soffice LibO\ 3_6
  45.  
  46. elif [ -d 'installs/opt/libreoffice4.0' ]; then
  47.    echo 'Patching bootstraprc: Success'
  48.    sed -i '$s/$/_0/' installs/opt/libreoffice4.0/program/bootstraprc
  49.  
  50. elif [ -d 'installs/opt/libreoffice4.1' ]; then
  51.    echo 'Patching bootstraprc: Success'
  52.    sed -i '$s/$/_1/' installs/opt/libreoffice4.1/program/bootstraprc
  53.  
  54. elif [ -d 'installs/opt/libreoffice4.2' ]; then
  55.    echo 'Patching bootstraprc: Success'
  56.    sed -i '$s/$/_2/' installs/opt/libreoffice4.2/program/bootstraprc
  57.  
  58. elif [ -d 'installs/opt/libreoffice4.3' ]; then
  59.    echo 'Patching bootstraprc: Success'
  60.    sed -i '$s/$/_3/' installs/opt/libreoffice4.3/program/bootstraprc
  61.  
  62. elif [ -d 'installs/opt/libreoffice4.4' ]; then
  63.    echo 'Patching bootstraprc: Success [LibO 4.4]'
  64.    sed -i '$s/$/_4/' installs/opt/libreoffice4.4/program/bootstraprc
  65.  
  66. elif [ -d 'installs/opt/libreoffice5.0' ]; then
  67.    echo 'Patching bootstraprc: Success [LibO 5.0]'
  68.    sed -i '$s/$/_5_0/' installs/opt/libreoffice5.0/program/bootstraprc
  69.  
  70. elif [ -d 'installs/opt/libreoffice5.1' ]; then
  71.    echo 'Patching bootstraprc: Success [LibO 5.1]'
  72.    sed -i '$s/$/_5_1/' installs/opt/libreoffice5.1/program/bootstraprc
  73.  
  74. elif [ -d 'installs/opt/libreoffice5.2' ]; then
  75.    echo 'Patching bootstraprc: Success [LibO 5.2]'
  76.    sed -i '$s/$/_5_2/' installs/opt/libreoffice5.2/program/bootstraprc
  77.  
  78. elif [ -d 'installs/opt/libreoffice5.3' ]; then
  79.    echo 'Patching bootstraprc: Success [LibO 5.3]'
  80.    sed -i '$s/$/_5_3/' installs/opt/libreoffice5.3/program/bootstraprc
  81.  
  82. elif [ -d 'installs/opt/libreoffice5.4' ]; then
  83.    echo 'Patching bootstraprc: Success [LibO 5.4]'
  84.    sed -i '$s/$/_5_4/' installs/opt/libreoffice5.4/program/bootstraprc
  85.  
  86. elif [ -d 'installs/opt/libreoffice5.5' ]; then
  87.    echo 'Patching bootstraprc: Success [LibO 5.5]'
  88.    sed -i '$s/$/_5_5/' installs/opt/libreoffice5.5/program/bootstraprc
  89.  
  90. # Development Releases
  91.  
  92. elif [ -d 'installs/opt/libreofficedev5.3' ]; then
  93.    echo 'Patching bootstraprc: Success'
  94.    sed -i '$s/$/_5_3/' installs/opt/libreofficedev5.3/program/bootstraprc
  95.  
  96. elif [ -d 'installs/opt/libreofficedev5.4' ]; then
  97.    echo 'Patching bootstraprc: Success'
  98.    sed -i '$s/$/_5_4/' installs/opt/libreofficedev5.4/program/bootstraprc
  99.  
  100. elif [ -d 'installs/opt/libreofficedev5.5' ]; then
  101.    echo 'Patching bootstraprc: Success'
  102.    sed -i '$s/$/_5_5/' installs/opt/libreofficedev5.5/program/bootstraprc
  103.  
  104. else
  105.    echo 'Patching bootstraprc: Fail'
  106.  
  107. fi
  108.  
  109. if hash zenity 2>/dev/null; then
  110.    zenity --info --text="Installation Complete"
  111. else
  112.    echo "Installation Complete"
  113. fi
RAW Paste Data