Advertisement
Guest User

Untitled

a guest
Dec 9th, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.17 KB | None | 0 0
  1. # Maintainer: Det
  2. # Contributors: 458italia, Madek, Berseker, Syr
  3. # Check the latest version with: $ curl -s https://dl.google.com/dl/earth/client/current/google-earth-stable_current_x86_64.rpm | head -c96 | strings | cut -d "-" -f4
  4.  
  5. # Attempt to fix crashes and blank Panoramio: "1" to enable.
  6. # - http://forums.fedoraforum.org/showthread.php?p=1678303#post1678303
  7. _attempt_fix=0
  8.  
  9. # Build an unstable 64-bit build: "1" to enable.
  10. _64=0
  11.  
  12. pkgname=google-earth
  13. pkgver=7.1.2.2041
  14. pkgrel=2
  15. pkgdesc="A 3D interface to view satellite images of Earth and other objects"
  16. arch=('i686' 'x86_64')
  17. url="https://www.google.com/earth/index.html"
  18. license=('custom:earth')
  19. depends=('desktop-file-utils' 'hicolor-icon-theme' 'ld-lsb>=3-5' 'lib32-fontconfig' 'lib32-glu' 'lib32-libgl' 'lib32-libsm'
  20.          'lib32-libxrender' 'lib32-mesa' 'shared-mime-info' 'xdg-utils')
  21. [[ $_attempt_fix = 1 ]] && depends+=('gcc-multilib' 'lib32-freeimage' 'lib32-libpng15' 'lib32-qt4')
  22. optdepends=('lib32-ati-dri: For the open source AMD/ATI Radeon driver'
  23.             'lib32-catalyst-utils: For AMD Catalyst'
  24.             'lib32-intel-dri: For the open source Intel driver'
  25.             'lib32-nouveau-dri: For the open source Nouveau driver'
  26.             'lib32-nvidia-utils: For the NVIDIA driver')
  27. _arch=i386
  28. if [[ $CARCH = x86_64 ]] && [[ $_64 = 1 ]]; then
  29.   _arch=amd64
  30. fi
  31. if [[ $CARCH = i686 ]] || [[ $_arch = amd64 ]]; then
  32.   depends=('desktop-file-utils' 'fontconfig' 'glu' 'hicolor-icon-theme' 'ld-lsb>=3-5' 'libgl' 'libsm' 'libxrender' 'mesa'
  33.            'shared-mime-info' 'xdg-utils')
  34.   [[ $_attempt_fix = 1 ]] && depends+=('freeimage' 'libpng15' 'qtwebkit')
  35.   optdepends=('ati-dri: For the open source AMD/ATI Radeon driver'
  36.               'catalyst-utils: For AMD Catalyst'
  37.               'intel-dri: For the open source Intel driver'
  38.               'nouveau-dri: For the open source Nouveau driver'
  39.               'nvidia-utils: For the NVIDIA driver')
  40. fi
  41. options=('!emptydirs')
  42. install=$pkgname.install
  43. source=("$pkgname-stable_${pkgver}_$_arch.deb::https://dl.google.com/earth/client/current/$pkgname-stable_current_$_arch.deb"
  44.         'googleearth'
  45.         "$pkgname-mimetypes.xml"
  46.         'baifaao.cpp')
  47. md5sums=('c9675d0078d1b188188c9d3b616de6fa'  # google-earth-stable_${pkgver}_i386.deb
  48.          'e84f5d51ea3545c131d1794f89f6464a'  # googleearth
  49.          'e3c67b8d05c3de50535bd7e45eee728e'  # google-earth-mimetypes.xml
  50.          '598d579a1c3199c77850d86ba78f7b44') # baifaao.cpp
  51. [[ $_arch = amd64 ]] && md5sums[0]='6979fd255895891fea8c98fa02fd243d' # google-earth-stable_${pkgver}_amd64.deb
  52.  
  53. _instdir=/opt/google/earth/free/
  54.  
  55. # Build() the baifaao.so
  56. if [[ $_attempt_fix = 1 ]]; then
  57.   # bin32?
  58.   if [[ $CARCH = x86_64 ]] && [[ $_64 != 1 ]]; then
  59.     _m32=-m32
  60.   fi
  61.  
  62.   build() {
  63.     gcc -vI /usr/include/qt4/ $_m32 -O3 -fPIC --shared baifaao.cpp -o baifaao.so
  64.   }
  65. fi
  66.  
  67. package() {
  68.   msg2 "Extracting the data.tar.lzma"
  69.   bsdtar -xvf data.tar.lzma -C "$pkgdir/"
  70.  
  71.   msg2 "Moving stuff in place"
  72.   # The .desktop
  73.   mv -v "$pkgdir"/$_instdir/$pkgname.desktop "$pkgdir"/usr/share/applications/
  74.  
  75.   # Icons
  76.   for i in 16 22 24 32 48 64 128 256; do
  77.     install -vDm644 "$pkgdir"/$_instdir/product_logo_$i.png "$pkgdir"/usr/share/icons/hicolor/${i}x$i/apps/$pkgname.png
  78.   done
  79.  
  80.   # The MIME package
  81.   install -vDm644 $pkgname-mimetypes.xml "$pkgdir"/usr/share/mime/packages/$pkgname-mimetypes.xml
  82.  
  83.   # The license (too many different ones to do this in "source=()")
  84.   install -d "$pkgdir"/usr/share/licenses/$pkgname/
  85.   curl -Lv ${url/i*}/license.html -o "$pkgdir"/usr/share/licenses/$pkgname/license.html
  86.  
  87.   msg2 "Removing the Debian-intended cron job and duplicated images"
  88.   rm -rv "$pkgdir"/etc/cron.daily/ "$pkgdir"/$_instdir/product_logo_*.png
  89.  
  90.   if [[ $_attempt_fix = 1 ]]; then
  91.     msg2 "Attempting a fix on Panoramio and certain crashes"
  92.     # Install baifaao.so
  93.     install -vm755 baifaao.so "$pkgdir"/$_instdir/
  94.  
  95.     # Preload it
  96.     install -vm755 googleearth "$pkgdir"/$_instdir/
  97.  
  98.     # bin32?
  99.     if [[ "$_m32" ]]; then
  100.       sed -i "s,/usr/lib,/usr/lib32,g" "$pkgdir"/$_instdir/googleearth
  101.     fi
  102.  
  103.     # Remove the old, bundled Qt libs
  104.     rm -v "$pkgdir"/$_instdir/libQt*
  105.   fi
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement