# Mantainter: Madek <gonzaloseguel@gmail.com>
# Contributor: Berseker <berseker86@gmail.com>
# Based mostly on the great (now deleted) bin32-google-earth package
_use_system_libs="no" # Change to "yes" to use the system libraries instead of the ones provided by Google. The problem with
# system libraries is that often they are too new for Google Earth leading into unexpected behaviour.
pkgname=google-earth
pkgver=6.0.1.2032
pkgrel=1
pkgdesc="A 3D interface to the planet Earth"
url="http://earth.google.com"
arch=('i686' 'x86_64')
license=('custom')
install=googleearth.install
depends=('libsm' 'libgl' 'fontconfig' 'ld-lsb')
optdepends=('ttf-bitstream-vera: Fonts'
'nss-mdns: In case the application fails to contact the servers'
'gtk2: SCIM support')
conflicts=('bin32-google-earth')
source=(http://dl.google.com/earth/client/current/GoogleEarthLinux.bin
http://earth.google.com/intl/en/license.html
googleearth-i686
googleearth-x86_64
googleearth.desktop
googleearth-mimetypes.xml
pangorc qt.conf)
md5sums=('737743e5ce9f464d555a2a829baebea4'
'757d9726191f365209fa13acdd0ab6e7'
'b955ff71ae2ad0324ff6dd22452ee32c'
'721665f4beb6104081119904f1eddae6'
'd819a1961382826b7f92ee32dd67f2e1'
'e3c67b8d05c3de50535bd7e45eee728e'
'bd9f74c28489eb79f31e84977e3cf305'
'335088571a7182988280643c61e0230e')
[[ "${_use_system_libs}" == "no" ]] && depends+=('curl' 'mesa' 'qt')
[[ "${CARCH}" == "x86_64" ]] && depends=('lib32-libsm' 'lib32-libgl' 'lib32-fontconfig' 'ld-lsb') && optdepends=('ttf-bitstream-vera: Fonts'
'lib32-nss-mdns: In case the application fails to contact the servers' 'lib32-gtk2: SCIM support')
[[ "${CARCH}" == "x86_64" ]] && [[ "${_use_system_libs}" == "no" ]] && depends+=('lib32-curl' 'lib32-mesa' 'lib32-qt')
_libs_to_remove="libcurl.so.4 libGLU.so.1 libQtCore.so.4 libQtGui.so.4 libQtNetwork.so.4 libQtWebKit.so.4"
package() {
# Extract the archive
sh GoogleEarthLinux.bin --noexec --target ${pkgname}
# Install the binaries and data files
mkdir -p "${pkgdir}/opt/${pkgname}"
tar -xpf ${pkgname}/googleearth-linux-x86.tar -C "${pkgdir}/opt/${pkgname}/"
tar -xpf ${pkgname}/googleearth-data.tar -C "${pkgdir}/opt/${pkgname}/"
# Install the executable
install -Dm755 googleearth-"${CARCH}" "${pkgdir}/usr/bin/googleearth"
# Install the .desktop file
install -Dm644 googleearth.desktop "${pkgdir}/usr/share/applications/googleearth.desktop"
# Install the shared MIME info package
install -Dm644 googleearth-mimetypes.xml "${pkgdir}/usr/share/mime/packages/googleearth-mimetypes.xml"
# Install the icon
install -Dm644 ${pkgname}/googleearth-icon.png "${pkgdir}/usr/share/pixmaps/googleearth-icon.png"
# Install the license
install -Dm644 license.html "${pkgdir}/usr/share/licenses/${pkgname}/license.html"
# Install the pango config file
[[ "${CARCH}" == "x86_64" ]] && install -Dm644 pangorc "${pkgdir}/opt/${pkgname}/pangorc"
if [[ "${CARCH}" == "x86_64" ]] && [[ "${_use_system_libs}" == "yes" ]]; then
# Removing the provided libraries to use the system ones instead
cd "${pkgdir}/opt/${pkgname}"
rm ${_libs_to_remove}
install -Dm644 "${srcdir}/qt.conf" qt.conf
fi
# Change the ownership to root
chown -R root:root "${pkgdir}/"*
}