Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Summary : Bash script to parallel extract versions of LibreOffice on Linux
- # Version : 0.6.1 [2017-06-11]
- # Author : Yousuf Philips
- # Wiki : https://wiki.documentfoundation.org/Installing_in_parallel/Linux
- # -----------------------
- # This bash script can be run within the console or in a gui file manager
- if [ ! -d "readmes" ]; then
- 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."
- exit
- fi
- mkdir installs
- cd installs
- if [ -d '../DEBS' ]; then
- echo "Installing DEB Packages"
- for i in ../DEBS/*.deb; do dpkg-deb -x $i . ; done
- #rm ../DEBS/*.deb
- else
- echo "Installing RPM Packages"
- for i in ../RPMS/*.rpm; do rpm2cpio $i | cpio -id; done
- rm ../RPMS/*.rpm
- fi
- cd ..
- if [ -d 'installs/opt/libreoffice' ]; then
- echo 'Patching bootstraprc: Success [LibO 3.3]'
- chmod 644 installs/opt/libreoffice/program/bootstraprc
- sed -i 's/.libreoffice\/3/libreoffice\/3_3/g' installs/opt/libreoffice/program/bootstraprc
- ln -s installs/opt/libreoffice/program/soffice LibO\ 3_3
- elif [ -d 'installs/opt/libreoffice3.5' ]; then
- echo 'Patching bootstraprc: Success [LibO 3.5]'
- sed -i '$s/$/_5/' installs/opt/libreoffice3.5/program/bootstraprc
- ln -s installs/opt/libreoffice3.5/program/soffice LibO\ 3_5
- elif [ -d 'installs/opt/libreoffice3.6' ]; then
- echo 'Patching bootstraprc: Success [LibO 3.6]'
- sed -i '$s/$/_6/' installs/opt/libreoffice3.6/program/bootstraprc
- ln -s installs/opt/libreoffice3.6/program/soffice LibO\ 3_6
- elif [ -d 'installs/opt/libreoffice4.0' ]; then
- echo 'Patching bootstraprc: Success'
- sed -i '$s/$/_0/' installs/opt/libreoffice4.0/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice4.1' ]; then
- echo 'Patching bootstraprc: Success'
- sed -i '$s/$/_1/' installs/opt/libreoffice4.1/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice4.2' ]; then
- echo 'Patching bootstraprc: Success'
- sed -i '$s/$/_2/' installs/opt/libreoffice4.2/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice4.3' ]; then
- echo 'Patching bootstraprc: Success'
- sed -i '$s/$/_3/' installs/opt/libreoffice4.3/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice4.4' ]; then
- echo 'Patching bootstraprc: Success [LibO 4.4]'
- sed -i '$s/$/_4/' installs/opt/libreoffice4.4/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice5.0' ]; then
- echo 'Patching bootstraprc: Success [LibO 5.0]'
- sed -i '$s/$/_5_0/' installs/opt/libreoffice5.0/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice5.1' ]; then
- echo 'Patching bootstraprc: Success [LibO 5.1]'
- sed -i '$s/$/_5_1/' installs/opt/libreoffice5.1/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice5.2' ]; then
- echo 'Patching bootstraprc: Success [LibO 5.2]'
- sed -i '$s/$/_5_2/' installs/opt/libreoffice5.2/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice5.3' ]; then
- echo 'Patching bootstraprc: Success [LibO 5.3]'
- sed -i '$s/$/_5_3/' installs/opt/libreoffice5.3/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice5.4' ]; then
- echo 'Patching bootstraprc: Success [LibO 5.4]'
- sed -i '$s/$/_5_4/' installs/opt/libreoffice5.4/program/bootstraprc
- elif [ -d 'installs/opt/libreoffice5.5' ]; then
- echo 'Patching bootstraprc: Success [LibO 5.5]'
- sed -i '$s/$/_5_5/' installs/opt/libreoffice5.5/program/bootstraprc
- # Development Releases
- elif [ -d 'installs/opt/libreofficedev5.3' ]; then
- echo 'Patching bootstraprc: Success'
- sed -i '$s/$/_5_3/' installs/opt/libreofficedev5.3/program/bootstraprc
- elif [ -d 'installs/opt/libreofficedev5.4' ]; then
- echo 'Patching bootstraprc: Success'
- sed -i '$s/$/_5_4/' installs/opt/libreofficedev5.4/program/bootstraprc
- elif [ -d 'installs/opt/libreofficedev5.5' ]; then
- echo 'Patching bootstraprc: Success'
- sed -i '$s/$/_5_5/' installs/opt/libreofficedev5.5/program/bootstraprc
- else
- echo 'Patching bootstraprc: Fail'
- fi
- if hash zenity 2>/dev/null; then
- zenity --info --text="Installation Complete"
- else
- echo "Installation Complete"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement