4 This document attempts to establish guidelines for people making binary
7 It expresses the basic principles that the Wine developers have agreed
8 should be used when building Wine. It also attempts to highlight the areas
9 where there are different approaches to packaging Wine, so that the packager
10 can understand the different alternatives that have been considered and their
16 There are several terms and paths used in this document as place holders
17 for configurable values. Those terms are described here.
18 * WINEPREFIX: is the user's Wine configuration directory.
19 This is almost always ~/.wine, but can be overridden by
20 the user by setting the WINEPREFIX environment variable.
22 * PREFIX: is the prefix used when selecting an installation target.
23 The current default is /usr/local. This results in binary
24 installation into /usr/local/bin, library installation into
25 /usr/local/wine/lib, and so forth.
26 This value can be overridden by the packager. In fact, FHS 2.2
27 (http://www.pathname.com/fhs/) specifications suggest that a better
28 prefix is /opt/wine. Ideally, a packager would also allow the
29 installer to override this value.
31 * WINDOWSDIR: is an important concept to Wine. This directory specifies
32 what directory corresponds to the root Windows directory
33 (e.g. C:\WINDOWS). This directory is specified by the user, in
34 their registry settings. Generally speaking, this directory
35 is either set to point at an empty directory, or it is set to point
36 at a Windows partition that has been mounted through the vfat driver.
37 NOTE: It is extremely important that the packager understand the
38 importance of WINDOWSDIR and convey this information and
39 choice to the end user.
44 There are two types of dependencies: hard and soft dependencies.
46 A hard dependency must be available at runtime for Wine to function,
47 if compiled into the code. Soft dependencies on the other hand
48 will degrade gracefully at runtime if unavailable on the runtime system.
49 Ideally, we should eliminate all hard dependencies in favor of
52 To enable a soft dependency, it must be available at compile time.
53 As a packager, please do your best to make sure that as many soft
54 dependencies are available during compilation. Failing to have a
55 soft dependency available means that users cannot benefit
56 from a Wine capability.
58 Here is a list of the soft dependencies. We suggest packagers
59 install each and every last of those before building the package.
60 These libraries are not dependencies in the RPM sense. In DEB packages,
61 they should appear as "Suggests" or "Recommends", as the case may be.
62 * FreeType: http://www.freetype.org
63 This library is used for direct rendering of fonts. It provides
64 better support of fonts than using the X11 fonts engine. It is
65 only needed for the X11 back end engine. Used from GDI.
67 * fontforge: http://sourceforge.net/projects/fontforge/
68 Used by WINE to create our own set of TrueType fonts during build.
71 Used to find TrueType fonts for rendering with freetype. Used by
74 * Alsa: http://sourceforge.net/projects/alsa (Linux only)
75 This library gives sound support to the Windows environment.
77 * JACK: http://jackit.sourceforge.net
78 Similar to Alsa, it allow Wine to use the JACK audio server.
80 * CUPS: http://www.cups.org
81 This library allows Windows to see CUPS defined printers. Used
82 by WINEPS and WINSPOOL.
85 This is used for both OpenGL and Direct3D (and some other
86 DirectX functions as well) support in Wine. There are many many
87 libraries for providing this functionality. It is enough for one
88 of them to be available when compiling Wine. Wine can work with
89 any other library during runtime.
90 If no library is available, packagers are encouraged to compile
91 Wine with Mesa3D (http://www.mesa3d.org), which requires no
92 hardware support to install.
94 * OpenLDAP: http://www.openldap.org
95 Used by WLDAP32 to implement LDAP support.
97 * LittleCMS: http://www.littlecms.com
98 This library is used to implement MSCMS (Color Management System)
99 which is needed by an increasing number of graphics applications.
102 This library is used to load JPEG files within OLE automation.
104 * libungif or gif_lib
105 One of these two libraries is used to load GIF files within OLE
109 Used for bidirectional character output. Linked statically, used
113 Used for basic scanner support in our TWAIN32 library.
116 Used for some cryptographic support in ADVAPI32.
118 * Xrandr, Xrender, Xi, Xext
119 X11 extension libraries used by the x11drv.
120 Xrandr - resolution switching
121 Xrender - client side font rendering
122 Xi - X Input handling (for asian input methods mostly)
126 These two libraries are used for our msxml3.dll implementation.
129 Used during build to locate WINE at a specific virtual address.
132 Used to implement our capi2032.dll.
137 An installation from a Wine package should:
138 * Install quickly and simply:
139 The initial installation should require no user input. An
140 'rpm -i wine.rpm' or 'apt-get install wine'
141 should suffice for initial installation.
143 * Work quickly and simply:
144 The user should be able to launch Solitaire within seconds
145 of downloading the Wine package.
147 * Comply with File system Hierarchy Standard
148 A Wine installation should, as much as possible, comply
149 with the FHS standard (http://www.pathname.com/fhs/).
151 * Preserve flexibility
152 None of the flexibility built into Wine should
153 be hidden from the end user.
156 Come as preconfigured as possible, so the user does
157 not need to change any configuration files.
160 Use only as much disk space as needed per user.
162 * Reduce support requirements.
163 A packaged version of Wine should be sufficiently easy to use and
164 have quick and easy access to FAQs and documentation such that
165 requests to the newsgroup and development group go down.
166 Further, it should be easy for users to capture good bug reports.
171 Successfully installing Wine requires:
173 * Install of the .rpm or .deb package.
175 * No longer: Preparing a fake windows setup.
177 If WINEPREFIX is not present, wine will generate a setup
178 by itself by calling wineprefixcreate.
180 This will load all default registry entries, and register dlls
181 where necessary. A special "wine.inf" file is provided with
182 the WINE sources and installed to /usr/share/wine/.
188 - notepad : The windows Notepad replacement.
189 - progman : A Program Manager replacement.
190 - regedit : A graphical tool to edit your registry or for
191 importing a windows registry to Wine.
192 - regsvr32 : A program to register/unregister .DLL and .OCX files.
193 Only works on those dlls that can self-register.
194 - taskmgr : A clone of the windows taskmgr, used for debugging and
195 managing running Windows and Winlib processes.
196 - uninstaller: A program to uninstall installed Windows programs.
197 Like the Add/Remove Program in the windows control panel.
198 - wcmd : Wine's command line interpreter, a cmd.exe replacement.
199 - widl : Wine IDL compiler compiles (MS-RPC and DCOM) Interface
200 Definition Language files.
201 - wine : The main Wine executable. This program will load a Windows
202 binary and run it, relying upon the Wine shared object libraries.
203 - wineboot : This program is executed on startup of the first wine
204 process of a particular user.wineboot won't automatically run
205 when needed. Currently you have to manually run it after you
207 - winebuild : Winebuild is a tool used for building Winelib applications
208 (and by Wine itself) to allow a developer to compile a .spec file
210 - wineconsole : Render the output of CUI programs.
211 - winedbg : A application making use of the debugging API to allow
212 debugging of Wine or Winelib applications as well as Wine itself
213 (kernel and all DLLs).
214 - winedump : Dumps the imports and exports of NE and PE files.
215 - winefile : A clone of the win3x file manager.
216 - winegcc/wineg++: Wrappers for gcc/g++ respectively, to make them behave
217 as MinGW's gcc. Used for porting apps over to Winelib.
218 - winemaker : Winemaker is a perl script which is designed to help you
219 bootstrap the conversion of your Windows projects to Winelib.
220 - winemine : A clone of "Windows Minesweeper" a demo WineLib app.
221 - winepath : A tool for converting between Windows paths and Unix paths
222 - wineserver : The Wine server is the process that manages resources,
223 coordinates threads, and provides synchronization and interprocess
224 communication primitives to Wine processes.
225 - wineshelllink : This shell script can be called by Wine in order to
226 propagate Desktop icon and menu creation requests out to a
227 GNOME or KDE (or other Window Managers).
228 - winewrap : Takes care of linking winelib applications. Linking with
229 Winelib is a complex process, winewrap makes it simple.
230 - winhelp : A Windows Help replacement.
231 - wmc : Wine Message Compiler it allows Windows message files to be
232 compiled into a format usable by Wine.
233 - wrc : the Wine Resource Compiler. A clone of Microsoft's rc.
235 * Shared Object Library Files
236 To obtain a current list of DLLs, run:
238 it the root of the Wine _build_ tree, after a successful build.
241 To obtain a current list of man files that need to be installed, run:
243 it the root of the Wine _build_ tree, after you have run ./configure.
246 An up to date list of includes can be found in the include/Makefile.in
249 * Documentation files
250 After building the documentation with:
251 cd documentation; make html
252 install all the files from: wine-user/, wine-devel/ and winelib-user/.
255 Wine also generates and depends on a number of dynamic
256 files, including user configuration files and registry files.
258 At the time of this writing, there was not a clear
259 consensus of where these files should be located, and how
260 they should be handled. This section attempts
261 to explain the alternatives clearly.
264 - PREFIX/share/wine.inf
266 This is the global Wine setup information file
267 in the format of a MS Installer .INF file.
270 In order to replicate the Windows registry system,
271 Wine stores registry entries in a series of files.
273 For an excellent overview of this issue, read this
274 http://www.winehq.org/News/2000-25.html#FTR
275 Wine Weekly News feature.
277 The bottom line is that, at Wine server startup,
278 Wine loads all registry entries into memory
279 to create an in memory image of the registry.
280 The order of files which Wine uses to load
281 registry entries is extremely important,
282 as it affects what registry entries are
283 actually present. The order is roughly that
284 .dat files from a Windows partition are loaded,
285 and then finally local registry settings are
286 loaded from WINEPREFIX. As each set are loaded,
287 they can override the prior entries. Thus,
288 the local registry files take precedence.
290 Then, at exit (or at periodic intervals),
291 Wine will write either all registry entries
292 (or, with the default setting) changed
293 registry entries to files in the WINEPREFIX.
295 - WINEPREFIX/system.reg
296 This file contains the user's local copy of the
297 HKEY_LOCAL_MACHINE registry hive. In general use, it will
298 contain only changes made to the default registry values.
300 - WINEPREFIX/user.reg
301 This file contains the user's local copy of the
302 HKEY_CURRENT_MACHINE registry hive. In general use, it will
303 contain only changes made to the default registry values.
305 - WINEPREFIX/userdef.reg
306 This file contains the user's local copy of the
307 HKEY_USERS\.Default registry hive. In general use, it will
308 contain only changes made to the default registry values.
310 - WINEPREFIX/cachedmetrics.[display]
311 This file contains font metrics for the given X display.
312 Generally, this cache is generated once at Wine start time.
313 cachedmetrics can be generated if absent.
314 You should note this can take a long time.
316 * Important Files from a Windows Partition
317 Wine has the ability to use files from an installation of the
318 actual Microsoft Windows operating system. Generally these
319 files are loaded on a VFAT partition that is mounted under Linux.
321 This is probably the most important configuration detail.
322 The use of Windows registry and DLL files dramatically alters the
323 behavior of Wine. If nothing else, packagers have to make this
324 distinction clear to the end user, so that they can intelligently
325 choose their configuration.
327 - WINDOWSDIR/system32/system.dat
328 - WINDOWSDIR/system32/user.dat
331 * Windows Dynamic Link Libraries (WINDOWSDIR/system32/*.dll)
332 Wine has the ability to use the actual Windows DLL files
333 when running an application. An end user can configure
334 Wine so that Wine uses some or all of these DLL files
335 when running a given application.
340 There has recently been a lot of discussion on the Wine development
341 mailing list about the best way to build Wine packages.
343 There was a lot of discussion, and several diverging points of view.
344 This section of the document attempts to present the areas of common
345 agreement, and also to present the different approaches advocated on
348 * Distribution of Wine into packages
349 The most basic question to ask is given the Wine CVS tree,
350 what physical files are you, the packager, going to produce?
351 Are you going to produce only a wine.rpm, or are you going to
352 produce 6 Debian files (libwine, libwine-dev, wine, wine-doc,
353 wine-utils and winesetuptk) as Ove has done?
354 At this point, common practice is to adopt to the conventions
355 of the targeted distribution.
357 Also, experience shows that you should not create a huge set
358 of packages, since later upgrades and obsoleting will be
361 * Where to install files
362 This question is not really contested. It will vary
363 by distribution, and is really up to the packager.
364 As a guideline, the current 'make install' process
365 seems to behave such that if we pick a single PREFIX then:
366 - binary files go into PREFIX/bin
367 - library files go into PREFIX/lib/wine
368 - include files go into PREFIX/include/wine
369 - man pages go into PREFIX/share/man
370 - documentation files go into PREFIX/share/doc/wine-VERSION
372 You might also want to use the wine wrapper script winelauncher
373 that can be found in tools/ directory, as it has several important
374 advantages over directly invoking the wine binary.
375 See the Executable Files section for details.
377 * The question of /opt/wine
378 The FHS 2.2 specification suggests that Wine as a package
379 should be installed to /opt/wine. None of the existing packages
380 follow this guideline (today; check again tomorrow).
382 (Since most are upgrades of the distro packages, this is still
383 on the safe side I think - Marcus Meissner)
385 * What files to create
386 After installing the static and shareable files, the next
387 question the packager needs to ask is how much dynamic
388 configuration will be done, and what configuration
389 files should be created.
391 The best current approach to this is:
392 - Leave it alone and make a "wineprefixcreate" call available
393 to the user via a menu item or similar.
395 - Setup a fake windows setup automatically.
397 This is done by simply calling wineprefixcreate,
398 which will setup a fake windows root for the user.
400 If no arguments are passed, defaults will be
401 assumed for WINEPREFIX (~/.wine) and similar
404 After this, WINE is immediately usable by the
407 - Others might be possible.
412 This section discusses the implementation of a Red Hat 8.0 .spec file.
413 For a current .spec file, please refer to any one of the existing SRPMs.
415 1. Building the package
417 Wine is configured the usual way (depending on your build environment).
418 The PREFIX is chosen using your application placement policy
419 (/usr/, /usr/X11R6/, /opt/wine/, or similar). The configuration files
420 (wine.userreg, wine.systemreg) are targeted for /etc/wine/
421 (rationale: FHS 2.2, multiple read only configuration files of a package).
423 Example (split this into %build and %install section for rpm:
426 CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr/X11R6 --sysconfdir=/etc/wine/ --enable-dll
429 make install prefix=$BR/usr/X11R6/ sysconfdir=$BR/etc/wine/
431 You will need to package the files:
436 $prefix/share/wine/wine.inf
438 $prefix/man/man1/wine.1
439 $prefix/include/wine/*
450 %doc ... choose from the top level directory and documentation/
453 2. Installing Wine for the system administrator
455 Install the package using the usual packager 'rpm -i wine.rpm'.
457 Adapting the $prefix/share/wine/wine.inf file used by wineprefixcreate is not
460 Note that on Linux you should somehow try to add the unhide mount option
461 (see 'man mount') to the CD-ROM entry in /etc/fstab during package install,
462 as several stupid Windows programs mark some setup (!) files as hidden
463 (ISO9660) on CD-ROMs, which will greatly confuse users as they won't find
464 their setup files on the CD-ROMs as they were used on Windows systems when
465 unhide is not set ;-\ And of course the setup program will complain
466 that setup.ins or some other mess is missing... If you choose to do so,
467 then please make this change verbose to the admin.
469 Also make sure that the kernel you use includes the Joliet CD-ROM support,
470 for the very same reasons as given above (no long filenames due to missing
471 Joliet, files not found).
473 3. Installing Wine for the user
475 If no standard wine prefix was setup, the first call to wine will
476 create one for the user.
478 So the user can just click on any setup.exe file and it will work
484 Written in 1999 by Marcus Meissner <marcus@jet.franken.de>
485 Updated in 2000 by Jeremy White <jwhite@codeweavers.com>
486 Updated in 2002 by Andreas Mohr <andi@rhlx01.fht-esslingen.de>
487 Updated in 2003 by Tom Wickline <twickline2@triad.rr.com>
488 Updated in 2003 by Dimitrie O. Paun <dpaun@rogers.com>
489 Updated in 2004,2005 by Marcus Meissner <marcus@jet.franken.de>