WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: libreoffice language script  (Read 2743 times)

Offline Onyarian

  • Sr. Member
  • ****
  • Posts: 337
libreoffice language script
« on: February 12, 2011, 11:38:25 AM »
Script to download and create a .tcz language pack for Libreoffice3.3

It works for a lot of languages.
(see comments in http://forum.tinycorelinux.net/index.php?topic=8694.0 )


Quote
#!/bin/sh
# usage: libreoffice-lang language
# example:  libreoffice-lang es
# version: 20110213a
# autor: Onyarian

LANG="$1"
DOWNLOAD=http://download.documentfoundation.org/libreoffice/stable/3.3.0/rpm/x86/
SOURCE=LibO_3.3.0_Linux_x86_langpack-rpm_"$LANG".tar.gz
TMP=/tmp
SRCDIR="$TMP"/libreoffice
PKGDIR="$TMP"/package/usr/local/lib


[ ! "$USER" == "root" ] && echo "You need to run as root.  Exiting.." && exit 1

[ ! -f /usr/local/tce.installed/squashfs-tools-4.x ] &&   echo "Install squashfs-tools-4.x.tcz before proceeding." && exit 1

[ -z "$LANG" ] && echo "You must specify a language in the form es it de" && exit 1


[ ! -d "$PKGDIR" ] && sudo mkdir -p "$PKGDIR"


[ ! -d "$SRCDIR" ] && sudo mkdir -p "$SRCDIR"


cd "$TMP"
[ ! -e "$SOURCE" ] && wget "$DOWNLOAD"/"$SOURCE"


tar xzvf "$SOURCE"
cd LibO_3.3.0rc4_Linux_x86_langpack-rpm_"$LANG"/RPMS
cp *.rpm "$TMP"


cd /"$SRCDIR"
for i in $(ls "$TMP"/*.rpm)
do
  /usr/bin/rpm2cpio $i | cpio -idv
done

cd opt
mv libreoffice/ "$PKGDIR"

cd "$TMP"
mksquashfs package libreoffice-"$LANG".tcz

echo "---------------------------"
echo "libreoffice-"$LANG".tcz is now in "$TMP" ready to be installed."
echo "if all was OK, copy it to the tce/optional directory"
echo "---------------------------"

Edit:
Actualized. This script is only for the language pack, it has not the help pack included.

« Last Edit: May 08, 2011, 07:28:01 PM by roberts »