wok-next annotate get-google-earth/stuff/get-google-earth @ rev 1706
get-google-earth: fix path & install depends
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Nov 14 09:54:42 2008 +0000 (2008-11-14) |
parents | 49490d76a557 |
children | e01dd228942a |
rev | line source |
---|---|
pascal@589 | 1 #!/bin/sh -e |
pascal@589 | 2 |
pascal@1706 | 3 DEPENDS="mesa" |
pascal@1706 | 4 |
pascal@589 | 5 if test $(id -u) != 0 ; then |
pascal@589 | 6 echo -e "\nYou must be root to run `basename $0`." |
pascal@589 | 7 echo -e "Please type 'su' and root password to become super-user.\n" |
pascal@589 | 8 exit 0 |
pascal@589 | 9 fi |
pascal@589 | 10 |
pascal@589 | 11 if [ -d /var/lib/tazpkg/installed/google-earth ]; then |
pascal@589 | 12 tazpkg remove google-earth |
pascal@589 | 13 [ -d /var/lib/tazpkg/installed/google-earth ] && exit 1 |
pascal@589 | 14 fi |
pascal@589 | 15 |
pascal@593 | 16 TMP_DIR=/tmp/get-google-earth-$$-$RANDOM |
pascal@593 | 17 CUR_DIR=$(pwd) |
pankso@604 | 18 mkdir -p $TMP_DIR && cd $TMP_DIR |
pascal@593 | 19 |
pascal@589 | 20 # Download tarball |
pascal@590 | 21 wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin |
pascal@589 | 22 chmod +x GoogleEarthLinux.bin |
pascal@1172 | 23 sed -i 's/bzip2 -d/bunzip2/g' GoogleEarthLinux.bin |
pascal@589 | 24 |
pascal@589 | 25 VERSION=$(head GoogleEarthLinux.bin | grep ^label | sed 's/.*Linux \(.*\)"/\1/') |
pascal@589 | 26 |
pascal@1706 | 27 # Add depends |
pascal@1706 | 28 for i in $DEPENDS; do |
pascal@1706 | 29 yes y | tazpkg get-install $i |
pascal@1706 | 30 done |
pascal@1706 | 31 |
pascal@589 | 32 # Extract |
pascal@589 | 33 ./GoogleEarthLinux.bin |
pascal@589 | 34 |
pascal@589 | 35 # Create pseudo package |
pascal@1173 | 36 while read file; do |
pascal@1173 | 37 dest=google-earth-$VERSION/fs$(dirname $file) |
pascal@1173 | 38 [ -d $dest ] || mkdir -p $dest |
pascal@1173 | 39 cp -a $file $dest |
pascal@1173 | 40 done <<EOT |
pascal@1706 | 41 $(ls /*bin/googleearth /usr/*bin/googleearth 2> /dev/null) |
pascal@1706 | 42 $(ls /usr/share/applications/*googleearth*.desktop) |
pascal@593 | 43 /usr/share/applications/defaults.list |
pascal@1706 | 44 $(ls -d /usr/*/google-earth) |
pascal@589 | 45 EOT |
pascal@1173 | 46 cat > google-earth-$VERSION/receipt <<EOT |
pascal@589 | 47 PACKAGE="google-earth" |
pascal@589 | 48 VERSION="$VERSION" |
pascal@589 | 49 CATEGORY="non-free" |
pascal@589 | 50 SHORT_DESC="3D planet viewer." |
pascal@589 | 51 WEB_SITE="http://earth.google.com/" |
pascal@1706 | 52 DEPENDS="$DEPENDS" |
pascal@589 | 53 EOT |
pascal@1173 | 54 |
pascal@1173 | 55 # Pack |
pascal@1173 | 56 tazpkg pack google-earth-$VERSION |
pascal@589 | 57 |
pascal@589 | 58 # Install pseudo package |
pascal@589 | 59 tazpkg install google-earth-$VERSION.tazpkg |
pascal@589 | 60 |
pascal@589 | 61 # Clean |
pascal@593 | 62 cd $CUR_DIR |
pascal@593 | 63 rm -rf $TMP_DIR |
pascal@589 | 64 |