Wine Install

Here are some scripts I use to install Wine from source on 64 bit Linux with little interaction. Tested on Ubuntu 9.04 with Wine 1.1.30 and a number of prior versions. Use at your own risk. Note: if you have any existing installation of Wine that is not installed with this script, uninstall that manually first.

Run wine-getlatest.sh in a suitable directory to install the latest Wine (it will not work if there's no Wine installed, then use wine-install.sh instead). You may need to import a signature into your GPG keyring.

Some retouches could of course be done to the scripts. :-) But right now I don't care.

References

Helper scripts

wine-fix.sh :

#!/bin/bash
mkdir -p `pwd`/lib32
ln -s /usr/lib32/libX11.so.6 `pwd`/lib32/libX11.so
ln -s /usr/lib32/libXext.so.6 `pwd`/lib32/libXext.so
ln -s /usr/lib32/libfreetype.so.6 `pwd`/lib32/libfreetype.so
ln -s /usr/lib32/libfontconfig.so.1 `pwd`/lib32/libfontconfig.so
ln -s /usr/lib32/libGL.so.1 `pwd`/lib32/libGL.so
ln -s /usr/lib32/libGLU.so.1 `pwd`/lib32/libGLU.so
ln -s /usr/lib32/libXrender.so.1 `pwd`/lib32/libXrender.so
ln -s /usr/lib32/libXinerama.so.1 `pwd`/lib32/libXinerama.so
ln -s /usr/lib32/libXxf86vm.so.1 `pwd`/lib32/libXxf86vm.so
ln -s /usr/lib32/libXi.so.6 `pwd`/lib32/libXi.so
ln -s /usr/lib32/libXrandr.so.2 `pwd`/lib32/libXrandr.so
ln -s /usr/lib32/liblcms.so.1 `pwd`/lib32/liblcms.so
ln -s /usr/lib32/libpng12.so.0 `pwd`/lib32/libpng.so
ln -s /usr/lib32/libcrypto.so.0.9.8 `pwd`/lib32/libcrypto.so
ln -s /usr/lib32/libssl.so.0.9.8 `pwd`/lib32/libssl.so
ln -s /usr/lib32/libxml2.so.2 `pwd`/lib32/libxml2.so
ln -s /usr/lib32/libjpeg.so.62 `pwd`/lib32/libjpeg.so
ln -s /usr/lib32/libXcomposite.so.1 `pwd`/lib32/libXcomposite.so
ln -s /usr/lib32/libcups.so.2 `pwd`/lib32/libcups.so
ln -s /usr/lib32/libXcursor.so.1 `pwd`/lib32/libXcursor.so

# manual hack, is correct?
ln -s /usr/lib32/libdbus-glib-1.so.2.1.0 `pwd`/lib32/libdbus-1.so

ln -s /usr/lib32/libhal.so.1 `pwd`/lib32/libhal.so
ln -s /usr/lib32/libsane.so.1 `pwd`/lib32/libsane.so
ln -s /usr/lib32/libgphoto2.so.2 `pwd`/lib32/libgphoto2.so
ln -s /usr/lib32/libgphoto2_port.so.0 `pwd`/lib32/libgphoto2_port.so
ln -s /usr/lib32/libldap-2.4.so.2 `pwd`/lib32/libldap.so
ln -s /usr/lib32/libldap_r-2.4.so.2 `pwd`/lib32/libldap_r.so
ln -s /usr/lib32/liblber-2.4.so.2 `pwd`/lib32/liblber.so
ln -s /usr/lib32/libxslt.so.1 `pwd`/lib32/libxslt.so
ln -s /usr/lib32/libcapi20.so.3 `pwd`/lib32/libcapi20.so
ln -s /usr/lib32/libjack.so.0 `pwd`/lib32/libjack.so
ln -s /usr/lib32/libodbc.so.1 `pwd`/lib32/libodbc.so

ls --color=auto -l lib32

for FILE in `ls lib32/*`
do
  if [ ! -e "$FILE" ]
  then
    echo $FILE
    exit 1
  fi
done

wine-fix2.sh :

#!/bin/bash
CC="gcc-4.3 -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -L`pwd`/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure -v
make
sudo make install

Install scripts

wine-install.sh :

#!/bin/bash

INSTALL_VERSION="$1"

if [ "$INSTALL_VERSION" == "" ]
then                           
  echo "Usage: $0 <install version>"
  exit                              
fi                                  

cd /home/vuorio/Desktop/Wine
pushd .                     

[ -e "wine-$INSTALL_VERSION.tar.bz2" ] || /usr/bin/wget "http://prdownloads.sourceforge.net/wine/wine-$INSTALL_VERSION.tar.bz2" || {
  echo "Could not download source."                                                                                                 
  exit                                                                                                                              
}                                                                                                                                   

[ -e "wine-$INSTALL_VERSION.tar.bz2.sign" ] || /usr/bin/wget "http://prdownloads.sourceforge.net/wine/wine-$INSTALL_VERSION.tar.bz2.sign" || {
  echo "Could not download signature."
  exit
}

gpg --verify "wine-$INSTALL_VERSION.tar.bz2.sign" || {
  echo "Could not verify signature..."
  exit
}

[ -e "wine-$INSTALL_VERSION" ] || /bin/tar xjf "wine-$INSTALL_VERSION.tar.bz2" || {
  echo "Could not unpack..."
  exit
}

WINE_BIN=`which wine`

if [ "$WINE_BIN" != "" ]
then
  # Uninstall ...

  WINE_VERSION=`wine --version` # includes wine- prefix

  cd "$WINE_VERSION" && /usr/bin/sudo make uninstall || {
    echo "Could not uninstall old wine."
    exit
  }
fi

# Install ...

popd

cd "wine-$INSTALL_VERSION" || {
  echo "Dir not found..."
  exit
}

/bin/bash ../wine-fix.sh || {
  echo "Broken symlink or whatever."
  exit
}

/bin/bash ../wine-fix2.sh || {
  echo "Failed install."
  exit
}

wine-getlatest.sh :

#!/bin/bash

RSS_DATA=`wget -o /dev/null -O - "http://www.winehq.org/news/rss/"`
FIRST_RELEASE_TITLE=`echo -n "$RSS_DATA" | grep "<title>Wine .* Released</title>" | head -1`
LATEST_RELEASE=`echo -n "$FIRST_RELEASE_TITLE" | grep -o "Wine .* Released" | grep -o " .* " | sed 's/ //g'`

# echo $RSS_DATA
#echo $FIRST_RELEASE_TITLE

INSTALLED_VERSION=`wine --version | sed 's/wine-//'`

if [ $? -eq 0 ]
then
  echo "The latest Wine release seems to be $LATEST_RELEASE."
  echo "The installed version is $INSTALLED_VERSION."
else
  echo "Wine not installed?"
  exit
fi

if [ "$INSTALLED_VERSION" != "$LATEST_RELEASE" ]
then
  echo "Run update? [Y/N]"
  echo
  read KEY

  if [ "$KEY" == "y" -o "$KEY" == "Y" ]
  then
    DIR=`dirname $0`
    CMD="$DIR/wine-install.sh $LATEST_RELEASE"
    echo "Running: $CMD"
    exec $CMD
  else
    echo "Not updating."
  fi
else
  echo "No update needed."
fi
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License