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