Bundling OpenOffice

Qian Hong edited this page Jan 15, 2016 · 11 revisions

This is the script I use to bundle OpenOffice and LibreOffice.

VERSION=$(wget http://www.openoffice.org/download/globalvars.js -O - | grep -e "DL.VERSION" | head -n 1 | cut -d '"' -f 2)
./doit.sh http://downloads.sourceforge.net/project/openofficeorg.mirror/${VERSION}/binaries/en-US/Apache_OpenOffice_${VERSION}_Linux_x86-64_install-deb_en-US.tar.gz

VERSION=$(wget "http://www.libreoffice.org/download/libreoffice-fresh/" -O - | grep -o -e "/dl/src/.*/all/" | cut -d "/" -f 4 | head -n 1)
./doit.sh http://download.documentfoundation.org/libreoffice/stable/${VERSION}/deb/x86_64/LibreOffice_${VERSION}_Linux_x86-64_deb.tar.gz
#!/bin/bash -x

set +e

OOODOWNLOADLINK="$1"

if [ "x$OOODOWNLOADLINK" ==  "x" ] ; then
  echo "Usage: $0 http://downloads.sourceforge.net/project/openofficeorg.mirror/4.1.0/binaries/en-US/Apache_OpenOffice_4.1.0_Linux_x86-64_install-deb_en-US.tar.gz"
  exit 1
fi

# if [ -e ./ooo ] ; then
  # echo "./ooo exists; exiting"
  # exit 1
# fi

mkdir -p ./ooo/ooo.AppDir
cd ./ooo

wget --timestamping -c "$OOODOWNLOADLINK"

tar xfvz *.tar.gz
# rm *.tar.gz

cd ooo.AppDir/

find ../ -name *.deb -exec dpkg -x \{\} . \;

find . -name startcenter.desktop -exec cp \{\} . \;

find -name *startcenter.png -path *hicolor*48x48* -exec cp \{\} . \;

BINARY=$(cat *.desktop | grep "Exec=" | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)

# sed -i -e 's|/opt|../opt|g' ./usr/bin/$BINARY
cd usr/bin/
rm ./$BINARY
find ../../opt -name soffice -path *program* -exec ln -s \{\} ./$BINARY \;
cd ../../

# (64-bit)
wget -c "https://downloads.sourceforge.net/project/portable/64bit/AppRun"
# or (32-bit)
wget -c "https://downloads.sourceforge.net/project/portable/AppRun"

chmod a+x ./AppRun

# Try to run ./AppRun

cd ..

# (64-bit)
wget -c "https://downloads.sourceforge.net/project/portable/64bit/AppImageAssistant%200.9.3-64bit"
# or (32-bit)
wget -c "http://downloads.sourceforge.net/project/portable/AppImageAssistant%200.9.3"

chmod a+x ./AppImageAssistant*
./AppImageAssistant* ./ooo.AppDir/ ooo.AppImage