2 # WINE Installation script
3 # Can do almost everything from compiling to configuring...
5 # Copyright 1999 Ove Kåven
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #--- defaults (change these if you are a packager)
23 CONFARGS="" # configure args, e.g. --prefix=/usr
31 function conf_yesno_answer {
33 while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ]
43 echo "Wine Installer v1.0"
48 if [ -f ../configure ]
53 echo "You're running this from the wrong directory."
54 echo "Change to the Wine source's main directory and try again."
60 if [ `whoami` = 'root' ]
62 echo "You are running wineinstall as root, this is not advisable. Please rerun as a user."
69 echo "The source directory is not writable. You probably extracted the sources as root."
70 echo "You should remove the source tree and extract it again as a normal user."
74 # check whether RPM installed, and if it is, remove any old wine rpm.
77 if [ $RET -eq 0 ]; then
78 if [ -n "`rpm -qi wine 2>/dev/null|grep "^Name"`" ]; then
79 echo "Warning: Old Wine RPM install detected. Do you want to remove it first?"
80 conf_yesno_answer "(yes/no) "
81 if [ "$ANSWER" = 'yes' ]; then
82 echo "We need to remove the rpm as root, please enter your root password"
84 echo Starting wine rpm removal...
85 su -c "rpm -e wine; RET=$?"
86 if [ $RET -eq 0 ]; then
89 echo "FAILED. Probably you aren't installing as root."
90 echo "Expect problems (library conflicts with existing install etc.)."
93 echo "Sorry, I won't install Wine when an rpm version is still installed."
94 echo "(Wine support suffered from way too many conflicts between RPM"
95 echo "and source installs)"
96 echo "Have a nice day !"
102 # check whether wine binary still available
103 if [ -n "`wine --version 2>/dev/null`" ]
105 echo "Warning !! wine binary (still) found, which may indicate"
106 echo "a (conflicting) previous installation."
107 echo "You might want to abort and uninstall Wine first."
108 echo "(If you previously tried to install from source manually, "
109 echo "run 'make uninstall' from the wine root directory)"
113 # run the configure script, if necessary
117 echo "I see that Wine has already been configured, so I'll skip that."
120 echo "Running configure..."
122 if ! ./configure $CONFARGS
125 echo "Configure failed, aborting install."
131 # now do the compilation and install, we need to always do this because we
132 # don't want the 'make install' command we might run to run 'make' as root
134 # ask the user if they want to build and install wine
136 echo "We need to install wine as root user, do you want us to build wine,"
137 echo "'su root' and install Wine? Enter 'no' to continue without installing"
138 conf_yesno_answer "(yes/no) "
139 ROOTINSTALL="$ANSWER"
141 if [ "$ROOTINSTALL" = "yes" ]
142 then sucommand="make install"
146 echo "Compiling Wine. Grab a lunch or two, rent a video, or whatever,"
147 echo "in the meantime..."
151 # try to just make wine, if this fails 'make depend' and try to remake
154 if ! { make depend && make; }
157 echo "Compilation failed, aborting install."
162 if [ "$ROOTINSTALL" = "no" ]
168 echo "Performing 'make install' as root to install binaries, enter root password"
170 if ! su root -c "$sucommand"
173 echo "Incorrect root password. If you are running Ubuntu or a similar distribution,"
174 echo "'make install' needs to be run via the sudo wrapper, so trying that one now"
175 if ! sudo su root -c "$sucommand"
178 echo "Either you entered an incorrect password or we failed to"
179 echo "run '$sucommand' correctly."
180 echo "If you didn't enter an incorrect password then please"
181 echo "report this error and any steps to possibly reproduce it to"
182 echo "http://bugs.winehq.org/"
184 echo "Installation failed, aborting."
191 echo "Installation complete."
192 echo "If you have problems with Wine, please read the documentation first,"
193 echo "as many kinds of potential problems are explained there."