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 May 24th, 2012  |  syntax: None  |  size: 5.57 KB  |  views: 139  |  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: Olivier Médoc <o_medoc@yahoo.fr>
  2.  
  3. pkgname=vmware-patch
  4. pkgver=3.4
  5. pkgrel=2
  6. pkgdesc="Several scripts to apply patches to vmware modules (tested for vmware-player and vmware-workstation)"
  7. arch=('i686' 'x86_64')
  8. url="http://www.vmware.com"
  9. license=('GPL')
  10. depends=('linux-headers' 'kmod>=5-2')
  11. source=(vmware-patch vmware-unpatch vmware-rc
  12.         vmmon-2.6.35.diff vsock-2.6.35.diff
  13.         vmmon-2.6.36.diff
  14.         vmci-2.6.37.diff vmmon-2.6.37.diff vmnet-2.6.37.diff vsock-2.6.37.diff
  15.         vmblock-2.6.39.diff vmci-2.6.39.diff vmmon-2.6.39.diff vmnet-2.6.39.diff vsock-2.6.39.diff
  16.         vmblock-3.0.diff vmci-3.0.diff vmmon-3.0.diff vmnet-3.0.diff vsock-3.0.diff
  17.         vmnet-3.1.0.diff
  18.         vmnet-3.1.1.diff
  19.         vmmon-8.0.1-4.0.1-3.2.0.diff vmnet-8.0.1-4.0.1-3.2.0.diff
  20.         vmnet-8.0.2-4.0.2-3.2.1.diff
  21.         vmblock-7.1.5-0.0.0-3.2.1.diff vmnet-7.1.5-0.0.0-3.2.1.diff vmci-7.1.5-0.0.0-3.2.1.diff vsock-7.1.5-0.0.0-3.2.1.diff vmmon-7.1.5-0.0.0-3.2.1.diff
  22.         vmblock-8.0.3-4.0.3-3.4.diff)
  23. install=${pkgname}.install
  24.  
  25. fix_mod_symlink() {
  26.  
  27.   BINARY_NAME=$1
  28.   echo "Checking if it is necessary to create symlink for ${BINARY_NAME}"
  29.  
  30.   # Vmware Player fixes
  31.   mkdir -p "${pkgdir}/sbin"
  32.   if [ -h "/sbin/${BINARY_NAME}" ] ; then
  33.     # If lsmod is own by a pacman packet (probably ours)
  34.     unset NOT_IN_PACMAN
  35.     pacman -Qo "/sbin/${BINARY_NAME}" || NOT_IN_PACMAN=True
  36.     if [ -n "$NOT_IN_PACMAN" ] ; then
  37.       echo "Symlink has been created manually... Not creating /sbin/$BINARY_NAME symlink"
  38.     else
  39.       unset IN_VMWARE_PATCH
  40.       IN_VMWARE_PATCH=`pacman -Qo "/sbin/${BINARY_NAME}" | grep vmware-patch`
  41.       if [ -n "$IN_VMWARE_PATCH" ] ; then
  42.         echo "/sbin/${BINARY_NAME} is owned by vmware-patch... recreating symlink"
  43.         ln -s "/usr/bin/${BINARY_NAME}" "${pkgdir}/sbin/${BINARY_NAME}"
  44.       else
  45.         echo "/sbin/${BINARY_NAME} is owned by an unknown package. Not creating symlink"
  46.       fi
  47.     fi
  48.   else
  49.     ln -s "/usr/bin/${BINARY_NAME}" "${pkgdir}/sbin/${BINARY_NAME}"
  50.   fi
  51.  
  52. }
  53.  
  54. package() {
  55.   install -D -m755 vmware-patch "${pkgdir}/usr/bin/vmware-patch"
  56.   install -D -m755 vmware-unpatch "${pkgdir}/usr/bin/vmware-unpatch"
  57.   mkdir -p "${pkgdir}/usr/lib/vmware/patches"
  58.  
  59.   cp *.diff "${pkgdir}/usr/lib/vmware/patches"
  60.  
  61.   fix_mod_symlink insmod
  62.   fix_mod_symlink lsmod
  63.   fix_mod_symlink rmmod
  64.   fix_mod_symlink modinfo
  65.  
  66.   # rc.d
  67.   install -D -m755 vmware-rc "${pkgdir}/etc/rc.d/vmwared"
  68.  
  69.   # Creating links for future kernel version
  70.   cd "${pkgdir}/usr/lib/vmware/patches"
  71.  
  72.   # For linux 3.1.1 until 3.1.10
  73.   for i in {2..10};
  74.   do
  75.     ln -s vmnet-3.1.1.diff vmnet-3.1.${i}.diff
  76.   done
  77.  
  78.   # For Linux 3.2.0 until 3.2.15 (workstation 8.0.1)
  79.   for i in {1..15};
  80.   do
  81.     ln -s vmnet-8.0.1-4.0.1-3.2.0.diff vmnet-8.0.1-4.0.1-3.2.${i}.diff
  82.     ln -s vmmon-8.0.1-4.0.1-3.2.0.diff vmmon-8.0.1-4.0.1-3.2.${i}.diff
  83.   done
  84.  
  85.   # For Linux 3.2.2 until 3.2.15 (workstation 8.0.2)
  86.   for i in {2..15};
  87.   do
  88.     ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.2-4.0.2-3.2.${i}.diff
  89.   done
  90.  
  91.   # For Linux 3.3 (workstation 8.0.2)
  92.   ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.2-4.0.2-3.3.diff
  93.   # For Linux 3.3.1 until 3.3.15 (workstation 8.0.2 and 8.0.3)
  94.   for i in {0..15};
  95.   do
  96.     ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.2-4.0.2-3.3.${i}.diff
  97.     ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.3-4.0.3-3.3.${i}.diff
  98.   done
  99.  
  100.   # For Linux 3.4 (workstation 8.0.2 and 8.0.3)
  101.   ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.2-4.0.3-3.4.diff
  102.   ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.3-4.0.3-3.4.diff
  103.   # For Linux 3.4.0 until 3.4.15 (workstation 8.0.2 and 8.0.3)
  104.   for i in {0..15};
  105.   do
  106.     ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.2-4.0.3-3.4.${i}.diff
  107.     ln -s vmnet-8.0.2-4.0.2-3.2.1.diff vmnet-8.0.3-4.0.3-3.4.${i}.diff
  108.     ln -s vmblock-8.0.3-4.0.3-3.4.diff vmblock-8.0.2-4.0.3-3.4.${i}.diff
  109.     ln -s vmblock-8.0.3-4.0.3-3.4.diff vmblock-8.0.3-4.0.3-3.4.${i}.diff
  110.   done
  111.  
  112.   # For VMWare 7.1.5
  113.   for code in vmblock vmnet vmci vsock vmmon ; do
  114.     for i in {2..20} ; do
  115.       ln -s "${code}-7.1.5-0.0.0-3.2.1.diff" "${code}-7.1.5-0.0.0-3.2.${i}.diff"
  116.       ln -s "${code}-7.1.5-0.0.0-3.2.1.diff" "${code}-7.1.5-0.0.0-3.3.${i}.diff"
  117.     done
  118.   done
  119.  
  120. }
  121.  
  122.  
  123. md5sums=('4e778e16df7f8f3fc7bfabe31d1d0c2f'
  124.          '0a76ebe17bf692bddce7607ed103e063'
  125.          '771c0901c44a93090348ebc10a17874e'
  126.          'f91cf3f46e5220a64b1cfdb07aa3257e'
  127.          '78740f2ae60d84d7e81ef128cf10eb5d'
  128.          'f0a138dcfb01a12b54bd4268f23fcc2b'
  129.          '289fe3df6aa21e53f0071079800e5754'
  130.          'a4d7bcc5a23382b0c6dd5040723b4d0b'
  131.          'f07e53526dd47a248dec7eacd54121a8'
  132.          '0bbfdfe33dd5e14d96b9719456b0b49c'
  133.          '0c317d09aaed3b10de4a35a97c605f8d'
  134.          'e3efe95c6f90e87bb8fe78ccceb7c4c4'
  135.          '4b11a8f484f89ebea72b8d9ebfc1d23c'
  136.          'f2cc9e4042c43f6075207f3612d72f21'
  137.          'a2a45aa9e9ebd311ecfd6e96f19ad674'
  138.          'd1c9773adc7ec14392f2ac7e7610afec'
  139.          'e3efe95c6f90e87bb8fe78ccceb7c4c4'
  140.          '2e24ef4fa122afd023685d521d533ffc'
  141.          'f2cc9e4042c43f6075207f3612d72f21'
  142.          'adb689206fe85cc0e19ac4b3e50cd656'
  143.          '827b32cec681045a3d2ef761631aa2b2'
  144.          '827b32cec681045a3d2ef761631aa2b2'
  145.          'c913e13035815cfc4cda3bd07d057666'
  146.          'e74c231c297833f55e1108327089a34d'
  147.          'edea711dca63399b7f47b53e50444c09'
  148.          '09a021a9dce9dccd32184bba06086022'
  149.          'b16f5e552d364419b6671ae76c6054f3'
  150.          'ac83544cc198455ce7d5ff367134f20d'
  151.          'b15bb2a426a5a5be701ab265b5bcfe51'
  152.          'b8d90cee99489b8b4c9ab5d0f86fd618'
  153.          'a8d9b98570344514eda185a8115b2c32')
clone this paste RAW Paste Data