Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 15th, 2011  |  syntax: Bash  |  size: 4.93 KB  |  views: 309  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
  2. # Credits: alexwizard, thotypous, jdhore, xduugu and randypenguin
  3.  
  4. pkgname=chromium-browser-bin
  5. _realname=chromium-browser
  6. pkgver=101258
  7. pkgrel=1
  8. pkgdesc="The open-source project behind Google Chrome (Web/HTTP/FTP Browser)"
  9. arch=('i686' 'x86_64')
  10. url=http://code.google.com/chromium/
  11. license=('custom:BSD')
  12. depends=('alsa-lib' 'desktop-file-utils' 'gconf' 'gtk2' 'nss' 'libpng12' 'libxss' 'libxtst')
  13. optdepends=('chromium-codecs-ffmpeg-nonfree-bin: for viewing HTML5/H.264 videos [AUR]'
  14.             'ttf-hannom: Unicode Han and Nom (Chinese and Vietnamese) fonts '
  15.             'otf-ipafont: Unicode Gothic/sans and Mincho/serif (Japanese) fonts [AUR]'
  16.             'ttf-indic-otf: Unicode collection various (Indian) language fonts'
  17.             'xdg-utils: for setting a default browser on desktop environments')
  18. provides=("${_realname}")
  19. conflicts=("${_realname}")
  20. backup=("etc/${_realname}/default")
  21. # let 'makepkg' decide what and how to strip archives, binaries and, or libs
  22. STRIP_DIRS=('opt/${_realname}')
  23. options=('emptydirs' '!strip')
  24. install=${_realname}.install
  25.  
  26. _bldarch='Linux'
  27. [ "$CARCH" = x86_64 ] && _bldarch='Linux_x64'
  28. _bldname=chrome-linux.zip
  29. _bldroot=http://commondatastorage.googleapis.com/chromium-browser-continuous/${_bldarch}
  30.  
  31. source=('LICENSE.txt' 'chrome-wrapper.patch' "${_realname}.1.gz" "${_realname}.default"
  32.         "${_realname}.desktop" "${_realname}.sh")
  33. noextract=("${_realname}.1.gz")
  34.  
  35. # trick to re-determine the build revision and, or entertain the hidden
  36. # makepkg option --forcever, huh
  37. if [ -z $FORCE_VER ]; then
  38.   msg "Determining latest build revision..."
  39.   newpkgver="$(wget -qO - ${_bldroot}/LAST_CHANGE)"
  40.   if [ -n $newpkgver -a $newpkgver != $pkgver ]; then
  41.     msg2 "Version found: %s" $newpkgver
  42.     FORCE_VER=$newpkgver
  43.   else
  44.     FORCE_VER=$pkgver
  45.   fi
  46. fi
  47. if [ $FORCE_VER = LAST_CHANGE -a $SOURCEONLY -eq 0 ]; then
  48.   error "Plz omit '--forcever LAST_CHANGE'; I'll auto-detect the LAST_CHANGE ;)"
  49.   exit 1
  50. elif [ $FORCE_VER != $pkgver ]; then
  51.   rm -f $SRCDEST/${_bldname}
  52.   devel_update
  53. fi
  54.  
  55. try_symlink() {
  56.   if [ -L /usr/lib/$1 ]; then
  57.     ln -s $(readlink /usr/lib/$1) "$pkgdir/usr/lib/$2"
  58.   elif [ -r /usr/lib/$1 ]; then
  59.     ln -s $1 "$pkgdir/usr/lib/$2"
  60.   else
  61.     printf "ln: file or symlink not found -- /usr/lib/%s\n" $1
  62.   fi
  63. }
  64.  
  65. package() {
  66.   if [ ! -r "$srcdir/${_bldname}" ]; then
  67.     msg2 "Downloading the latest '$CARCH/$pkgver/${_bldname}'..."
  68.     wget $QUIET --no-cache -c ${_bldroot}/$pkgver/${_bldname} \
  69.       -O $SRCDEST/${_bldname}
  70.     ln -fs $SRCDEST/${_bldname} "$srcdir/${_bldname}"
  71.   fi
  72.  
  73.   msg2 "Extracting Binaries..."
  74.   bsdtar xf "$srcdir/${_bldname}"
  75.   mkdir -p "$pkgdir/opt/${_realname}"
  76.   cp -r ./chrome-linux/* "$pkgdir/opt/${_realname}"
  77.  
  78.   msg2 "Creating missing symlinks..."
  79.   mkdir -p "$pkgdir/usr/lib"
  80.   try_symlink libnss3.so libnss3.so.1d
  81.   try_symlink libnssutil3.so libnssutil3.so.1d
  82.   try_symlink libsmime3.so libsmime3.so.1d
  83.   try_symlink libssl3.so libssl3.so.1d
  84.   try_symlink libplds4.so libplds4.so.0d
  85.   try_symlink libplc4.so libplc4.so.0d
  86.   try_symlink libnspr4.so libnspr4.so.0d
  87.  
  88.   msg2 "Patching script 'chrome-wrapper'..."
  89.   cd "$pkgdir/opt/${_realname}"
  90.   patch -sp1 < "$srcdir/chrome-wrapper.patch"
  91.  
  92.   msg2 "Making it nice..."
  93.   mv "$pkgdir/opt/${_realname}/libffmpegsumo.so" "$pkgdir/opt/${_realname}/libffmpegsumo.so.FREE"
  94.   # adjust the permissions on directories and, or files, eh
  95.   chown -R 0:0 "$pkgdir/opt/${_realname}"
  96.   find "$pkgdir/opt/${_realname}" -type d -exec chmod 0755 {} ';'
  97.   find "$pkgdir/opt/${_realname}" -type f -exec chmod 0644 {} ';'
  98.   chmod 755 "$pkgdir/opt/${_realname}/chrome"
  99.   chmod 755 "$pkgdir/opt/${_realname}"/chrome[_-]*
  100.   chmod 755 "$pkgdir/opt/${_realname}/xdg-settings"
  101.   # install default, wrapper-script, desktop, license and manpages
  102.   install -Dm644 "$srcdir/${_realname}.default" "$pkgdir/etc/${_realname}/default"
  103.   install -Dm755 "$srcdir/${_realname}.sh" "$pkgdir/usr/bin/${_realname}"
  104.   install -Dm644 "$srcdir/${_realname}.desktop" "$pkgdir/usr/share/applications/${_realname}.desktop"
  105.   install -Dm644 "$srcdir/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
  106.   install -Dm644 "$srcdir/${_realname}.1.gz" "$pkgdir/usr/share/man/man1/${_realname}.1.gz"
  107.   mv "$pkgdir/opt/${_realname}/chrome.1" "$pkgdir/usr/share/man/man1/chromium.1"
  108.   # symlink the icon file
  109.   mkdir -p "$pkgdir/usr/share/pixmaps"
  110.   ln -s /opt/${_realname}/product_logo_48.png "$pkgdir/usr/share/pixmaps/product_logo_48.png"
  111.   #ln -s /opt/${_realname}/product_logo_48.png "$pkgdir/usr/share/pixmaps/${_realname}.png"
  112.   # any localization, eh
  113.   if [ -f "$startdir/PKGBUILD.local" ]; then
  114.     msg2 "Executing PKGBUILD.local..."
  115.     source "$startdir/PKGBUILD.local"
  116.   fi
  117. }
  118.  
  119. # vim:set ts=4 sw=4 et:
  120. md5sums=('b689219f39e74e0c0b19f10a1db1839d'
  121.          'b231add683c7b08b0291718496e974da'
  122.          '1774b5d79cfc67403fb336147a17e9a6'
  123.          'dfc9db0cb84aa38def9f685e26bf60b6'
  124.          'a9ecb6e9963d17ed3f37641500d95dd1'
  125.          '7a72a9def90fee0e398b3e686e6c6741')