# # spec file for package wine # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %define projectname wine %global flavor @BUILD_FLAVOR@%nil %define staging 0 %define nine 0 %if "%flavor" == "staging" || "%flavor" == "staging-nine" %define staging 1 %endif %if "%flavor" == "nine" || "%flavor" == "staging-nine" %define nine 1 %endif %if "%{flavor}" != "" Name: wine%{?flavor:-}%{?flavor} Provides: wine = %{version} %else Name: wine %endif Conflicts: otherproviders(wine) BuildRequires: alsa-devel BuildRequires: autoconf BuildRequires: bison BuildRequires: capi4linux-devel BuildRequires: cups-devel BuildRequires: dbus-1-devel BuildRequires: desktop-file-utils BuildRequires: fdupes BuildRequires: flex BuildRequires: fontconfig-devel BuildRequires: freeglut-devel BuildRequires: freetype2-devel BuildRequires: giflib-devel BuildRequires: glib2-devel BuildRequires: gstreamer-plugins-base-devel BuildRequires: libgnutls-devel BuildRequires: libgphoto2-devel BuildRequires: libgsm-devel BuildRequires: libjpeg-devel BuildRequires: liblcms2-devel BuildRequires: libpcap-devel BuildRequires: libpng-devel BuildRequires: libpulse-devel BuildRequires: libtiff-devel BuildRequires: libv4l-devel BuildRequires: libxml2-devel BuildRequires: libxslt-devel %if 0%{?suse_version} >= 1330 BuildRequires: mpg123-devel BuildRequires: vulkan-devel Provides: wine-mp3 = %version Obsoletes: wine-mp3 < %version %else Recommends: wine-mp3 %endif BuildRequires: SDL2-devel BuildRequires: ncurses-devel BuildRequires: openal-soft-devel BuildRequires: openldap2-devel BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: sane-backends-devel BuildRequires: update-desktop-files BuildRequires: valgrind-devel BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(osmesa) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(x11-xcb) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xcb-dri3) BuildRequires: pkgconfig(xcb-present) BuildRequires: pkgconfig(xcb-xfixes) BuildRequires: pkgconfig(xcomposite) BuildRequires: pkgconfig(xcursor) BuildRequires: pkgconfig(xcursor) BuildRequires: pkgconfig(xext) BuildRequires: pkgconfig(xfixes) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xinerama) BuildRequires: pkgconfig(xrandr) BuildRequires: pkgconfig(xrender) BuildRequires: pkgconfig(xxf86vm) BuildRequires: pkgconfig(zlib) %define realver 3.5 Version: 3.5 Release: 0 Summary: An MS Windows Emulator License: LGPL-2.1-or-later Group: System/Emulators/PC Url: http://www.winehq.org/ Source0: https://dl.winehq.org/wine/source/3.x/%{projectname}-%{realver}.tar.xz Source41: wine.keyring Source42: https://dl.winehq.org/wine/source/3.x/%{projectname}-%{realver}.tar.xz.sign Source1: https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks Source11: https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.1 Source2: http://kegel.com/wine/wisotool Source3: README.SUSE Source4: wine.desktop Source6: wine-msi.desktop Source5: ubuntuwine.tar.bz2 Source7: baselibs.conf # SUSE specific patches # - currently none, but add them here #Patch0: susepatches.patch Recommends: wine-gecko >= 2.47 # not packaged in distro... Recommends: wine-mono Recommends: dosbox Recommends: alsa-plugins Recommends: alsa-plugins-pulse Requires: samba-winbind Conflicts: wine-gecko < 1.3 %ifarch x86_64 Requires: %{name}-32bit = %{version} %endif # some recommends for winetricks: Recommends: cabextract Recommends: unzip BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %{ix86} x86_64 ppc %arm aarch64 %if %{staging} # upstream patch target version %define staging_version 3.5 Source100: wine-staging-%{staging_version}.tar.xz BuildRequires: gtk3-devel BuildRequires: libOSMesa-devel BuildRequires: libva-devel %endif %if %{nine} # upstream patch target version %define nine_version 3.5 BuildRequires: Mesa-libd3d-devel BuildRequires: dri2proto-devel BuildRequires: libOSMesa-devel Source110: wine-d3d9-patches-%{nine_version}.tar.xz %endif %description Wine 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. You can run your Windows executables with it and write your Windows programs under Linux and link against the WINE libraries. It is not necessary to have a Windows installation to run WINE. Refer to %{_datadir}/doc/packages/wine/README.SUSE. There is more documentation available in that directory. Read 'man wine' for further information. You can invoke wine by entering 'wine program.exe'. Configure it by running 'winecfg'. %package devel Summary: Files for Wine development Group: Development/Libraries/C and C++ %if "%{flavor}" != "" Provides: wine-devel = %{version} %endif Conflicts: otherproviders(wine-devel) %description devel This RPM contains the header files and development tools for the WINE libraries. %prep %setup -q -n wine-%{realver} #%%patch0 -p1 # cp %{S:3} . # %if %{staging} # apply wine staging patch set on top of the wine release. tar xf %{SOURCE100} bash ./wine-staging-%staging_version/patches/patchinstall.sh --all %endif %if %{nine} tar xf %{SOURCE110} %if %{staging} patch --no-backup-if-mismatch -p1 -i ./wine-d3d9-patches-%nine_version/staging-helper.patch %else patch --no-backup-if-mismatch -p1 -i ./wine-d3d9-patches-%nine_version/d3d9-helper.patch %endif patch --no-backup-if-mismatch -p1 -i ./wine-d3d9-patches-%nine_version/wine-d3d9.patch %endif %build cat VERSION export WIDL_TIME_OVERRIDE="0" # for reproducible builds. %ifarch %ix86 # e.g. Steam and other copy protections hate EBP being used for something else. export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fomit-frame-pointer//'` %endif %if %{staging} || %{nine} autoreconf -i -f %endif # keep just for susepatches with configure changes #autoconf #autoheader -I include CFLAGS="$RPM_OPT_FLAGS" \ %configure \ --with-x \ %ifarch x86_64 --enable-win64 \ %endif %if %{nine} --with-d3d9-nine \ %endif --verbose grep "have_x=yes" config.log || exit 1 # generate baselibs.conf %ifarch %ix86 echo "# autogenerated in .spec file" >%SOURCE7 echo "%name" >> %SOURCE7 echo " +^/usr/bin/wine\$" >> %SOURCE7 echo " +^/usr/bin/wine-preloader\$" >> %SOURCE7 echo " +^/usr/lib/wine/fakedlls" >> %SOURCE7 grep SONAME_ config.log grep SONAME_ config.log|grep -v 'so"'|sed -e 's/^.*\(".*"\).*$/ requires \1/;'|sort -u >>%SOURCE7 echo " recommends \"alsa-plugins-pulse-32bit\"" >> %SOURCE7 echo " recommends \"alsa-plugins-32bit\"" >> %SOURCE7 echo " recommends \"Mesa-libGL1-32bit\"" >> %SOURCE7 %if 0%{?suse_version} >= 1330 echo " obsoletes \"wine-mp3-32bit\"" >> %SOURCE7 %else echo " recommends \"wine-mp3-32bit\"" >> %SOURCE7 %endif %if 0%{?suse_version} >= 1310 echo " requires \"p11-kit-32bit\"" >> %SOURCE7 %endif %if "%{flavor}" != "" echo " provides \"wine- = \"" >> %SOURCE7 %endif echo " conflicts \"otherproviders(wine-)\"" >> %SOURCE7 echo "%name-devel" >> %SOURCE7 echo " +^/usr/lib/wine/.*def" >> %SOURCE7 %if "%{flavor}" != "" echo " provides \"wine-devel- = \"" >> %SOURCE7 %endif echo " conflicts \"otherproviders(wine-devel-)\"" >> %SOURCE7 cat %SOURCE7 %endif make %{?_smp_mflags} all %install make install DESTDIR=%{buildroot} # install desktop file install -d %{buildroot}%{_datadir}/applications/ %suse_update_desktop_file %{SOURCE4} System Emulator install -m 0644 %SOURCE4 %{buildroot}%{_datadir}/applications/ install -m 0644 %SOURCE6 %{buildroot}%{_datadir}/applications/ install -m 0755 %SOURCE1 %{buildroot}%{_bindir}/ install -m 0755 %SOURCE2 %{buildroot}%{_bindir}/ mv %{buildroot}/%{_mandir}/de.UTF-8 %{buildroot}/%{_mandir}/de mv %{buildroot}/%{_mandir}/fr.UTF-8 %{buildroot}/%{_mandir}/fr %ifnarch x86_64 mv %{buildroot}/%{_mandir}/pl.UTF-8 %{buildroot}/%{_mandir}/pl %endif install -pm0644 -c %{SOURCE11} %{buildroot}/%{_mandir}/man1/ tar -xjf %{SOURCE5} # Copied from Ubuntu Wine out of debian.diff # https://launchpad.net/~ubuntu-wine/+archive/ppa/+packages # taken on 1.2rc2 time. cd ubuntuwine install -d %{buildroot}%{_sysconfdir}/xdg/menus/applications-merged install -c -m 644 wine.menu %{buildroot}%{_sysconfdir}/xdg/menus/applications-merged # Install application-specific desktop files install -d %{buildroot}%{_datadir}/applications install -c -m 644 *.desktop %{buildroot}%{_datadir}/applications/ sed -i "/X-SuSE-translate/d" %{buildroot}%{_datadir}/applications/*.desktop install -d %{buildroot}%{_datadir}/desktop-directories/ install -c -m 644 *.directory %{buildroot}%{_datadir}/desktop-directories/ # Correct desktop files' categories %suse_update_desktop_file -n -r wine-notepad Utility TextEditor %suse_update_desktop_file -n -r wine-uninstaller System Emulator %suse_update_desktop_file -n -r wine-winecfg System Emulator %suse_update_desktop_file -n -r wine-regedit System Emulator %suse_update_desktop_file -n -r wine-winehelp System Emulator %suse_update_desktop_file -n -r wine-msi System Emulator %suse_update_desktop_file -n -r wine-browsedrive System Emulator %suse_update_desktop_file -n -r wine-winefile System FileManager %suse_update_desktop_file -n -r wine-winemine Game BoardGame # Install icons install -d %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/ install -c -m 644 *.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/ cd .. # find the implicit dependencies %define winedir %_builddir/%projectname-%realver cat >%winedir/my-find-requires.sh <