wok-stable view get-google-earth/stuff/get-google-earth @ rev 1195

postfix: create /etc/aliases.db
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 06 16:22:16 2008 +0000 (2008-08-06)
parents 45650e1226df
children 68e403f01006
line source
1 #!/bin/sh -e
3 if test $(id -u) != 0 ; then
4 echo -e "\nYou must be root to run `basename $0`."
5 echo -e "Please type 'su' and root password to become super-user.\n"
6 exit 0
7 fi
9 if [ -d /var/lib/tazpkg/installed/google-earth ]; then
10 tazpkg remove google-earth
11 [ -d /var/lib/tazpkg/installed/google-earth ] && exit 1
12 fi
14 TMP_DIR=/tmp/get-google-earth-$$-$RANDOM
15 CUR_DIR=$(pwd)
16 mkdir -p $TMP_DIR && cd $TMP_DIR
18 # Download tarball
19 wget http://dl.google.com/earth/client/current/GoogleEarthLinux.bin
20 chmod +x GoogleEarthLinux.bin
21 sed -i 's/bzip2 -d/bunzip2/g' GoogleEarthLinux.bin
23 VERSION=$(head GoogleEarthLinux.bin | grep ^label | sed 's/.*Linux \(.*\)"/\1/')
25 # Extract
26 ./GoogleEarthLinux.bin
28 # Create pseudo package
29 while read file; do
30 dest=google-earth-$VERSION/fs$(dirname $file)
31 [ -d $dest ] || mkdir -p $dest
32 cp -a $file $dest
33 done <<EOT
34 /sbin/googleearth
35 /usr/share/applications/Google-googleearth.desktop
36 /usr/share/applications/defaults.list
37 /usr/local/google-earth
38 EOT
39 cat > google-earth-$VERSION/receipt <<EOT
40 PACKAGE="google-earth"
41 VERSION="$VERSION"
42 CATEGORY="non-free"
43 SHORT_DESC="3D planet viewer."
44 WEB_SITE="http://earth.google.com/"
45 DEPENDS="mesa"
46 EOT
48 # Pack
49 tazpkg pack google-earth-$VERSION
51 # Install pseudo package
52 tazpkg install google-earth-$VERSION.tazpkg
54 # Clean
55 cd $CUR_DIR
56 rm -rf $TMP_DIR