Cleanup the introduction a bit.
[wine] / documentation / getting.sgml
1   <chapter id="getting-wine">
2     <title>Getting Wine</title>
3     <para>
4       If you decided that you can use and want to use Wine (e.g. after
5       having read the <link linkend="introduction">introductory
6       chapter</link>), then as a first step you need to find a good
7       compatible Wine version that you like and that works on your
8       system, and after you found one, the next step is to transfer its
9       files to your system somehow.
10       This chapter is here to tell you what you need to take care of
11       in order to successfully accomplish these two steps.
12     </para>
13
14     <sect1 id="getting-download">
15       <title>How to download Wine?</title>
16       <para>
17         There are three different methods of how the files
18         belonging to Wine may be brought (downloaded) to your system:
19         <itemizedlist>
20           <listitem>
21           <para>
22             Getting a single Wine <glossterm>package</glossterm> file
23             (specifically adapted to your particular system), which
24             contains various <glossterm>binary</glossterm> files of Wine
25           </para>
26           </listitem>
27           <listitem>
28           <para>
29             Getting a single compressed archive file (usually .tar.gz), which contains
30             all <glossterm>source code</glossterm> files of a standard Wine
31             release version
32           </para>
33           </listitem>
34           <listitem>
35           <para>
36             Downloading from a <glossterm>CVS</glossterm> server,
37             which contains the very latest development source code files
38             of Wine
39           </para>
40           </listitem>
41         </itemizedlist>
42       </para>
43
44       <sect2 id="getting-which-wine">
45         <title>Which Wine form should I pick?</title>
46
47         <para>
48          Now that we told you about the different Wine distribution
49          methods available, let's discuss the advantages and
50          disadvantages of the various methods.
51         </para>
52
53         <variablelist>
54           <title>Wine distribution methods</title>
55           <varlistentry>
56             <term><emphasis>Wine package file</emphasis></term>
57
58             <listitem>
59               <para>
60                 Intended user level: Beginner to Advanced
61               </para>
62
63               <para>
64                 Using Wine package files is easy for three
65                 reasons:
66                 They install everything else that's needed for their
67                 operation, they usually preconfigure a lot, and you
68                 don't need to worry about compiling anything or so.
69                 However, the Wine Team doesn't have "official" packages.
70                 All Wine packages are being offered by external groups,
71                 with often slightly inaccurate or quite inaccurate Wine
72                 environment setup.
73                 Also, a package you downloaded might turn out to be
74                 partially incompatible with your particular system
75                 configuration.
76                 Thus it might actually be <emphasis>better</emphasis>
77                 to compile Wine from source and completely install it
78                 on your own, by following the instructions in this
79                 Guide.
80               </para>
81             </listitem>
82           </varlistentry>
83           <varlistentry>
84             <term><emphasis>Wine source code via archive file</emphasis></term>
85
86             <listitem>
87
88               <para>
89                 Intended user level: Advanced to Expert
90               </para>
91
92               <para>
93                 A Wine source code archive file can be used
94                 if you want to compile your own standard Wine release.
95                 By using differential patch files to newer Wine versions,
96                 you can easily upgrade your outdated Wine directory.
97                 However, as you need to manually download patch files
98                 and you're only able to download the most current
99                 standard Wine release, this is not necessarily the
100                 best method to use.
101                 The only advantage a Wine source archive has is that it
102                 is a standard Wine release with less development
103                 "quirks" than current CVS code.  Except for that, CVS
104                 source code is much preferred and almost as easy.
105               </para>
106             </listitem>
107           </varlistentry>
108           <varlistentry>
109             <term><emphasis>Wine source code via CVS checkout</emphasis></term>
110             <listitem>
111               <para>
112                 Intended user level: Advanced to Expert/Developer
113               </para>
114
115               <para>
116                 The Wine CVS checkout offers the best way to take
117                 part in bleeding edge Wine capabilities and
118                 development, since you'll be able to download every
119                 single CVS commit even <emphasis>beyond</emphasis> the
120                 last official Wine release.
121                 As upgrading a Wine CVS checkout tree to the latest
122                 version is very easy, this is a recommended method
123                 of installing Wine.
124                 Plus, by carefully following the instructions in this
125                 Guide, you'll be able to gain the very best Wine
126                 environment compatibility (instead of falling victim
127                 to package maintainers who fail to follow some
128                 instructions in the Wine Packagers Guide).
129               </para>
130             </listitem>
131           </varlistentry>
132         </variablelist>
133         
134         <para>
135           To summarize, the "best" way to install Wine is to download
136           Wine source code via CVS to get the newest code (which might
137           be unstable!). Then you could easily compile and install the
138           Wine files manually. The final configuration part (writing the
139           configuration file and setting up the drive environment) could then
140           be handled by WineSetupTk. All in all the best way to go,
141           except for the about 500MB of disk space that you'll need.
142         </para>
143         
144         <para>
145           With source code archive files, you have the advantage that you're
146           running standard release versions, plus you can update to
147           newer versions via patch files that we release.
148           You won't have the newest code and the flexibility offered by CVS,
149           though.
150         </para>
151
152         <para>
153           About binary package files: not sure. There's about a zillion
154           reasons to not like them as much as you'd think: they may be
155           outdated, they may not include "everything", they are
156           <emphasis>not</emphasis> optimized for your particular
157           environment (as opposed to a source compile, which would guess
158           and set everything based on your system), they frequently fail
159           to provide a completely configured Wine environment.
160           On the plus side: they're pretty easy to install and they
161           don't take as much space as a full-blown source code compile.
162           But that's about it when it comes to their advantages.
163           So I'd say they are OK if you want to have a
164           <emphasis>quick</emphasis> way to have a test run of Wine, but
165           for prolonged Wine use, configuring the environment on your
166           own is probably better.
167           Eventually this will change (we'll probably do some packaging
168           efforts on our own at some time), but at the current explosive
169           rate of Wine development, staying as close as possible to the
170           actual Wine development that's going on is the way to go.
171         </para>
172
173         <para>
174           If you are running a distribution of Linux or some other
175           system that uses packages to keep track of installed software,
176           you should be in luck: A prepackaged version of Wine
177           should already exist for your system.
178           The following sections will tell you how to find the latest
179           Wine packages and get them installed.  You should be careful,
180           though, about mixing system packages between different distributions,
181           and even from different versions of the same distribution.
182           Often a package will only work on the distribution which it
183           has been compiled for.  We'll cover
184           <link linkend="getting-dist-debian">Debian Linux</link>, 
185           <link linkend="getting-dist-redhat">Red Hat Linux</link>,
186           <link linkend="getting-freebsd">FreeBSD</link>, and 
187           <link linkend="getting-other">other</link> distributions.
188         </para>
189         <para>
190           If you're not lucky enough to have a package available for
191           your operating system, or if you'd prefer a newer version of
192           Wine than already exists as a package, you will need to
193           download the Wine source code and compile it yourself on your
194           own machine.  Don't worry, it's not too hard to do this,
195           especially with the many helpful tools that come with Wine.
196           You don't need any programming experience to compile and
197           install Wine, although it might be nice to have some minor
198           UNIX administrative skills.  Working from the source is
199           covered in the Wine Developer's Guide.
200           The main problem with externally maintained package files is
201           that they lack a standard configuration method, and in fact
202           they often fail to configure Wine's Windows environment
203           properly (which is outlined in the Wine Packagers Guide).
204         </para>
205       </sect2>
206
207     </sect1>
208
209     <sect1 id="getting-wine-package">
210       <title>Getting a Wine package</title>
211       <sect2 id="getting-dist-debian">
212         <title>Debian Linux</title>
213
214         <para>
215           In most cases on a Debian system (or any other distribution that
216         uses packages that use the file name ending .deb, for that
217         matter), you can download and install Wine with a
218           single command, as <glossterm>root</glossterm>:
219         </para>
220   <screen>
221   <prompt># </><userinput>apt-get install wine</>
222   </screen>
223         <para>
224           <command>apt-get</command> will connect to a Debian archive
225           across the Internet (thus, you must be online), then download
226           the Wine package and install it on your system. End of story.
227           You might first need to properly update your package setup,
228           though, by using an <glossterm>editor</glossterm> as
229           <glossterm>root</glossterm> to add an entry to
230           <filename>/etc/apt/sources.list</filename> to point to an active
231           package server and then running <command>apt-get
232           update</command>.
233         </para>
234         <para>
235           Once you're done with that step, you may skip the Wine
236           installation chapter, since apt-get has not only downloaded,
237           but also installed the Wine files already.
238           Thus you can now go directly to the <link
239           linkend="config-wine-main">Configuration section</link>.
240         </para>
241
242         <para>
243           However, if you don't want to or cannot use the automatic
244           download method for .deb packages that
245           <command>apt-get</command> provides, then please read on.
246         </para>
247         <para>
248           Of course, Debian's pre-packaged version of Wine may not be
249           the most recent release.  If you are running the stable
250           version of Debian, you may be able to get a slightly newer
251           version of Wine by grabbing the package from the so-called
252           "unstable" Debian distribution, although this may be a little
253           risky, depending on how far the unstable distribution has
254           diverged from the stable one.  You can find a list of Wine
255           binary packages for the various Debian releases using the
256           package search engine at <ulink
257           url="http://www.debian.org">www.debian.org</ulink>.
258         </para>
259
260         <para>
261           If you downloaded a separate .deb package file (e.g. a newer
262           Wine release as stated above) that's not part of your
263           distribution and thus cannot be installed via
264           <command>apt-get</command>, you must use <command>dpkg</command> instead.
265           For instructions on how to do this, please proceed to the
266           <link linkend="installing">Installation section</link>.
267         </para>
268       </sect2>
269
270       <sect2 id="getting-dist-redhat">
271         <title>Red Hat Linux</title>
272
273         <para>
274           Red Hat users can use the
275           <ulink url="http://sourceforge.net/project/showfiles.php?group_id=6241">
276           sourceforge.net Wine page</ulink> to get the RPM most suitable for
277           their system.
278         </para>
279       </sect2>
280
281       <sect2 id="getting-freebsd">
282         <title>FreeBSD</title>
283
284         <para>
285         In order to use Wine you need to build and install a new kernel
286         with options USER_LDT, SYSVSHM, SYSVSEM, and SYSVMSG.
287         </para>
288
289         <para>
290         If you want to install Wine using the FreeBSD port system, run
291         in a <glossterm>terminal</glossterm>:
292         </para>
293   <screen>
294   <prompt>$ </><userinput>su -</>
295   <prompt># </><userinput>cd /usr/port/emulators/</>
296   <prompt># </><userinput>make</>
297   <prompt># </><userinput>make install</>
298   <prompt># </><userinput>make clean</>
299   </screen>
300         <para>
301           This process will get wine source from the Internet,
302           then download the Wine package and install it on your system.
303         </para>
304
305         <para>
306         If you want to install Wine from the FreeBSD CD-ROM, run in a
307         <glossterm>terminal</glossterm>:
308         </para>
309   <screen>
310   <prompt>$ </><userinput>su -</>
311   <prompt># </><userinput>mount /cdrom</>
312   <prompt># </><userinput>cd /cdrom/packages/All</>
313   <prompt># </><userinput>pkg_add wine_.X.X.X.tgz</>
314   </screen>
315          <para>
316          </para>
317          <para>
318            These FreeBSD install instructions completely install the
319            Wine files on your system; you may then proceed to the <link
320            linkend="config-wine-main">Configuration section</link>.
321          </para>
322       </sect2>
323
324       <sect2 id="getting-other">
325         <title>Other systems</title>
326
327         <para>
328           The first place you should look if your system isn't
329           specifically mentioned above is the <ulink
330           url="http://www.winehq.com/download/">WineHQ Download
331           Page</ulink>.  This page lists many assorted archives of
332           binary (precompiled) Wine files.
333         </para>
334
335         <para>
336           You could also try to use
337           <ulink url="http://www.google.com/search?q=wine+package+download">
338             Google</ulink> to track down miscellaneous distribution packages.
339         </para>
340
341         <note>
342         <para>
343           If you are running a Mandrake system, please see the page
344           on how to get Wine for a 
345           <link linkend="getting-dist-redhat">Red Hat</link> system,
346           as Mandrake is based on Red Hat.
347         </para>
348         </note>
349
350       </sect2>
351       <!-- *** Add other distributions, e.g., SuSE, Slackware *** -->
352
353     </sect1>
354
355     <sect1 id="getting-wine-source">
356       <title>Getting Wine source code</title>
357
358       <para>
359         If you are going to compile Wine (instead of installing binary
360         Wine files), either to use the most recent code possible or to
361         improve it, then the first thing to do is to obtain a copy of
362         the source code. We'll cover how to retrieve and compile the
363         official source releases from the <link
364         linkend="getting-source-ftp">FTP archives</link>, and also how
365         to get the cutting edge up-to-the-minute fresh Wine source code
366         from <link linkend="getting-source-cvs">CVS (Concurrent Versions
367         System)</link>.
368       </para>
369
370       <para>
371         Once you have downloaded Wine source code according to the
372         instructions below, there are two ways to proceed: If you want
373         to manually install and configure Wine, then go to the <link
374         linkend="compiling">Compiling</link> section. If instead you
375         want automatic installation, then go straight to the <link
376         linkend="config-wine-main">Configuration section</link> to make
377         use of <command>wineinstall</command> to automatically install
378         and configure Wine.
379       </para>
380
381       <para>
382         You may also need to know how to apply a source code patch to
383         your version of Wine.  Perhaps you've uncovered
384         a bug in Wine, reported it to the
385         <ulink url="http://bugs.winehq.org">Wine Bugzilla</ulink>
386         or the
387         <ulink url="mailto:wine-devel@winehq.com">Wine mailing list</ulink>,
388         and received a patch from a developer to hopefully fix the
389         bug.  We will show you how to
390         <link linkend="getting-upgrading-patch">safely apply the
391         patch</link> and revert it if it doesn't work.
392       </para>
393
394       <sect2 id="getting-source-ftp">
395         <title>Getting Wine Source Code from an FTP Archive</title>
396
397         <para>
398           The safest way to grab the source is from one of the official
399           FTP archives.  An up to date listing is in the <ulink
400           url="http://www.winehq.com/source/ANNOUNCE">ANNOUNCE</ulink>
401           file in the Wine distribution (which you would have if you
402           already downloaded it).  Here is a list
403           of FTP servers carrying Wine:
404         </para>
405         <itemizedlist>
406           <listitem>
407             <para>
408               <ulink url="ftp://ftp.ibiblio.org/pub/Linux/ALPHA/wine/development/">
409                 ftp://ftp.ibiblio.org/pub/Linux/ALPHA/wine/development/
410               </ulink>
411             </para>
412           </listitem>
413           <listitem>
414             <para>
415               <ulink url="http://prdownloads.sourceforge.net/wine/">
416                 http://prdownloads.sourceforge.net/wine/
417               </ulink>
418             </para>
419           </listitem>
420         </itemizedlist>
421         <para>
422           The official releases are tagged by date with the format
423           "Wine-<replaceable>YYYYMMDD</>.tar.gz".  Your best bet is to grab
424           the latest one.
425         </para>
426         <para>
427           I'd recommend placing the Wine archive file that you chose
428           into the directory where you intend to extract Wine. In this
429           case, let's just assume that it is your home directory.
430         </para>
431         <para>
432           Once you have downloaded a Wine archive file, we need to
433           extract the archive file. This is not very hard to do. First
434           switch to the directory containing the file you just
435           downloaded. Then extract the source in a
436           <glossterm>terminal</glossterm> with (e.g.):
437   <screen>
438   <prompt>$ </><userinput>tar xvzf wine-<replaceable>20030115</>.tar.gz</>
439   </screen>
440         </para>
441         <para>
442           Just in case you happen to get a Wine archive that uses
443           <filename>.tar.bz2</filename> extension instead of
444           <filename>.tar.gz</filename>:
445           Simply use <command>tar xvjf</command> in that case instead.
446         </para>
447         <para>
448           Since you now have a fully working Wine source tree by
449           having followed the steps above, you're now well-prepared to
450           go to the Wine installation and configuration steps that follow.
451         </para>
452       </sect2>
453
454       <sect2 id="getting-source-cvs">
455         <title>Getting Wine Source Code from CVS</title>
456         <!-- this part is sort of duplicated in cvs.sgml
457              (this representation is meant to be a very short intro
458              instead, but it's similar). Please don't forget to update both!
459         -->
460
461         <para>
462           This part is intended to be quick and easy, showing the bare minimum
463           of what is needed to download Wine source code via CVS.
464           If you're interested in a very verbose explanation of CVS or
465           advanced CVS topics (configuration settings, CVS mirror servers,
466           other CVS modules on WineHQ, CVSWeb, ...), then please read
467           the full CVS chapter in the Wine Developer's Guide.
468         </para>
469
470         <sect3>
471           <title>CVS installation check</title>
472           <para>
473             First you need to make sure that you have <command>cvs</command>
474             installed.
475             To check whether this is the case, please run in a
476             <glossterm>terminal</glossterm>:
477           </para>
478   <screen>
479   <prompt>$ </><userinput>cvs</>
480   </screen>
481           <para>
482             If this was successful, then you should have gotten a nice CVS
483             "Usage" help output.  Otherwise (e.g. an error "cvs: command
484             not found") you still need to install a CVS package for your
485             particular operating system, similar to the instructions given
486             in the chapters for getting and installing a Wine package on
487             various systems.
488           </para>
489         </sect3>
490
491         <sect3>
492           <title>Configuring Wine-specific CVS settings</title>
493
494           <para>
495             First, you should do a
496           </para>
497   <screen>
498   <prompt>$ </><userinput>touch ~/.cvspass</>
499   </screen>
500           <para>
501             to create or update the file <filename>.cvspass</filename> in
502             your home directory, since CVS needs this file (for password
503             and login management) and will complain loudly if it doesn't exist.
504           </para>
505
506           <para>
507             Second, we need to create the file
508             <filename>.cvsrc</filename> in your home directory
509             containing the CVS configuration settings needed for a valid
510             Wine CVS setup (use CVS compression, properly update file and
511             directory information, ...).
512             The content of this file should look like the following:
513             <programlisting>
514 cvs -z 3
515 update -PAd
516 diff -u
517 checkout -P
518             </programlisting>
519             Create the file with an <glossterm>editor</glossterm>
520             of your choice, either by running
521   <screen>
522   <prompt>$ </><userinput>&lt;editor&gt; ~/.cvsrc</>
523   </screen>
524             , where &lt;editor&gt; is the editor you want to use (e.g.
525             <command>joe</command>, <command>ae</command>,
526             <command>vi</command>),
527             or by creating the file <filename>.cvsrc</filename> in your
528             home directory with your favorite graphical editor like nedit, kedit,
529             gedit or others.
530           </para>
531         </sect3>
532
533         <sect3>
534           <title>Downloading the Wine CVS tree</title>
535
536           <para>
537             Once CVS is installed and the Wine specific CVS
538             configuration is done, you can now do a login on our CVS
539             server and checkout (download) the Wine source code.
540             First, let's do the server login:
541           </para>
542   <screen>
543   <prompt>$ </><userinput>cvs -d :pserver:cvs@cvs.winehq.com:/home/wine login</>
544   </screen>
545           <para>
546             If <command>cvs</command> successfully connects to the CVS server,
547             then you will get a "CVS password:" prompt.
548             Simply enter "cvs" as the password (the password is
549             <emphasis>case sensitive</emphasis>: no capital letters!).
550           </para>
551
552           <para>
553             After login, we are able to download the Wine source code tree.
554             Please make sure that you are in the directory that you want
555             to have the Wine source code in (the Wine source code will
556             use the subdirectory <filename>wine/</filename> in this
557             directory, since the subdirectory is named after the CVS module
558             that we want to check out). We assume that your current directory
559             might be your user's home directory.
560             To download the Wine tree into the subdirectory <filename>wine/</filename>, run:
561           </para>
562   <screen>
563   <prompt>$ </><userinput>cvs -d :pserver:cvs@cvs.winehq.com:/home/wine checkout wine</>
564   </screen>
565           <para>
566             Downloading the CVS tree might take a while (some minutes
567             to few hours), depending on your connection speed.
568             Once the download is finished, you should keep a note of
569             which directory the newly downloaded
570             <filename>wine/</filename> directory is in, by running
571             <command>pwd</command> (Print Working Directory):
572           </para>
573   <screen>
574   <prompt>$ </><userinput>pwd</>
575   </screen>
576           <para>
577             Later, you will be able to change to this directory by
578             running:
579           </para>
580   <screen>
581   <prompt>$ </><userinput>cd <replaceable>&lt;some_dir&gt;</></>
582   </screen>
583           <para>
584             , where &lt;some_dir&gt; is the directory that
585             <command>pwd</command> gave you.
586             By running
587           </para>
588   <screen>
589   <prompt>$ </><userinput>cd wine</>
590   </screen>
591           <para>
592             , you can now change to the directory of the Wine CVS tree
593             you just downloaded. Since you now have a fully working Wine
594             source tree by having followed the steps above, you're now
595             well-prepared to go to the Wine installation and configuration
596             steps that follow.
597           </para>
598         </sect3>
599       </sect2>
600
601       <sect2 id="getting-updating-cvs">
602         <title>Updating the Wine CVS tree</title>
603
604         <para>
605           After a while, you might want to update your Wine CVS tree to
606           the current version.
607           Before updating the Wine tree, it might also be a good idea
608           to run <command>make uninstall</command> as root in order to
609           uninstall the installation of the previous Wine version.
610         </para>
611         <para>
612           To proceed with updating Wine, simply <command>cd</command>
613           to the Wine CVS tree directory, then run:
614         </para>
615   <screen>
616   <prompt>$ </><userinput>make distclean</>
617   <prompt>$ </><userinput>cvs -d :pserver:cvs@cvs.winehq.com:/home/wine update</>
618   </screen>
619         <para>
620           The <command>make distclean</command> part is optional, but
621           it's a good idea to remove old build and compile configuration
622           files before updating to a newer Wine version.  Once the CVS
623           update is finished, you can proceed with installing Wine again
624           as usual.
625         </para>
626       </sect2>
627
628       <sect2 id="getting-upgrading-patch">
629         <title>Updating Wine with a Patch</title>
630         <para>
631           If you got Wine source code (e.g. via a tar archive file), you
632           have the option of applying patches to the source tree to
633           update to a newer Wine release or to fix bugs and add
634           experimental features.  Perhaps you've found a bug, reported
635           it to the <ulink url="mailto:wine-devel@winehq.com">Wine
636           mailing list</>, and received a patch file to fix the bug.
637           You can apply the patch with the <command>patch</> command,
638           which takes a streamed patch from <filename>stdin</>:
639   <screen>
640   <prompt>$ </><userinput>cd wine</>
641   <prompt>$ </><userinput>patch -p0 &lt;<replaceable>../patch_to_apply.diff</></>
642   </screen>
643         </para>
644         <para>
645           To remove the patch, use the <parameter>-R</> option:
646   <screen>
647   <prompt>$ </><userinput>patch -p0 -R &lt;<replaceable>../patch_to_apply.diff</></>
648   </screen>
649         </para>
650         <para>
651           If you want to do a test run to see if the patch will apply
652           successfully (e.g., if the patch was created from an older or
653           newer version of the tree), you can use the
654           <parameter>--dry-run</> parameter to run the patch
655           without writing to any files:
656   <screen>
657   <prompt>$ </><userinput>patch -p0 --dry-run &lt;<replaceable>../patch_to_apply.diff</></>
658   </screen>
659         </para>
660         <para>
661           <command>patch</> is pretty smart about extracting
662           patches from the middle of a file, so if you save an email with
663           an inlined patch to a file on your hard drive, you can invoke
664           patch on it without stripping out the email headers and other
665           text.  <command>patch</> ignores everything that doesn't
666           look like a patch.
667         </para>
668         <para>
669           The <parameter>-p0</> option to <command>patch</>
670           tells it to keep the full file name from the patch file. For example,
671           if the file name in the patch file was
672            <filename>wine/programs/clock/main.c</>.
673           Setting the <parameter>-p0</> option would apply the patch
674           to the file of the same name i.e.
675           <filename>wine/programs/clock/main.c </>.
676           Setting the <parameter>-p1</> option would strip off the
677           first part of the file name and apply
678           the patch to <filename>programs/clock/main.c</>.
679           The <parameter>-p1</> option would be useful if you named your
680           top level wine directory differently than the person who sent
681           you the patch. For the <parameter>-p1</> option
682           <command>patch</> should be run from the top level wine
683           directory.
684         </para>
685       </sect2>
686     </sect1>
687
688   </chapter>
689
690 <!-- Keep this comment at the end of the file
691 Local variables:
692 mode: sgml
693 sgml-parent-document:("wine-user.sgml" "set" "book" "chapter" "")
694 End:
695 -->