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