wineinstall: Remove a lot of no longer needed code.

This commit is contained in:
Alexandre Julliard 2008-05-22 20:44:18 +02:00
parent 00388c1b6a
commit 70949a6ba5
1 changed files with 85 additions and 197 deletions

View File

@ -21,10 +21,6 @@
#--- defaults (change these if you are a packager) #--- defaults (change these if you are a packager)
CONFARGS="" # configure args, e.g. --prefix=/usr CONFARGS="" # configure args, e.g. --prefix=/usr
prefix=/usr/local # installation prefix
bindir=$prefix/bin # where winelib apps will be (or are) installed
libdir=$prefix/lib # where libwine.so will be (or is) installed
BINDIST=no # whether called from a binary package config script
# functions # functions
@ -32,27 +28,6 @@ function std_sleep {
sleep 1 sleep 1
} }
function conf_question {
# parameters: $1 = importance, $2 = question-id, $3+ = message lines
# the first two parameters can be used by e.g. debconf in debian packages
# but here we just print the message
shift 2
echo
local LINE="$1"
while [ $# -gt 0 ] && shift
do {
echo "$LINE"
LINE="$1"
}
done
}
function conf_reset_question {
# parameters: $1 = question-id
# this is used to flush any cached answers and "already-displayed" flags
shift # dummy command
}
function conf_yesno_answer { function conf_yesno_answer {
unset ANSWER unset ANSWER
while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ] while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ]
@ -63,24 +38,16 @@ function conf_yesno_answer {
done done
} }
function conf_string_answer {
echo -n "$1"
read ANSWER
}
# startup... # startup...
echo "WINE Installer v0.75" echo "Wine Installer v1.0"
echo echo
if [ "$BINDIST" = 'no' ]
then {
if ! [ -f configure ] if ! [ -f configure ]
then { then
if [ -f ../configure ] if [ -f ../configure ]
then { then {
pushd .. cd ..
} }
else { else {
echo "You're running this from the wrong directory." echo "You're running this from the wrong directory."
@ -88,23 +55,20 @@ then {
exit 1 exit 1
} }
fi fi
}
fi fi
if [ `whoami` = 'root' ] if [ `whoami` = 'root' ]
then { then
echo "You are running wineinstall as root, this is not advisable. Please rerun as a user." echo "You are running wineinstall as root, this is not advisable. Please rerun as a user."
echo "Aborting." echo "Aborting."
exit 1 exit 1
}
fi fi
if [ ! -w . ] if [ ! -w . ]
then { then
echo "The source directory is not writable. You probably extracted the sources as root." echo "The source directory is not writable. You probably extracted the sources as root."
echo "You should remove the source tree and extract it again as a normal user." echo "You should remove the source tree and extract it again as a normal user."
exit 1 exit 1
}
fi fi
# check whether RPM installed, and if it is, remove any old wine rpm. # check whether RPM installed, and if it is, remove any old wine rpm.
@ -148,43 +112,25 @@ then {
# run the configure script, if necessary # run the configure script, if necessary
if [ -f config.cache ] && [ -f Makefile ] && [ Makefile -nt configure ] if [ -f Makefile ]
then { then
echo echo "I see that Wine has already been configured, so I'll skip that."
echo "I see that WINE has already been configured, so I'll skip that."
std_sleep std_sleep
# load configure results else
. ./config.cache
}
else {
echo "Running configure..." echo "Running configure..."
echo echo
if ! ./configure -C $CONFARGS --prefix=$prefix if ! ./configure $CONFARGS
then { then {
echo echo
echo "Configure failed, aborting install." echo "Configure failed, aborting install."
rm -f config.cache
exit 1 exit 1
} }
fi 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
}
fi
}
fi fi
# now do the compilation and install, we need to always do this because we # now do the compilation and install, we need to always do this because we
# don't want the 'make install' command we might run to run 'make' as root # don't want the 'make install' command we might run to run 'make' as root
if [ `whoami` != 'root' ]
then {
# ask the user if they want to build and install wine # ask the user if they want to build and install wine
echo echo
echo "We need to install wine as root user, do you want us to build wine," echo "We need to install wine as root user, do you want us to build wine,"
@ -193,63 +139,41 @@ then {
ROOTINSTALL="$ANSWER" ROOTINSTALL="$ANSWER"
if [ "$ROOTINSTALL" = "yes" ] if [ "$ROOTINSTALL" = "yes" ]
then { then sucommand="make install"
# start out with the basic command
sucommand="make install"
# if the user doesn't have $libdir in their ld.so.conf add this
# to our sucommand string
if [ -f /etc/ld.so.conf ]
then
if ! grep -s "$libdir" /etc/ld.so.conf >/dev/null 2>&1
then {
echo
echo "$libdir doesn't exist in your /etc/ld.so.conf, it will be added"
echo "when we perform the install..."
sucommand="$sucommand;echo $libdir>>/etc/ld.so.conf"
}
fi fi
# run ldconfig always just in case some updated files don't get linked
sucommand="$sucommand;$ac_cv_path_LDCONFIG"
fi
}
fi # [ "$ROOTINSTALL" = "yes" ]
echo echo
echo "Compiling Wine. Grab a lunch or two, rent a video, or whatever,"
echo "Compiling WINE. Grab a lunch or two, rent a video, or whatever,"
echo "in the meantime..." echo "in the meantime..."
echo echo
std_sleep std_sleep
# try to just make wine, if this fails 'make depend' and try to remake # try to just make wine, if this fails 'make depend' and try to remake
if ! { make; } if ! { make; }
then { then
if ! { make depend && make; } if ! { make depend && make; }
then { then
echo echo
echo "Compilation failed, aborting install." echo "Compilation failed, aborting install."
exit 1 exit 1
}
fi fi
}
fi fi
if [ "$ROOTINSTALL" = "yes" ] if [ "$ROOTINSTALL" = "no" ]
then { then
exit 0
fi
echo echo
echo "Performing 'make install' as root to install binaries, enter root password" echo "Performing 'make install' as root to install binaries, enter root password"
std_sleep
if ! su root -c "$sucommand" if ! su root -c "$sucommand"
then { then
echo echo
echo "Incorrect root password. If you are running Ubuntu or a similar distribution," echo "Incorrect root password. If you are running Ubuntu or a similar distribution,"
echo "'make install' needs to be run via the sudo wrapper, so trying that one now" echo "'make install' needs to be run via the sudo wrapper, so trying that one now"
if ! sudo su root -c "$sucommand" if ! sudo su root -c "$sucommand"
then { then
echo echo
echo "Either you entered an incorrect password or we failed to" echo "Either you entered an incorrect password or we failed to"
echo "run '$sucommand' correctly." echo "run '$sucommand' correctly."
@ -259,49 +183,13 @@ then {
echo echo
echo "Installation failed, aborting." echo "Installation failed, aborting."
exit 1 exit 1
}
fi fi
}
fi fi
echo
# see if wine is installed on the users system, if not prompt them
# and then exit
if [ -z "`wine --version 2>/dev/null`" ]
then
echo "Could not find wine on your system. Run wineinstall as root to install wine"
echo "before re-running wineinstall as a user."
echo
echo "Exiting wineinstall"
exit 1;
fi
WINEINSTALLED=yes
}
else {
WINEINSTALLED=no
}
fi # [ "$ROOTINSTALL" = "yes" ]
}
fi # [ `whoami` != 'root' ]
}
fi # BINDIST
if [ "$WINEINSTALLED" = 'no' ]
then
tools/wineprefixcreate --use-wine-tree .
else
wineprefixcreate
fi
echo
# it's a wrap # it's a wrap
echo echo
echo "Installation complete for now. Good luck (this is still beta software)." echo "Installation complete."
echo "If you have problems with WINE, please read the documentation first," echo "If you have problems with Wine, please read the documentation first,"
echo "as many kinds of potential problems are explained there." echo "as many kinds of potential problems are explained there."
exit 0 exit 0