# Contributor: Michal Krenek <mikos@sg1.cz>
# Contributor: Jesus Lazaro Plaza <jesuslazaro84@gmail.com>
# Contributor: Alessandro Sagratini <ale_sagra@hotmail.com>
# Contributor: Bob Finch <w9ya@qrpqrci.net>
# Contributor: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
# Contributor: Daniel Golle <daniel.golle@gmail.com>
# Maintainer: Jeremy Sands <cto@jeremysands.com>
pkgname=google-earth
pkgver=5.1.3535.3218
pkgrel=1
pkgdesc="A 3D interface to the planet Earth"
url="http://earth.google.com"
depends=('curl' 'qt')
install=googleearth.install
source=(http://dl.google.com/earth/client/current/GoogleEarthLinux.bin
http://earth.google.com/intl/en/license.html
googleearth
googleearth.desktop
googleearth-mimetypes.xml)
conflicts=('bin32-google-earth')
arch=('i686')
license=('custom')
md5sums=('69a52b92691f725b15e28b9fa2a123b2'
'757d9726191f365209fa13acdd0ab6e7'
'005109377cb797f6cb12a74abdd0835e'
'd819a1961382826b7f92ee32dd67f2e1'
'84e1efd656f86c52333cc629b31accb0')
build() {
cd $srcdir
chmod 755 ./GoogleEarthLinux.bin
./GoogleEarthLinux.bin --noexec --target $srcdir/$pkgname || return 1
mkdir -p $pkgdir/opt/$pkgname
tar xf $pkgname/googleearth-data.tar -C $pkgdir/opt/$pkgname/ || return 1
#adjust bad perms in files
(
cd $pkgdir/opt/$pkgname &&
find -type d | xargs chmod 755 &&
find -type f | xargs chmod 644 &&
chmod 755 gpsbabel
) || return 1
chmod 755 $pkgdir/opt/$pkgname/gpsbabel || return 1
tar xf $pkgname/googleearth-linux-x86.tar -C $pkgdir/opt/$pkgname/ || return 1
# delete libs that are already in Arch Linux, and better quality than theses ;)
(
cd $pkgdir/opt/$pkgname &&
rm -f lib{crypto.so.*,Qt*,GLU.so.*,curl.so.*,gcc_s.so.*,stdc++.so.*,z.so.*} &&
rm -rf plugins &&
rm -f qt.conf &&
chown -R root:root .
) || return 1
install -D -m 755 googleearth \
$pkgdir/usr/bin/googleearth || return 1
install -D -m 644 googleearth.desktop \
$pkgdir/usr/share/applications/googleearth.desktop || return 1
install -D -m 644 googleearth-mimetypes.xml \
$pkgdir/usr/share/mime/packages/googleearth-mimetypes.xml || return 1
install -D -m 644 $pkgname/googleearth-icon.png \
$pkgdir/usr/share/pixmaps/googleearth-icon.png || return 1
install -D -m 644 license.html \
$pkgdir/usr/share/licenses/$pkgname/license.html || return 1
cd $pkgdir/opt/google-earth/
ln -s /usr/lib/libstdc++.so.6 || return 1
ln -s /usr/lib/libgcc_s.so.1 || return 1
}