Sweden-Number/tools/wineinstall

200 lines
4.1 KiB
Bash
Executable File

#!/bin/bash
# WINE Installation script
# Mar 31 1999 - Ove Kåven
# First version
# Dec 9 1999 - Ove Kåven
# require Xpm
# Feb 25 2000 - Ove Kåven
# auto-add /usr/local/lib to /etc/ld.so.conf
# Mar 2 2000 - Ove Kåven
# source rather than grep config.cache
# use sourced config.cache to start ldconfig
# reconfigure if config.cache doesn't exist
# defaults
sysconfdir=/usr/local/etc
DOCONF=auto
DOREG=yes
# startup...
echo "WINE Installer v0.2"
echo
if ! [ -f configure ]
then {
echo "You're running this from the wrong directory."
echo "Change to the Wine directory and try again."
exit 1
}
fi
# run the configure script, if necessary
if [ -f config.cache ] && [ -f Makefile ] && [ Makefile -nt configure ]
then {
echo "I see that WINE has already been configured, so I'll skip that."
# load configure results
. ./config.cache
}
else {
# we'll run with defaults (we need libwine.a later)
echo "Running configure..."
echo
if ! ./configure
then {
echo
echo "Configure failed, aborting install."
rm -f config.cache
exit 1
}
fi
# load configure results
. ./config.cache
# make sure X was found
eval "$ac_cv_have_x"
if [ "$have_x" != "yes" ]
then {
echo "Install the X development headers and try again."
rm -f config.cache
exit 1
}
elif [ "$ac_cv_header_X11_xpm_h" != "yes" ]
then {
echo "Install the Xpm development headers and try again."
rm -f config.cache
exit 1
}
fi
}
fi
# now do the compilation
if [ -f wine ] && [ wine -nt Makefile ]
then {
echo "Hmm, looks like WINE is already compiled. I'll skip that too, I guess."
}
else {
echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever, in the meantime..."
echo
if ! { make depend && make; }
then {
echo
echo "Compilation failed, aborting install."
exit 1
}
fi
echo
}
fi
# and installation, if root
if [ `whoami` != 'root' ]
then {
echo "You aren't root, so I'll skip the make install."
}
else {
echo "Now installing binaries onto the system..."
echo
if ! make install
then {
echo
echo "Installation failed, aborting."
exit 1
}
fi
if [ -f /etc/ld.so.conf ] && ! grep -qs "/usr/local/lib" /etc/ld.so.conf
then {
echo
echo "/usr/local/lib didn't exist in your /etc/ld.so.conf, adding it now..."
echo /usr/local/lib >>/etc/ld.so.conf
echo "Re-running ldconfig..."
eval "$ac_cv_path_LDCONFIG"
}
fi
}
fi
echo
# now check whether we should generate wine.conf
if [ -z "$DOCONF" ]
then DOCONF=auto
fi
if [ "$DOCONF" = 'auto' ]
then {
# see if we already have a system wine.conf
if [ -f $sysconfdir/wine.conf ] || [ -f /etc/wine.conf ]
then DOCONF=no
fi
}
fi
if [ "$DOCONF" != 'no' ]
then {
if [ `whoami` != 'root' ]
then {
CONF=~/.winerc
if ! [ -f $CONF ]
then {
if [ "$DOCONF" != 'yes' ]
then {
echo "Since you aren't root, and there's no system wine.conf, I assume"
echo "you want a user-specific .winerc. Am I correct? (yes/no)"
while [ "$DOCONF" != 'yes' ] && [ "$DOCONF" != 'no' ]
do read DOCONF
done
}
fi
if [ "$DOCONF" = 'no' ]
then echo "Skipping generation of .winerc."
fi
}
fi
}
else {
CONF=$sysconfdir/wine.conf
mkdir -p $sysconfdir
DOCONF=yes
}
fi
}
fi
if [ "$DOCONF" = 'yes' ]
then {
echo "Now automatically generating $CONF for you..."
echo
tools/wineconf > $CONF
echo
echo "Done. You probably want to review the file, though."
}
fi
echo
# install default registry entries
if [ "$DOREG" = 'yes' ]
then {
echo "Compiling regapi..."
echo
(cd programs/regapi; make)
echo
echo "Installing default registry entries, please wait..."
echo
if ! programs/regapi/regapi setValue < winedefault.reg
then {
echo
echo "Registry install failed. Perhaps you weren't running X."
exit 1
}
fi
# FIXME: perhaps install registry to $sysconfdir/winesystem.reg and $sysconfdir/wineuser.reg?
}
fi
echo
echo "Installation complete for now. Good luck (this is still alpha software)."
echo "If you have problems with WINE, please read the documentation first."