#!/bin/sh
# Script to download and install wine
# Run this in an empty directory

set -ex

echo "This script will prompt for a cvs password.  When it does, enter 'cvs'."
sleep 2

test -f wine-0.9.5.tar.bz2 || wget http://ibiblio.org/pub/linux/system/emulators/wine/wine-0.9.5.tar.bz2
tar  -xjf wine-0.9.5.tar.bz2
rm -rf wine
mv wine-0.9.5 wine
test -f wine-cvsdirs-0.9.5.tar.gz || wget ftp://ftp.winehq.org/pub/wine/wine-cvsdirs-0.9.5.tar.gz
tar  -xzf wine-cvsdirs-0.9.5.tar.gz
cd wine
export CVSROOT=:pserver:cvs@cvs.winehq.org:/home/wine
echo "Here's where you have to enter 'cvs':"
cvs login 
cvs update -PAd
cvs update -PAd
./configure --prefix=/usr/local/wine-0.9.5 > configure.log.txt 2>&1
make depend  > depend.log 2>&1
make > make.log 2>&1
cd ..

echo Done.  

