Skip to main content

Build Wine rpm with 32 bit application support

Wine is a software to allow running Windows applications in Linux, MAC etc. platforms. It is available for installation from package managers like yum (RHEL, CentOS) and apt (Ubuntu). You can find more details on how it works in Wine wiki.

But the default Wine package available from package manager does not have support for 32 bit Windows applications. This was the case for me. In Redhat Enterprise Linux 7.3, the wine package did not contain support for 32 bit windows applications. So the only option was to build a separate rpm of wine which will include this support.

All the steps are executed on a RHEL 7.3 VM (x86_64).

Step 1
Download and run shell script which will make wine 64 and 32 support for RHEL: https://github.com/zma/usefulscripts/blob/master/script/install-wine-i686-centos7.sh It accepts a version no. as CLI parameter e.g. 2.0.3

The script installs wine in /usr/local/ directory by default. We can verify the files that are being copied for wine using "cd /usr/src/wine-2.0.…

Build Wine rpm with 32 bit application support

Wine is a software to allow running Windows applications in Linux, MAC etc. platforms. It is available for installation from package managers like yum (RHEL, CentOS) and apt (Ubuntu). You can find more details on how it works in Wine wiki.

But the default Wine package available from package manager does not have support for 32 bit Windows applications. This was the case for me. In Redhat Enterprise Linux 7.3, the wine package did not contain support for 32 bit windows applications. So the only option was to build a separate rpm of wine which will include this support.

All the steps are executed on a RHEL 7.3 VM (x86_64).

Step 1
Download and run shell script which will make wine 64 and 32 support for RHEL:
It accepts a version no. as CLI parameter e.g. 2.0.3


The script installs wine in /usr/local/ directory by default. We can verify the files that are being copied for wine using "cd /usr/src/wine-2.0.3/wine32/; make -n install" and  "cd /usr/src/wine-2.0.3/wine64/; make -n install"

Step 2
Additional steps for adding windows core fonts (optional):
yum install cabextract
chmod +x winetricks
sh winetricks corefonts

It downloads the fonts at ~/.wine/drive_c/windows/Fonts/

Step 3
Then do following steps to build rpm:


mkdir -p ~/rpmbuild/{RPMS,SRPMS,BUILD,SOURCES,SPECS,tmp}

cat <~/.rpmmacros
%_topdir   %(echo $HOME)/rpmbuild
%_tmppath  %{_topdir}/tmp
EOF

cd ~/rpmbuild


Create tarball of wine-

mkdir -p wine-2.0.3/usr/
cd wine-2.0.3
cp -r /usr/local/ usr/

Then remove any unused directory that is not created by wine.

Copy ms-core font files -

cp -r ~/.wine/drive_c/windows/Fonts/ usr/local/share/wine/fonts/ms-core
cd ..
tar -zcvf wine-2.0.3.tar.gz wine-2.0.3/

Copy tar to rpmbuild/SOURCES directory created in above steps.

Create a spec (e.g. wine.spec) file in rpmbuild/SPECS directory with following content.

Then build the rpm using following command -
rpmbuild -ba rpmbuild/SPECS/wine.spec

Rpm will be generated in rpmbuild/RPMS/x86_64 directory. This rpm can be installed on other RHEL 7.3 x86_64 machines.

Step 4
Install x-window system for RHEL in destination machine:

yum install xorg-x11-xauth.x86_64

Step 5
To install the wine rpm do following (it will automatically resolve all dependency packages):

yum install wine-2.0.3-1.x86_64.rpm

Step 6
Start wine for the first time:
winecfg
(in the gui select Windows 7 and apply)
Then run windows applications line below -
wine /path/to/app.exe (for 32 bit binary)
wine64 /path/to/app64.exe (for 64 bit binary)

Comments