wok-stable rev 1694
Fix: get-OpenOffice3 package name.
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Tue Nov 11 21:59:57 2008 +0100 (2008-11-11) |
parents | 720da62b7024 |
children | d0998c1aa2e0 |
files | get-OpenOffice3/stuff/get-OpenOffice3 get-OpenOffice3/stuff/get-OpenOffice3.sh |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-OpenOffice3/stuff/get-OpenOffice3 Tue Nov 11 21:59:57 2008 +0100 1.3 @@ -0,0 +1,160 @@ 1.4 +#!/bin/sh 1.5 +# get-OpenOffice3, install everything for OpenOffice.org exept KDE/Gnome integration and testsuite. 1.6 +# 1.7 +# (C) 2008 SliTaz - GNU General Public License v3. 1.8 +# 1.9 +# Author : Eric Joseph-Alexandre <erjo@slitaz.org> 1.10 + 1.11 +PACKAGE="OpenOffice3" 1.12 +VERSION="3.0.0" 1.13 +URL="http://www.openoffice.org" 1.14 + 1.15 +if [ "$LANG" = "fr_FR" ]; then 1.16 + TARBALL="OOo_${VERSION}_LinuxIntel_install_fr.tar.gz" 1.17 + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/fr/${VERSION}/${TARBALL}" 1.18 +else 1.19 + TARBALL="OOo_${VERSION}_LinuxIntel_install_en-US.tar.gz" 1.20 + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/stable/${VERSION}/${TARBALL}" 1.21 +fi 1.22 + 1.23 +TEMP_DIR="/home/slitaz/build/$PACKAGE.$$" 1.24 +SOURCE_DIR="/home/slitaz/src" 1.25 +EXCLUDE="kde|gnome|test" 1.26 +LOG="/tmp/$(basename $0 .sh).log" 1.27 + 1.28 +# Status function with color (supported by Ash). 1.29 +status() 1.30 +{ 1.31 + local CHECK=$? 1.32 + echo -en "\\033[70G[ " 1.33 + if [ $CHECK = 0 ]; then 1.34 + echo -en "\\033[1;33mOK" 1.35 + else 1.36 + echo -en "\\033[1;31mFailed" 1.37 + fi 1.38 + echo -e "\\033[0;39m ]" 1.39 + return $CHECK 1.40 +} 1.41 + 1.42 +# Check if user is root to install, or remove packages. 1.43 +check_root() 1.44 +{ 1.45 + if test $(id -u) != 0 ; then 1.46 + echo -e "\nYou must be root to run `basename $0` with this option." 1.47 + echo -e "Please use 'su' and root password to become super-user.\n" 1.48 + exit 0 1.49 + fi 1.50 +} 1.51 + 1.52 +check_if_installed() 1.53 +{ 1.54 + # Avoid reinstall 1.55 + if [ -d /var/lib/tazpkg/installed/$PACKAGE ];then 1.56 + return 0 1.57 + else 1.58 + return 1 1.59 + fi 1.60 +} 1.61 + 1.62 +#We need to bee root 1.63 +check_root 1.64 + 1.65 +#check if package already installed 1.66 +if (check_if_installed $PACKAGE); then 1.67 + echo "$PACKAGE is already installed." 1.68 + echo -n "Would you like to remove and reinstall this package [y/n]? " 1.69 + read answer 1.70 + case "$answer" in 1.71 + y|Y) 1.72 + tazpkg remove $PACKAGE ;; 1.73 + *) 1.74 + exit 0 ;; 1.75 + esac 1.76 + 1.77 +fi 1.78 + 1.79 + 1.80 +# Check if we have the tarball before. 1.81 +if [ ! -f $SOURCE_DIR/$TARBALL ]; then 1.82 + echo "Downloading OppenOffice.org tarball (it's time to have a break)... " 1.83 + #Check if $SOURCE_DIR exist 1.84 + test -d $SOURCE_DIR || mkdir -p $SOURCE_DIR 1.85 + # Get the file. 1.86 + wget -c $WGET_URL -O $SOURCE_DIR/$TARBALL 1.87 + status 1.88 +fi 1.89 + 1.90 + 1.91 + 1.92 +# Creates TEM_DIR and extract tarball 1.93 +mkdir -p $TEMP_DIR 1.94 +echo -n "Extract files from archive..." 1.95 +tar xvzf $SOURCE_DIR/$TARBALL -C $TEMP_DIR > $LOG 2>&1 || \ 1.96 + (echo "Failed to extract $TARBALL" ; exit 1) 1.97 +status 1.98 + 1.99 +cd $TEMP_DIR/*/RPMS 1.100 + 1.101 +# Extract everything from RPMS 1.102 +for i in *.rpm 1.103 +do 1.104 + if (! echo $i | egrep -qi $EXCLUDE); then 1.105 + rpm2cpio $i | cpio -id >> $LOG 2>&1 1.106 + fi 1.107 +done 1.108 +rpm2cpio desktop-integration/*freedesktop*.rpm | cpio -id >> $LOG 2>&1 1.109 + 1.110 +# Make the package 1.111 +mkdir -p $PACKAGE-$VERSION/fs/usr/lib/openoffice \ 1.112 + $PACKAGE-$VERSION/fs/usr/share 1.113 + 1.114 +cp -a opt/openoffice* $PACKAGE-$VERSION/fs/usr/lib/openoffice 1.115 +cp -a usr/share/mime $PACKAGE-$VERSION/fs/usr/share 1.116 +cp -a usr/share/icons $PACKAGE-$VERSION/fs/usr/share 1.117 +cp -a usr/bin $PACKAGE-$VERSION/fs/usr 1.118 + 1.119 +# relocalized OOo libexec directory 1.120 +sed -i 's#/opt/#/usr/lib/openoffice/#' $PACKAGE-$VERSION/fs/usr/openoffice* 1.121 + 1.122 +# Create receipt 1.123 +cat > $PACKAGE-$VERSION/receipt <<EOT 1.124 +# SliTaz package receipt. 1.125 + 1.126 +PACKAGE="$PACKAGE" 1.127 +VERSION="$VERSION" 1.128 +CATEGORY="office" 1.129 +SHORT_DESC="Productivity suite." 1.130 +DEPENDS="" 1.131 +WEB_SITE="$URL" 1.132 + 1.133 +post_install() 1.134 +{ 1.135 + cd /usr/share/applications 1.136 + ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/base.desktop openoffice.org3-base.desktop 1.137 + ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/impress.desktop openoffice.org3-impress.desktop 1.138 + ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/writer.desktop openoffice.org3-writer.desktop 1.139 + ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/calc.desktop openoffice.org3-calc.desktop 1.140 + ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/math.desktop openoffice.org3-math.desktop 1.141 + ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/draw.desktop openoffice.org3-draw.desktop 1.142 + ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/printeradmin.desktop openoffice.org3-printeradmin.desktop 1.143 + 1.144 + cd /usr/bin 1.145 + ln -sf /usr/lib/openoffice/openoffice.org3/program/soffice 1.146 +} 1.147 + 1.148 +post_remove() 1.149 +{ 1.150 + rm -f /usr/share/applications/openoffice.org3-* 1.151 +} 1.152 + 1.153 +EOT 1.154 + 1.155 +# Pack 1.156 +tazpkg pack $PACKAGE-$VERSION 1.157 + 1.158 +# Install pseudo package 1.159 +tazpkg install $PACKAGE-$VERSION.tazpkg 1.160 + 1.161 +# Clean 1.162 +rm -rf $TEMP_DIR 1.163 +rm -rf $PACKAGE-$VERSION
2.1 --- a/get-OpenOffice3/stuff/get-OpenOffice3.sh Tue Nov 11 12:18:44 2008 +0000 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,160 +0,0 @@ 2.4 -#!/bin/sh 2.5 -# get-OpenOffice3, install everything for OpenOffice.org exept KDE/Gnome integration and testsuite. 2.6 -# 2.7 -# (C) 2008 SliTaz - GNU General Public License v3. 2.8 -# 2.9 -# Author : Eric Joseph-Alexandre <erjo@slitaz.org> 2.10 - 2.11 -PACKAGE="OpenOffice" 2.12 -VERSION="3.0.0" 2.13 -URL="http://www.openoffice.org" 2.14 - 2.15 -if [ "$LANG" = "fr_FR" ]; then 2.16 - TARBALL="OOo_${VERSION}_LinuxIntel_install_fr.tar.gz" 2.17 - WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/fr/${VERSION}/${TARBALL}" 2.18 -else 2.19 - TARBALL="OOo_${VERSION}_LinuxIntel_install_en-US.tar.gz" 2.20 - WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/stable/${VERSION}/${TARBALL}" 2.21 -fi 2.22 - 2.23 -TEMP_DIR="/home/slitaz/build/$PACKAGE.$$" 2.24 -SOURCE_DIR="/home/slitaz/src" 2.25 -EXCLUDE="kde|gnome|test" 2.26 -LOG="/tmp/$(basename $0 .sh).log" 2.27 - 2.28 -# Status function with color (supported by Ash). 2.29 -status() 2.30 -{ 2.31 - local CHECK=$? 2.32 - echo -en "\\033[70G[ " 2.33 - if [ $CHECK = 0 ]; then 2.34 - echo -en "\\033[1;33mOK" 2.35 - else 2.36 - echo -en "\\033[1;31mFailed" 2.37 - fi 2.38 - echo -e "\\033[0;39m ]" 2.39 - return $CHECK 2.40 -} 2.41 - 2.42 -# Check if user is root to install, or remove packages. 2.43 -check_root() 2.44 -{ 2.45 - if test $(id -u) != 0 ; then 2.46 - echo -e "\nYou must be root to run `basename $0` with this option." 2.47 - echo -e "Please use 'su' and root password to become super-user.\n" 2.48 - exit 0 2.49 - fi 2.50 -} 2.51 - 2.52 -check_if_installed() 2.53 -{ 2.54 - # Avoid reinstall 2.55 - if [ -d /var/lib/tazpkg/installed/$PACKAGE ];then 2.56 - return 0 2.57 - else 2.58 - return 1 2.59 - fi 2.60 -} 2.61 - 2.62 -#We need to bee root 2.63 -check_root 2.64 - 2.65 -#check if package already installed 2.66 -if (check_if_installed $PACKAGE); then 2.67 - echo "$PACKAGE is already installed." 2.68 - echo -n "Would you like to remove and reinstall this package [y/n]? " 2.69 - read answer 2.70 - case "$answer" in 2.71 - y|Y) 2.72 - tazpkg remove $PACKAGE ;; 2.73 - *) 2.74 - exit 0 ;; 2.75 - esac 2.76 - 2.77 -fi 2.78 - 2.79 - 2.80 -# Check if we have the tarball before. 2.81 -if [ ! -f $SOURCE_DIR/$TARBALL ]; then 2.82 - echo "Downloading OppenOffice.org tarball (it's time to have a break)... " 2.83 - #Check if $SOURCE_DIR exist 2.84 - test -d $SOURCE_DIR || mkdir -p $SOURCE_DIR 2.85 - # Get the file. 2.86 - wget -c $WGET_URL -O $SOURCE_DIR/$TARBALL 2.87 - status 2.88 -fi 2.89 - 2.90 - 2.91 - 2.92 -# Creates TEM_DIR and extract tarball 2.93 -mkdir -p $TEMP_DIR 2.94 -echo -n "Extract files from archive..." 2.95 -tar xvzf $SOURCE_DIR/$TARBALL -C $TEMP_DIR > $LOG 2>&1 || \ 2.96 - (echo "Failed to extract $TARBALL" ; exit 1) 2.97 -status 2.98 - 2.99 -cd $TEMP_DIR/*/RPMS 2.100 - 2.101 -# Extract everything from RPMS 2.102 -for i in *.rpm 2.103 -do 2.104 - if (! echo $i | egrep -qi $EXCLUDE); then 2.105 - rpm2cpio $i | cpio -id >> $LOG 2>&1 2.106 - fi 2.107 -done 2.108 -rpm2cpio desktop-integration/*freedesktop*.rpm | cpio -id >> $LOG 2>&1 2.109 - 2.110 -# Make the package 2.111 -mkdir -p $PACKAGE-$VERSION/fs/usr/lib/openoffice \ 2.112 - $PACKAGE-$VERSION/fs/usr/share 2.113 - 2.114 -cp -a opt/openoffice* $PACKAGE-$VERSION/fs/usr/lib/openoffice 2.115 -cp -a usr/share/mime $PACKAGE-$VERSION/fs/usr/share 2.116 -cp -a usr/share/icons $PACKAGE-$VERSION/fs/usr/share 2.117 -cp -a usr/bin $PACKAGE-$VERSION/fs/usr 2.118 - 2.119 -# relocalized OOo libexec directory 2.120 -sed -i 's#/opt/#/usr/lib/openoffice/#' $PACKAGE-$VERSION/fs/usr/openoffice* 2.121 - 2.122 -# Create receipt 2.123 -cat > $PACKAGE-$VERSION/receipt <<EOT 2.124 -# SliTaz package receipt. 2.125 - 2.126 -PACKAGE="$PACKAGE" 2.127 -VERSION="$VERSION" 2.128 -CATEGORY="office" 2.129 -SHORT_DESC="Productivity suite." 2.130 -DEPENDS="" 2.131 -WEB_SITE="$URL" 2.132 - 2.133 -post_install() 2.134 -{ 2.135 - cd /usr/share/applications 2.136 - ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/base.desktop openoffice.org3-base.desktop 2.137 - ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/impress.desktop openoffice.org3-impress.desktop 2.138 - ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/writer.desktop openoffice.org3-writer.desktop 2.139 - ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/calc.desktop openoffice.org3-calc.desktop 2.140 - ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/math.desktop openoffice.org3-math.desktop 2.141 - ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/draw.desktop openoffice.org3-draw.desktop 2.142 - ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/printeradmin.desktop openoffice.org3-printeradmin.desktop 2.143 - 2.144 - cd /usr/bin 2.145 - ln -sf /usr/lib/openoffice/openoffice.org3/program/soffice 2.146 -} 2.147 - 2.148 -post_remove() 2.149 -{ 2.150 - rm -f /usr/share/applications/openoffice.org3-* 2.151 -} 2.152 - 2.153 -EOT 2.154 - 2.155 -# Pack 2.156 -tazpkg pack $PACKAGE-$VERSION 2.157 - 2.158 -# Install pseudo package 2.159 -tazpkg install $PACKAGE-$VERSION.tazpkg 2.160 - 2.161 -# Clean 2.162 -rm -rf $TEMP_DIR 2.163 -rm -rf $PACKAGE-$VERSION