Guest User

Untitled

a guest
Sep 17th, 2019
138
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # Download, build and install wine 32-bit on CentOS 7
  4.  
  5. # For details of this script, please check
  6. # https://www.systutorials.com/239913/install-32-bit-wine-1-8-centos-7/
  7.  
  8. # Author: Eric Zhiqiang Ma (zma@ericzma.com)
  9.  
  10. set -o errexit
  11.  
  12. # Constants
  13. log=`mktemp -t install-wine.XXXXXX.log`
  14. NPROC=$(nproc)
  15. CFLAGS="-g -O2 -std=gnu99"
  16. wine2up="2 3 4" # wine 2 and up
  17. ver=4.0.1 # last stable version on 2019-05-15
  18.  
  19. # Install
  20. if [[ "$1" != "" ]]; then
  21. ver=$1
  22. fi
  23.  
  24. vermajor=$(echo ${ver} | cut -d'.' -f1)
  25. verurlstr=$(echo ${ver} | cut -d'.' -f1,2)
  26.  
  27. date > $log
  28. echo "Hello there. Start to download, build and install wine $ver 32-bit version..." | tee -a $log
  29. echo "Logs are in $log" | tee -a $log
  30.  
  31. echo "Please make sure you have EPEL and Nux Desktop repositories configured. Check https://www.systutorials.com/239893/additional-repositories-centos-linux/ for howto." | tee -a $log
  32. echo "Uninstall old wine64 if you have installed it. Please select yes..." | tee -a $log
  33.  
  34. yum erase wine wine-*
  35.  
  36. echo "Install wine building tools..." | tee -a $log
  37.  
  38. yum install samba-winbind-clients -y 2>&1 >>$log
  39. yum groupinstall 'Development Tools' -y 2>&1 >> $log
  40. yum install libjpeg-turbo-devel libtiff-devel freetype-devel -y 2>&1 >> $log
  41. yum install glibc-devel.{i686,x86_64} libgcc.{i686,x86_64} libX11-devel.{i686,x86_64} freetype-devel.{i686,x86_64} gnutls-devel.{i686,x86_64} libxml2-devel.{i686,x86_64} libjpeg-turbo-devel.{i686,x86_64} libpng-devel.{i686,x86_64} libXrender-devel.{i686,x86_64} alsa-lib-devel.{i686,x86_64} glib2-devel.{i686,x86_64} libSM-devel.{i686,x86_64} -y 2>&1 >> $log
  42.  
  43. # Thanks to David https://www.systutorials.com/239913/install-32-bit-wine-1-8-centos-7/#comment-156429
  44. yum install glibc-devel libstdc++-devel icoutils openal-soft-devel prelink gstreamer-plugins-base-devel gstreamer-devel ImageMagick-devel fontpackages-devel libv4l-devel gsm-devel giflib-devel libXxf86dga-devel mesa-libOSMesa-devel isdn4k-utils-devel libgphoto2-devel fontforge libusb-devel lcms2-devel audiofile-devel -y 2>&1 >> $log
  45.  
  46. yum install openldap-devel libxslt-devel libXcursor-devel libXi-devel libXxf86vm-devel libXrandr-devel libXinerama-devel libXcomposite-devel mesa-libGLU-devel ocl-icd opencl-headers libpcap-devel dbus-devel ncurses-devel libsane-hpaio pulseaudio-libs-devel cups-devel libmpg123-devel fontconfig-devel sane-backends-devel.x86_64 -y 2>&1 >> $log
  47.  
  48. yum install glibc-devel.i686 dbus-devel.i686 freetype-devel.i686 pulseaudio-libs-devel.i686 libX11-devel.i686 mesa-libGLU-devel.i686 libICE-devel.i686 libXext-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libXxf86vm-devel.i686 libXrender-devel.i686 libXinerama-devel.i686 libXcomposite-devel.i686 libXrandr-devel.i686 mesa-libGL-devel.i686 mesa-libOSMesa-devel.i686 libxml2-devel.i686 libxslt-devel.i686 zlib-devel.i686 gnutls-devel.i686 ncurses-devel.i686 sane-backends-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 libexif-devel.i686 lcms2-devel.i686 gettext-devel.i686 isdn4k-utils-devel.i686 cups-devel.i686 fontconfig-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pkgconfig.i686 libtiff-devel.i686 unixODBC.i686 openldap-devel.i686 alsa-lib-devel.i686 audiofile-devel.i686 freeglut-devel.i686 giflib-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 libXmu-devel.i686 libXxf86dga-devel.i686 libieee1284-devel.i686 libpng-devel.i686 librsvg2-devel.i686 libstdc++-devel.i686 libusb-devel.i686 unixODBC-devel.i686 qt-devel.i686 libpcap-devel.i686 -y 2>&1 >> $log
  49.  
  50. if [[ "${wine2up}" =~ "${vermajor}" ]]; then
  51. # for wine 2 and up
  52. # Thanks to gretzware https://www.systutorials.com/239913/install-32-bit-wine-1-8-centos-7/#comment-157977
  53. yum install gstreamer1-plugins-base-devel.{x86_64,i686} gstreamer1-devel.{x86_64,i686} systemd-devel.{x86_64,i686} -y 2>&1 >> $log
  54.  
  55. # Thanks to gretzware https://www.systutorials.com/239913/install-32-bit-wine-1-8-centos-7/#comment-158134
  56. yum install libXfixes-devel.{x86_64,i686} -y 2>&1 >> $log
  57. fi
  58.  
  59. echo "Download and unpack the wine source package..." 2>&1 | tee -a $log
  60.  
  61. cd /usr/src 2>&1 >> $log
  62. if [[ "${vermajor}" == "1" ]]; then
  63. wget http://dl.winehq.org/wine/source/${verurlstr}/wine-${ver}.tar.bz2 -O wine-${ver}.tar.bz2 2>&1 >> $log
  64. tar xjf wine-${ver}.tar.bz2 2>&1 >> $log
  65. elif [[ "${wine2up}" =~ "${vermajor}" ]]; then
  66. wget http://dl.winehq.org/wine/source/${verurlstr}/wine-${ver}.tar.xz -O wine-${ver}.tar.xz 2>&1 >> $log
  67. tar xf wine-${ver}.tar.xz 2>&1 >> $log
  68. fi
  69.  
  70. echo "Build wine..." 2>&1 | tee -a $log
  71. cd wine-${ver}/ 2>&1 >> $log
  72. mkdir -p wine32 wine64 2>&1 >> $log
  73.  
  74. echo " build wine64..." 2>&1 | tee -a $log
  75. cd wine64 2>&1 >> $log
  76. ../configure --enable-win64 CFLAGS="${CFLAGS}" 2>&1 >> $log
  77. make -j $NPROC 2>&1 >> $log
  78.  
  79. echo " build wine32..." 2>&1 | tee -a $log
  80. cd ../wine32 2>&1 >> $log
  81. PKG_CONFIG_PATH=/usr/lib/pkgconfig ../configure --with-wine64=../wine64 CFLAGS="${CFLAGS}" 2>&1 >> $log
  82. make -j $NPROC 2>&1 >> $log
  83.  
  84. echo "Install wine..." 2>&1 | tee -a $log
  85. echo " install wine32..." 2>&1 | tee -a $log
  86. make install 2>&1 >> $log
  87.  
  88. echo " install wine64..." 2>&1 | tee -a $log
  89. cd ../wine64 2>&1 >> $log
  90. make install 2>&1 >> $log
  91.  
  92. echo "Congratulation! All are done. Enjoy!" 2>&1 | tee -a $log
  93. rm -f $log
  94.  
  95. # # Uninstall
  96. # cd /usr/src/wine-${ver}/wine32
  97. # make uninstall
  98. # cd /usr/src/wine-${ver}/wine64
  99. # make uninstall
RAW Paste Data