wok annotate get-google-earth/stuff/get-google-earth @ rev 5934

netsurf: add missing file.
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Fri Jul 30 22:41:51 2010 +0200 (2010-07-30)
parents 32959e7975fc
children d7b0fb9b6487
rev   line source
pascal@589 1 #!/bin/sh -e
pascal@589 2
pascal@1706 3 DEPENDS="mesa"
pascal@1713 4 ROOT="$1"
jozee@4989 5 PACKAGE="google-earth"
pascal@1706 6
pascal@589 7 if test $(id -u) != 0 ; then
pascal@589 8 echo -e "\nYou must be root to run `basename $0`."
pascal@589 9 echo -e "Please type 'su' and root password to become super-user.\n"
pascal@589 10 exit 0
pascal@589 11 fi
pascal@589 12
pascal@1713 13 if [ -d $ROOT/var/lib/tazpkg/installed/google-earth ]; then
pascal@1713 14 [ -n "$ROOT" ] && exit 1
pascal@589 15 tazpkg remove google-earth
pascal@589 16 [ -d /var/lib/tazpkg/installed/google-earth ] && exit 1
pascal@589 17 fi
pascal@589 18
pascal@593 19 TMP_DIR=/tmp/get-google-earth-$$-$RANDOM
pascal@593 20 CUR_DIR=$(pwd)
pankso@604 21 mkdir -p $TMP_DIR && cd $TMP_DIR
pascal@593 22
pascal@589 23 # Download tarball
pascal@590 24 wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin
pascal@3893 25 if [ ! -f GoogleEarthLinux.bin ]; then
pascal@3893 26 cd $CUR_DIR
pascal@3893 27 rm -rf $TMP_DIR
pascal@3893 28 echo "Could not download GoogleEarthLinux.bin. Exiting."
pascal@3893 29 exit 1
pascal@3893 30 fi
pascal@3893 31
pascal@589 32 chmod +x GoogleEarthLinux.bin
pascal@1172 33 sed -i 's/bzip2 -d/bunzip2/g' GoogleEarthLinux.bin
pascal@589 34
pascal@589 35 VERSION=$(head GoogleEarthLinux.bin | grep ^label | sed 's/.*Linux \(.*\)"/\1/')
pascal@589 36
pascal@1706 37 # Add depends
pascal@1706 38 for i in $DEPENDS; do
pascal@1706 39 yes y | tazpkg get-install $i
pascal@1706 40 done
pascal@1706 41
pascal@589 42 # Extract
pascal@589 43 ./GoogleEarthLinux.bin
pascal@589 44
jozee@4989 45 # extracted pkg can be removed: Save RAM
jozee@4989 46 rm -rf GoogleEarthLinux.bin
jozee@4989 47
pascal@589 48 # Create pseudo package
pascal@1173 49 while read file; do
pascal@1173 50 dest=google-earth-$VERSION/fs$(dirname $file)
pascal@1173 51 [ -d $dest ] || mkdir -p $dest
pascal@1173 52 cp -a $file $dest
pascal@1173 53 done <<EOT
pascal@1706 54 $(ls /*bin/googleearth /usr/*bin/googleearth 2> /dev/null)
pascal@1706 55 $(ls /usr/share/applications/*googleearth*.desktop)
pascal@593 56 /usr/share/applications/defaults.list
pascal@1706 57 $(ls -d /usr/*/google-earth)
pascal@589 58 EOT
pascal@1173 59 cat > google-earth-$VERSION/receipt <<EOT
pascal@589 60 PACKAGE="google-earth"
pascal@589 61 VERSION="$VERSION"
pascal@589 62 CATEGORY="non-free"
pascal@589 63 SHORT_DESC="3D planet viewer."
pascal@589 64 WEB_SITE="http://earth.google.com/"
pascal@1706 65 DEPENDS="$DEPENDS"
pascal@589 66 EOT
pascal@1173 67
pascal@1173 68 # Pack
jozee@4989 69 tazpkg pack $PACKAGE-$VERSION
jozee@4989 70
jozee@4989 71 # Clean to save RAM memory
jozee@4989 72 rm -rf $PACKAGE-$VERSION
pascal@589 73
pascal@589 74 # Install pseudo package
pascal@1713 75 tazpkg install google-earth-$VERSION.tazpkg --root=$ROOT
pascal@589 76
pascal@589 77 # Clean
pascal@593 78 cd $CUR_DIR
pascal@593 79 rm -rf $TMP_DIR
pascal@589 80