# HG changeset patch # User Eric Joseph-Alexandre # Date 1226402446 -3600 # Node ID c3c353091edb05dd901874fdea507f82c6349a59 # Parent 33a264004dde13233e04360a7c7c5a31029e16e2 Add: get-OpenOffice3.sh diff -r 33a264004dde -r c3c353091edb get-OpenOffice3/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-OpenOffice3/receipt Tue Nov 11 12:20:46 2008 +0100 @@ -0,0 +1,16 @@ +# SliTaz package receipt. + +PACKAGE="get-OpenOffice3" +VERSION="1.0" +CATEGORY="office" +SHORT_DESC="Productivity suite" +MAINTAINER="erjo@slitaz.org" +WEB_SITE="http://www.openoffice.org" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + install -o root -g root -m755 stuff/get-OpenOffice3.sh $fs/usr/bin +} + diff -r 33a264004dde -r c3c353091edb get-OpenOffice3/stuff/get-OpenOffice3.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-OpenOffice3/stuff/get-OpenOffice3.sh Tue Nov 11 12:20:46 2008 +0100 @@ -0,0 +1,160 @@ +#!/bin/sh +# get-OpenOffice3, install everything for OpenOffice.org exept KDE/Gnome integration and testsuite. +# +# (C) 2008 SliTaz - GNU General Public License v3. +# +# Author : Eric Joseph-Alexandre + +PACKAGE="OpenOffice" +VERSION="3.0.0" +URL="http://www.openoffice.org" + +if [ "$LANG" = "fr_FR" ]; then + TARBALL="OOo_${VERSION}_LinuxIntel_install_fr.tar.gz" + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/fr/${VERSION}/${TARBALL}" +else + TARBALL="OOo_${VERSION}_LinuxIntel_install_en-US.tar.gz" + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/stable/${VERSION}/${TARBALL}" +fi + +TEMP_DIR="/home/slitaz/build/$PACKAGE.$$" +SOURCE_DIR="/home/slitaz/src" +EXCLUDE="kde|gnome|test" +LOG="/tmp/$(basename $0 .sh).log" + +# Status function with color (supported by Ash). +status() +{ + local CHECK=$? + echo -en "\\033[70G[ " + if [ $CHECK = 0 ]; then + echo -en "\\033[1;33mOK" + else + echo -en "\\033[1;31mFailed" + fi + echo -e "\\033[0;39m ]" + return $CHECK +} + +# Check if user is root to install, or remove packages. +check_root() +{ + if test $(id -u) != 0 ; then + echo -e "\nYou must be root to run `basename $0` with this option." + echo -e "Please use 'su' and root password to become super-user.\n" + exit 0 + fi +} + +check_if_installed() +{ + # Avoid reinstall + if [ -d /var/lib/tazpkg/installed/$PACKAGE ];then + return 0 + else + return 1 + fi +} + +#We need to bee root +check_root + +#check if package already installed +if (check_if_installed $PACKAGE); then + echo "$PACKAGE is already installed." + echo -n "Would you like to remove and reinstall this package [y/n]? " + read answer + case "$answer" in + y|Y) + tazpkg remove $PACKAGE ;; + *) + exit 0 ;; + esac + +fi + + +# Check if we have the tarball before. +if [ ! -f $SOURCE_DIR/$TARBALL ]; then + echo "Downloading OppenOffice.org tarball (it's time to have a break)... " + #Check if $SOURCE_DIR exist + test -d $SOURCE_DIR || mkdir -p $SOURCE_DIR + # Get the file. + wget -c $WGET_URL -O $SOURCE_DIR/$TARBALL + status +fi + + + +# Creates TEM_DIR and extract tarball +mkdir -p $TEMP_DIR +echo -n "Extract files from archive..." +tar xvzf $SOURCE_DIR/$TARBALL -C $TEMP_DIR > $LOG 2>&1 || \ + (echo "Failed to extract $TARBALL" ; exit 1) +status + +cd $TEMP_DIR/*/RPMS + +# Extract everything from RPMS +for i in *.rpm +do + if (! echo $i | egrep -qi $EXCLUDE); then + rpm2cpio $i | cpio -id >> $LOG 2>&1 + fi +done +rpm2cpio desktop-integration/*freedesktop*.rpm | cpio -id >> $LOG 2>&1 + +# Make the package +mkdir -p $PACKAGE-$VERSION/fs/usr/lib/openoffice \ + $PACKAGE-$VERSION/fs/usr/share + +cp -a opt/openoffice* $PACKAGE-$VERSION/fs/usr/lib/openoffice +cp -a usr/share/mime $PACKAGE-$VERSION/fs/usr/share +cp -a usr/share/icons $PACKAGE-$VERSION/fs/usr/share +cp -a usr/bin $PACKAGE-$VERSION/fs/usr + +# relocalized OOo libexec directory +sed -i 's#/opt/#/usr/lib/openoffice/#' $PACKAGE-$VERSION/fs/usr/openoffice* + +# Create receipt +cat > $PACKAGE-$VERSION/receipt <