: 8 2021 | : 17846 | : 20417874
en ru br
5.1: 1.1.44-alt1.M50P.1
4.1: 1.0.9-alt0.M41.35
4.0: 1.0.9-alt0.M40.35
3.0: 20050715-alt0.1

: wine

             Sources      Gear   Bugs and FR  Repocop 

%def_disable static
%define gecko_version 2.47.2
%define mono_version 6.0.0
%define major 6.2
%define rel %nil

%def_with gtk3

# rpm-build-info gives _distro_version

%if %_vendor == "alt" && (%_distro_version == "p9" || %_distro_version == "Sisyphus")
%def_with vulkan
# vkd3d depends on vulkan
%def_with vkd3d
%def_with faudio

Name: wine
Version: %major.1
Release: alt1
Epoch: 1

Summary: WINE Is Not An Emulator - environment for running Windows applications

License: LGPLv2+
Group: Emulators

Packager: Vitaly Lipatov <lav at>

# TODO: major in gear

# Source-url:

Source: %name-%version.tar
# Source1-url:
Source1: %name-staging-%version.tar

Source3: %name-%version-desktop.tar
Source4: %name-%version-icons.tar
Source6: %name-%version-scripts.tar

# local patches

Source10: %name-patches-%version.tar

AutoReq: yes, noperl

ExclusiveArch: %ix86 x86_64 aarch64

# try build wine64 only on ALT

%if %_vendor == "alt"
%ifarch x86_64 aarch64
   %def_with build64
   %define winearch wine64
   %def_without build64
   %define winearch wine32
   # skip -fPIC checking (-fnoPIC need in new wine to skip DECLSPEC_HOTPATCH)
   %add_verify_elf_skiplist %_libdir/wine/*.so
   # TODO: use -fPIC for
   %add_verify_elf_skiplist %_libdir/*.so.*
   # -fPIC is totally disabled for i586
   %add_verify_elf_skiplist %_bindir/*
  %def_without build64
  %define winearch wine32


%define libdir %_libdir
%define libwinedir %libdir/wine

# for wine-staging script

BuildPreReq: /proc

%ifarch aarch64
BuildRequires: clang >= 5.0
BuildRequires: gcc

# General dependencies

BuildRequires(pre): rpm-build-intro >= 2.1.14
BuildRequires: util-linux flex bison
BuildRequires: fontconfig-devel libfreetype-devel
BuildRequires: zlib-devel libldap-devel libgnutls-devel
BuildRequires: libxslt-devel libxml2-devel
BuildRequires: libjpeg-devel liblcms2-devel libpng-devel libtiff-devel
BuildRequires: libgphoto2-devel libsane-devel libcups-devel
BuildRequires: libalsa-devel jackit-devel libgsm-devel libmpg123-devel libpulseaudio-devel
BuildRequires: libopenal-devel libGLU-devel
BuildRequires: libusb-devel libieee1284-devel libkrb5-devel
BuildRequires: libv4l-devel
BuildRequires: libunixODBC-devel
BuildRequires: libnetapi-devel libpcap-devel
#BuildRequires: gstreamer-devel gst-plugins-devel
# TODO: opencl-headers (autoimports now), osmesa

%if_with vulkan
BuildRequires: libvulkan-devel
%if_with vkd3d
BuildRequires: vkd3d-devel >= 1.2
%if_with faudio
BuildRequires: libfaudio-devel

# Staging part

%if_with gtk3
# GTK3 theme support: staging only
BuildRequires: libgtk+3-devel libcairo-devel
BuildRequires: libva-devel

# udev needed for udev version detect

BuildRequires: libudev-devel udev libdbus-devel

BuildRequires: libICE-devel libSM-devel libxcb-devel
BuildRequires: libX11-devel libXau-devel libXaw-devel libXrandr-devel
BuildRequires: libXext-devel libXfixes-devel libXfont-devel libXft-devel libXi-devel
BuildRequires: libXmu-devel libXpm-devel libXrender-devel
BuildRequires: libXres-devel libXScrnSaver-devel libXinerama-devel libXt-devel
BuildRequires: libXxf86dga-devel libXxf86misc-devel libXcomposite-devel
BuildRequires: libXxf86vm-devel libfontenc-devel libXdamage-devel
BuildRequires: libXvMC-devel libXcursor-devel libXevie-devel libXv-devel

BuildRequires: perl-XML-Simple

# Actually for x86_32

Requires: glibc-pthread glibc-nss

# Enable with can build on x86_64

# GCC v4.4 is needed for build wine64
#ExclusiveArch:  %{ix86}
Requires: webclient

Requires: wine-gecko = %gecko_version
Conflicts: wine-mono < %mono_version

BuildRequires: desktop-file-utils
# Use it instead proprietary MS Core Fonts
# Requires: fonts-ttf-liberation

# For menu/MIME subsystem

Requires: desktop-file-utils

Requires: lib%name = %EVR

Conflicts: wine-vanilla wine-etersoft

Requires: cabextract

# Provides/Obsoletes Fedora packages

%define common_provobs wine-filesystem wine-desktop wine-systemd wine-sysvinit
%define base_provobs wine-alsa wine-capi wine-cms wine-ldap wine-openal wine-pulseaudio wine-wow wine-alsa wine-capi wine-cms wine-ldap wine-openal wine-opencl wine-pulseaudio wine-twain
%define fonts_provobs wine-fonts wine-arial-fonts wine-courier-fonts wine-fixedsys-fonts wine-marlett-fonts wine-ms-sans-serif-fonts wine-small-fonts wine-symbol-fonts wine-system-fonts wine-tahoma-fonts wine-times-new-roman-fonts wine-wingdings-fonts
#Provides: %common_provobs %base_provobs %fonts_provobs
Obsoletes: %common_provobs %base_provobs %fonts_provobs

#BuildRequires(pre): rpm-macros-wine


Wine (originally an acronym for "Wine Is Not an Emulator")
is a compatibility layer capable of running Windows applications.
Instead of simulating internal Windows logic like a virtual machine or emulator,
Wine translates Windows API calls into POSIX calls on-the-fly,
eliminating the performance and memory penalties
of other methods and allowing you to cleanly integrate Windows applications into your desktop.

This build based on wine source with wine-staging project patches
and ALT in progress patches.

%package test
Summary: WinAPI test for Wine
Summary(ru_RU.UTF-8): Тест WinAPI для Wine
Group: Emulators
Requires: %name = %EVR
Conflicts: wine-vanilla-test

%description test
WinAPI test for Wine (unneeded for usual work).
Warning: it may kill your X server suddenly.

%package full
Summary: Wine meta package
Summary(ru_RU.UTF-8): Мета пакет Wine
Group: Emulators
# due ExclusiveArch
#BuildArch: noarch
Requires: %name = %EVR
Requires: %name-programs = %EVR
Requires: lib%name-gl = %EVR

Requires: wine-mono = %mono_version
Requires: wine-gecko = %gecko_version
Requires: winetricks

Conflicts: wine-vanilla-full

%description full
Wine meta package. Use it for install all wine subpackages.

%package programs
Summary: Wine programs
Group: Emulators
Requires: %name = %EVR
# due ExclusiveArch
#BuildArch: noarch

Conflicts: wine-vanilla-programs

%description programs
Wine GUI programs:
* winefile
* notepad
* winemine

%package -n lib%name
Summary: Main library for Wine
Group: System/Libraries
Conflicts: libwine-vanilla

# Actually for x86_32

Requires: glibc-nss

# Runtime linked

Requires: libcups
Requires: libXrender libXi libXext libX11 libICE
Requires: libXcomposite libXcursor libXinerama libXrandr
Requires: libssl libgnutls30
Requires: libpng16 libjpeg libtiff5
Requires: libxslt

%if_with gtk3
Requires: libcairo libgtk+3

%if_with vulkan
Requires: libvulkan1

# Recommended

#Requires: libnetapi libunixODBC2 libpcap0.8

# Linked:

#Requires: fontconfig libfreetype

%description -n lib%name
This package contains the library needed to run programs dynamically
linked with Wine.

%description -n lib%name -l ru_RU.UTF-8
Этот пакет состоит из библиотек, которые реализуют Windows API.

%package -n lib%name-gl
Summary: DirectX/OpenGL support libraries for Wine
Group: System/Libraries
Requires: lib%name = %EVR
Conflicts: libwine-vanilla-gl

# Runtime linked (via dl_open)

Requires: libGL

# wine-staging only

Requires: libva
Requires: libtxc_dxtn

%description -n lib%name-gl
This package contains the libraries for DirectX/OpenGL support in Wine.

%package -n lib%name-twain
Summary: Twain support library for Wine
Group: System/Libraries
Requires: lib%name = %EVR
Conflicts: libwine-vanilla-twain

# Runtime linked (via dl_open)

Requires: libsane

%description -n lib%name-twain
This package contains the library for Twain support.

%package -n lib%name-devel
Summary: Headers for lib%name-devel
Group: Development/C
Requires: lib%name = %EVR
Obsoletes: wine-devel
Provides: wine-devel
Conflicts: libwine-vanilla-devel

# due winegcc require

Requires: gcc-c++

%description -n lib%name-devel
lib%name-devel contains the header files and some utilities needed to
develop programs using lib%name.

%description -n lib%name-devel -l ru_RU.UTF-8
lib%name-devel содержит файлы для разработки программ, использующих Wine:
заголовочные файлы и утилиты, предназначенные
для компилирования программ с lib%name.

%package -n lib%name-devel-static
Summary: Static libraries for lib%name
Group: Development/C
Requires: lib%name = %EVR
Conflicts: libwine-vanilla-devel-static

%description -n lib%name-devel-static
lib%name-devel-static contains the static libraries needed to
develop programs which make use of Wine.

%setup -a 1 -a 10
# Apply wine-staging patches
%name-staging/patches/ DESTDIR=$(pwd) --all --backend=patch

# disable rpath using for executable

%__subst "s|^\(LDRPATH_INSTALL =\).*|\1|"

# Apply local patches


%ifarch aarch64
%remove_optflags -frecord-gcc-switches
export CC=clang

%configure --with-x \
%if_with build64
--enable-win64 \
--disable-tests \
%{subst_enable static} \
%{subst_with gtk3} \
--without-gstreamer \
--without-oss \
--without-capi \
--without-hal \
--without-mingw \
--with-xattr \
%{subst_with vulkan} \
%{subst_with vkd3d} \
%{subst_with faudio} \

%__make depend


install tools/wineapploader %buildroot%_bindir/wineapploader

# unpack desktop files

cd %buildroot%_desktopdir/
tar xvf %SOURCE3
mkdir -p %buildroot%_datadir/desktop-directories/
mv *.directory %buildroot%_datadir/desktop-directories/

# unpack icons files

mkdir -p %buildroot%_iconsdir/
cd %buildroot%_iconsdir/
tar xvf %SOURCE4

# unpack scripts files

mkdir -p %buildroot%_bindir/
cd %buildroot%_bindir/
tar xvf %SOURCE6

# Do not pack non english man pages yet

rm -rf %buildroot%_mandir/*.UTF-8

# Do not pack dangerous association for run windows executables

rm -f %buildroot%_desktopdir/wine.desktop

%if_disabled static
for i in %buildroot%_libdir/wine/*.a ; do
   [ "$i" == "%buildroot%_libdir/wine/libwinecrt0.a" ] && continue
   rm -fv $i

%lang(de) %doc documentation/
%lang(es) %doc documentation/
%lang(fr) %doc documentation/
%lang(hu) %doc documentation/
%lang(it) %doc documentation/
%lang(ko) %doc documentation/README.ko
%lang(nb) %doc documentation/
%lang(pt) %doc documentation/
%lang(pt_BR) %doc documentation/README.pt_br
%lang(tr) %doc documentation/


%if_without build64








# danger



%if_without build64

%files -n lib%name
# for compatibility only
%dir %libwinedir/

%if_without build64


%dir %_datadir/wine/

# move to separate packages

%exclude %libwinedir/twain*
%exclude %libwinedir/
%exclude %libwinedir/
%exclude %libwinedir/
%exclude %libwinedir/
%exclude %libwinedir/
%exclude %libwinedir/
%exclude %libwinedir/

%files full

%files programs

%files -n lib%name-twain

%files -n lib%name-gl

%files -n lib%name-devel



%if_enabled static
%files -n lib%name-devel-static
%exclude %libwinedir/libwinecrt0.a



: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
: Michael Shigorin