Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 29th, 2010  |  syntax: Bash  |  size: 3.27 KB  |  hits: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Mantainter: Madek <gonzaloseguel@gmail.com>
  2. # Contributor: Berseker <berseker86@gmail.com>
  3. # Based mostly on the great (now deleted) bin32-google-earth package
  4.  
  5. _use_system_libs="no"  # Change to "yes" to use the system libraries instead of the ones provided by Google. The problem with
  6.                        # system libraries is that often they are too new for Google Earth leading into unexpected behaviour.
  7. pkgname=google-earth
  8. pkgver=6.0.1.2032
  9. pkgrel=1
  10. pkgdesc="A 3D interface to the planet Earth"
  11. url="http://earth.google.com"
  12. arch=('i686' 'x86_64')
  13. license=('custom')
  14. install=googleearth.install
  15. depends=('libsm' 'libgl' 'fontconfig' 'ld-lsb')
  16. optdepends=('ttf-bitstream-vera: Fonts'
  17.             'nss-mdns: In case the application fails to contact the servers'
  18.             'gtk2: SCIM support')
  19. conflicts=('bin32-google-earth')
  20. source=(http://dl.google.com/earth/client/current/GoogleEarthLinux.bin
  21.         http://earth.google.com/intl/en/license.html
  22.         googleearth-i686
  23.         googleearth-x86_64
  24.         googleearth.desktop
  25.         googleearth-mimetypes.xml
  26.         pangorc qt.conf)
  27. md5sums=('737743e5ce9f464d555a2a829baebea4'
  28.          '757d9726191f365209fa13acdd0ab6e7'
  29.          'b955ff71ae2ad0324ff6dd22452ee32c'
  30.          '721665f4beb6104081119904f1eddae6'
  31.          'd819a1961382826b7f92ee32dd67f2e1'
  32.          'e3c67b8d05c3de50535bd7e45eee728e'
  33.          'bd9f74c28489eb79f31e84977e3cf305'
  34.          '335088571a7182988280643c61e0230e')
  35.  
  36. [[ "${_use_system_libs}" == "no" ]] && depends+=('curl' 'mesa' 'qt')
  37.  
  38. [[ "${CARCH}" == "x86_64" ]] && depends=('lib32-libsm' 'lib32-libgl' 'lib32-fontconfig' 'ld-lsb') && optdepends=('ttf-bitstream-vera: Fonts'
  39. 'lib32-nss-mdns: In case the application fails to contact the servers' 'lib32-gtk2: SCIM support')
  40.  
  41. [[ "${CARCH}" == "x86_64" ]] && [[ "${_use_system_libs}" == "no" ]] && depends+=('lib32-curl' 'lib32-mesa' 'lib32-qt')
  42.  
  43. _libs_to_remove="libcurl.so.4 libGLU.so.1 libQtCore.so.4 libQtGui.so.4 libQtNetwork.so.4 libQtWebKit.so.4"
  44.  
  45. package() {
  46.   # Extract the archive
  47.   sh GoogleEarthLinux.bin --noexec --target ${pkgname}
  48.  
  49.   # Install the binaries and data files
  50.   mkdir -p "${pkgdir}/opt/${pkgname}"
  51.   tar -xpf ${pkgname}/googleearth-linux-x86.tar -C "${pkgdir}/opt/${pkgname}/"
  52.   tar -xpf ${pkgname}/googleearth-data.tar -C "${pkgdir}/opt/${pkgname}/"
  53.  
  54.   # Install the executable
  55.   install -Dm755 googleearth-"${CARCH}" "${pkgdir}/usr/bin/googleearth"
  56.  
  57.   # Install the .desktop file
  58.   install -Dm644 googleearth.desktop "${pkgdir}/usr/share/applications/googleearth.desktop"
  59.  
  60.   # Install the shared MIME info package
  61.   install -Dm644 googleearth-mimetypes.xml "${pkgdir}/usr/share/mime/packages/googleearth-mimetypes.xml"
  62.  
  63.   # Install the icon
  64.   install -Dm644 ${pkgname}/googleearth-icon.png "${pkgdir}/usr/share/pixmaps/googleearth-icon.png"
  65.  
  66.   # Install the license
  67.   install -Dm644 license.html "${pkgdir}/usr/share/licenses/${pkgname}/license.html"
  68.  
  69.   # Install the pango config file
  70.   [[ "${CARCH}" == "x86_64" ]] && install -Dm644 pangorc "${pkgdir}/opt/${pkgname}/pangorc"
  71.  
  72.   if [[ "${CARCH}" == "x86_64" ]] && [[ "${_use_system_libs}" == "yes" ]]; then
  73.         # Removing the provided libraries to use the system ones instead
  74.         cd "${pkgdir}/opt/${pkgname}"
  75.         rm ${_libs_to_remove}
  76.         install -Dm644 "${srcdir}/qt.conf" qt.conf
  77.   fi
  78.  
  79.   # Change the ownership to root
  80.   chown -R root:root "${pkgdir}/"*
  81. }