SHARE
TWEET

Untitled

a guest May 3rd, 2011 1,060 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. pkgdir=`pwd`
  3. mkdir wine-wow
  4. cd wine-wow
  5. pkgname=wine-wowmc
  6. pkgver=1.3.16
  7. srcdir=`pwd`
  8.  
  9. # Source files
  10. src1="http://www.aewi.info/rgl/rgl.patch.gz"
  11. src2="http://www.aewi.info/rgl/rgl_max.patch"
  12. src3="http://sourceforge.net/projects/wine/files/Source/wine-${pkgver}.tar.bz2"
  13.  
  14. # Source files checksums
  15. #src1_sum="4e359d825c623200aa8bbe1632aa8aa2"
  16. #src2_sum="1674c1bb514d16451e2a084372a551b2"
  17. src3_sum="74627787556240473a85daaf51d4f620"
  18.  
  19. # Get rid of old build dirs and sums
  20.   rm -rf $pkgname-{32,64}-build
  21.   rm -rf wine-$pkgver
  22.   rm rgl.patch.gz.md5
  23.   rm rgl_max.patch.md5
  24.   rm wine-${pkgver}.tar.bz2.md5
  25.  
  26.   mkdir $pkgname-32-build
  27.  
  28. # Fetching sources if not already fetched
  29. if [[ "`ls | grep rgl.patch.gz`" != "rgl.patch.gz" ]]; then
  30. wget $src1
  31. fi
  32.  
  33. #if [[ "`ls | grep rgl_max.patch`" != "rgl_max.patch" ]]; then
  34. #wget $src2
  35. #fi
  36.  
  37. if [[ "`ls | grep wine-${pkgver}.tar.bz2`" != "wine-${pkgver}.tar.bz2" ]]; then
  38. wget $src3
  39. fi
  40.  
  41. # Creating md5 sums to check the sources
  42. #echo "$src1_sum  rgl.patch.gz" > rgl.patch.gz.md5
  43. #echo "$src2_sum  rgl_max.patch" > rgl_max.patch.md5
  44. echo "$src3_sum  wine-$pkgver.tar.bz2" > wine-$pkgver.tar.bz2.md5
  45.  
  46. #echo "Checking $src1 ..."
  47. #if [[ "`md5sum -c rgl.patch.gz.md5 | grep OK`" != "rgl.patch.gz: OK" ]]; then
  48. # echo "Delete the file and start the script again"
  49. # exit
  50. #fi
  51. #echo "OK"
  52. #echo "Checking $src2 ..."
  53. #if [[ "`md5sum -c rgl_max.patch.md5 | grep OK`" != "rgl_max.patch: OK" ]]; then
  54. # echo "Delete the file and start the script again"
  55. # exit
  56. #fi
  57. #echo "OK"
  58. echo "Checking $src3 ..."
  59. if [[ "`md5sum -c wine-$pkgver.tar.bz2.md5 | grep OK`" != "wine-$pkgver.tar.bz2: OK" ]]; then
  60.  echo "Delete the file and start the script again"
  61.  exit
  62. fi
  63. echo "OK"
  64.  
  65. # Extracting sources
  66. gunzip rgl.patch.gz
  67. tar -xvjf wine-$pkgver.tar.bz2
  68.  
  69.  
  70. # Patching Wine
  71. cd "$srcdir/wine-$pkgver"
  72. patch -p1 < ../rgl.patch
  73. echo "Do you wish to apply rgl_max.patch? It improves performance even a little bit more than the main patch but some players faced some sound and graphical glitches (like black screen inside flying ships). (y/n):"
  74. until [[ $Answer = "y" || $Answer = "n" ]];do
  75.       read Answer
  76.       if [[ "$Answer" = "y" ]];then
  77.          cd "$srcdir"
  78.          if [[ "`ls | grep rgl_max.patch`" != "rgl_max.patch" ]]; then
  79.             wget $src2
  80.          fi
  81.          echo "Applying the patch"
  82.          cd "$srcdir/wine-$pkgver"
  83.          patch -p1 < ../rgl_max.patch
  84.       fi
  85. done
  86.  
  87. # Building
  88. cd "$srcdir"
  89. if [ "`uname -m`" = "x86_64" ]; then
  90.  
  91.     echo "Building Wine-64..."
  92.    
  93.     mkdir $pkgname-64-build
  94.     cd "$srcdir/$pkgname-64-build"
  95.     ../wine-$pkgver/configure \
  96.       --prefix=/usr \
  97.       --sysconfdir=/etc \
  98.       --libdir=/usr/lib \
  99.       --with-x \
  100.       --enable-win64
  101.    
  102.     make
  103.  
  104.     # Wine32 build needs a patched ldd
  105.     # Do it here until it's patched in glibc
  106.     cp /usr/bin/ldd "$srcdir/ldd"
  107.     sed -i '/^RTLDLIST=/s:"$: /lib/ld-linux.so.2&:' "$srcdir/ldd"
  108.  
  109.     _wine32opts=(
  110.       LDD="$srcdir/ldd"
  111.       --libdir=/usr/lib32
  112.       --with-wine64="$srcdir/$pkgname-64-build"
  113.     )
  114.  
  115.     export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
  116. fi
  117.  
  118. echo "Building Wine-32..."
  119. cd "$srcdir/$pkgname-32-build"
  120.   ../wine-$pkgver/configure \
  121.     --prefix=/usr \
  122.     --sysconfdir=/etc \
  123.     --with-x \
  124.     "${_wine32opts[@]}"
  125.  
  126.   make
  127.  
  128. # Packaging
  129. echo "Packaging Wine-32..."
  130. cd "$srcdir/$pkgname-32-build"
  131.  
  132.   if [[ "`uname -m`" != "x86_64" ]]; then
  133.     make prefix="$pkgdir/usr" install
  134.   else
  135.     make prefix="$pkgdir/usr" \
  136.       libdir="$pkgdir/usr/lib32" \
  137.       dlldir="$pkgdir/usr/lib32/wine" install
  138.  
  139.     msg2 "Packaging Wine-64..."
  140.     cd "$srcdir/$pkgname-64-build"
  141.     make prefix="$pkgdir/usr" \
  142.       libdir="$pkgdir/usr/lib" \
  143.       dlldir="$pkgdir/usr/lib/wine" install
  144.   fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top