Although it is not straightforward, it is doable. In this small tutorial I'm going to explain how you can do it yourself.
I suggest you to do the build on a CentOS 7 installation in a virtual machine using snapshot. In this way if you make a mess
you can go back and start over again.
Below, as an attachment, you will find a small script called rpmrebuild.gz that I use to build the rpm. Save it in a place
included in your $PATH, decompress and make it executable.
Code: Select all
gunzip rpmrebuild.gz ; chmod a+x rpmrebuild
were the option -e allows to edit (with vi) the spec file before the build starts. The script will create the directories for RPM building
in the current directory and it will overwrite $HOME/.rpmmacros (make a backup copy of $HOME/.rpmmacros if you need to preserve its content).
Your CentOS installation should have at least all the Development packages installed. In this way the number of extra packages
you need to install is smaller. You need to add also the epel repository.
Step 1
become root and install the following packages:
Code: Select all
yum install glibc-devel libstdc++-devel icoutils openal-soft-devel prelink gstreamer-plugins-base-devel gstreamer-devel ImageMagick-devel fontpackages-devel libv4l-devel gsm-devel giflib-devel libXxf86dga-devel mesa-libOSMesa-devel isdn4k-utils-devel libgphoto2-devel fontforge libusb-devel lcms2-devel audiofile-devel
Code: Select all
yum install glibc-devel.i686 dbus-devel.i686 freetype-devel.i686 pulseaudio-libs-devel.i686 libX11-devel.i686 mesa-libGLU-devel.i686 libICE-devel.i686 libXext-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libXxf86vm-devel.i686 libXrender-devel.i686 libXinerama-devel.i686 libXcomposite-devel.i686 libXrandr-devel.i686 mesa-libGL-devel.i686 mesa-libOSMesa-devel.i686 libxml2-devel.i686 libxslt-devel.i686 zlib-devel.i686 gnutls-devel.i686 ncurses-devel.i686 sane-backends-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 libexif-devel.i686 lcms2-devel.i686 gettext-devel.i686 isdn4k-utils-devel.i686 cups-devel.i686 fontconfig-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pkgconfig.i686 libtiff-devel.i686 unixODBC.i686 openldap-devel.i686 alsa-lib-devel.i686 audiofile-devel.i686 freeglut-devel.i686 giflib-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 libXmu-devel.i686 libXxf86dga-devel.i686 libieee1284-devel.i686 libpng-devel.i686 librsvg2-devel.i686 libstdc++-devel.i686 libusb-devel.i686 unixODBC-devel.i686 qt-devel.i686
Code: Select all
yum groupinstall "Development Tools"
build auxiliary 32-bit packages:
download http://vault.centos.org/7.0.1406/os/Sou ... l7.src.rpm
build the 32-bit rpm:
Code: Select all
linux32 rpmrebuild chrpath-0.13-14.el7.src.rpm
Code: Select all
yum remove chrpath
Code: Select all
yum localinstall rpmbuild/RPMS/i686/chrpath-0.13-14.el7.centos.i686.rpm
build the 32-bit rpm (with spec file edit):
Code: Select all
linux32 rpmrebuild -e openal-soft-1.16.0-2.el7.src.rpm
install openal-soft and openal-soft-devel 32-bit:
Code: Select all
yum localinstall rpmbuild/RPMS/i686/openal-soft{,-devel}-1.16.0-2.el7.centos.i686.rpm
Code: Select all
cp rpmbuild/RPMS/i686/openal-soft-1.16.0-2.el7.centos.i686.rpm <destination_dir>
build the 32-bit rpm:
Code: Select all
linux32 rpmrebuild nss-mdns-0.10-12.el7.src.rpm
Code: Select all
cp rpmbuild/RPMS/i686/nss-mdns-0.10-12.el7.centos.i686.rpm <destination_dir>
build wine 32-bit:
download wine-1.7.22-1.el7.src.rpm or current version from: http://dl.fedoraproject.org/pub/epel/7/SRPMS/w/
build the 32-bit rpm (with spec file edit):
Code: Select all
linux32 rpmrebuild -e wine-1.7.22-1.el7.src.rpm
export CFLAGS="`echo $RPM_OPT_FLAGS | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//'` -Wno-error"
and
%configure \
insert the following line: (make winegcc generate 32-bit code)
Code: Select all
sed -i '/winegcc/s/-o /-m32 &/' tools/makedep.c
%if 0%{?rhel} >= 7
%{__ln_s} %{_bindir}/wine64 %{buildroot}%{_bindir}/wine
%endif
find the lines:
%if 0%{?rhel} >= 7
Requires: wine-core(x86-64) = %{version}-%{release}
%else
Requires: wine-core(x86-32) = %{version}-%{release}
%endif
and delete them except the line:
Requires: wine-core(x86-32) = %{version}-%{release}
remove the line %{_libdir}/wine/winegstreamer.dll.so (I didn't manage to make configure use gstreamer), save and exit (ZZ)
If there was no error now you have build wine 32-bit. Save the rpm:
Code: Select all
cp rpmbuild/RPMS/*/* <destination_dir>
Code: Select all
rm <destination_dir>/wine-debuginfo-1.7.22-1.el7.centos.i686.rpm
in an appropriate place and shutdown the virtual machine used to build wine.
Step 4
install wine 32-bit:
Assuming the wine rpms just build are in a directory called <winerpm> then you can install them with:
Code: Select all
yum localinstall <winerpm>/*
p11-kit: couldn't load module: /usr/lib/pkcs11/p11-kit-trust.so
p11-kit: couldn't load module: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated.
it means that samba-winbind-clients, gnome-keyring.i686 and p11-kit-trust.i686 are missing. You can install samba-winbind-clients and
gnome-keyring.i686 with:
Code: Select all
yum install samba-winbind-clients gnome-keyring.i686