%ifarch x86_64 %define wine wine64 %define mark64 ()(64bit) %else %define wine wine %define mark64 %{nil} %endif %define lib_name_orig lib%{name} %define lib_major 1 %define lib_name %mklibname %{name} %{lib_major} %define lib_name_devel %{mklibname -d wine} # On 32-bit we have # wine32 - those 32-bit binaries that are also used on 64-bit for 32-bit support # wine - all other files (requires 'wine32') # On 64-bit we have # wine64 - all 64-bit files (suggests 'wine32') # - Anssi 07/2010 # When altering this, make sure the new wine-gecko is submitted or at least # notify its maintainer of the needed update. %define gecko_version 1.5 Name: wine Version: 1.5.6 %define pre 0 %define rel 1 %if %pre Release: %mkrel 0.%pre.%rel %define o_ver %version-%pre %else Release: %mkrel %rel %define o_ver %version %endif Epoch: 1 Summary: WINE Is Not An Emulator - runs MS Windows programs License: LGPLv2+ Group: Emulators URL: http://www.winehq.com/ Source0: http://prdownloads.sourceforge.net/wine/%{name}-%{o_ver}.tar.bz2 Source1: http://prdownloads.sourceforge.net/wine/%{name}-%{o_ver}.tar.bz2.sign # RH stuff Source2: wine.init Patch0: wine-1.0-rc3-fix-conflicts-with-openssl.patch Patch1: wine-1.1.7-chinese-font-substitutes.patch # (Anssi 05/2008) Adds: # a: => /media/floppy (/mnt/floppy on 2007.1 and older) # d: => $HOME (at config_dir creation time, not refreshed if $HOME changes; # note that Wine also provides $HOME in My Documents) # com4 => /dev/ttyUSB0 (replaces /dev/ttyS3) Patch108: wine-mgaconf.patch # (anssi) Wine needs GCC 4.4+ on x86_64 for MS ABI support. Note also that # 64-bit wine cannot run 32-bit programs without wine32. %ifarch x86_64 BuildRequires: gcc >= 4.4 %endif BuildRequires: bison flex BuildRequires: gpm-devel BuildRequires: perl-devel BuildRequires: ncurses-devel BuildRequires: cups-devel BuildRequires: sane-devel BuildRequires: lcms-devel BuildRequires: autoconf BuildRequires: docbook-utils docbook-dtd-sgml BuildRequires: docbook-utils docbook-dtd-sgml sgml-tools BuildRequires: pulseaudio-devel BuildRequires: libmpg123-devel BuildRequires: openal-devel BuildRequires: libalsa-devel BuildRequires: gstreamer0.10-devel libgstreamer0.10-plugins-base-devel BuildRequires: isdn4k-utils-devel BuildRequires: glibc-static-devel BuildRequires: chrpath BuildRequires: ungif-devel xpm-devel BuildRequires: tiff-devel BuildRequires: librsvg BuildRequires: imagemagick BuildRequires: gphoto2-devel BuildRequires: desktop-file-utils BuildRequires: openldap-devel BuildRequires: libxslt-devel BuildRequires: dbus-devel BuildRequires: valgrind-devel BuildRequires: gsm-devel BuildRequires: unixODBC-devel BuildRequires: gnutls-devel BuildRequires: prelink BuildRequires: gettext-devel BuildRequires: mesaglu-devel BuildRequires: libv4l-devel BuildRequires: libxcursor-devel libxcomposite-devel BuildRequires: libxinerama-devel libxrandr-devel BuildRequires: libx11-devel libxrender-devel BuildRequires: libxext-devel libsm-devel BuildRequires: fontforge fontconfig-devel freetype2-devel %define desc Wine is a program which allows running Microsoft Windows programs \ (including DOS, Windows 3.x and Win32 executables) on Unix. It \ consists of a program loader which loads and executes a Microsoft \ Windows binary, and a library (called Winelib) that implements Windows \ API calls using their Unix or X11 equivalents. The library may also \ be used for porting Win32 code into native Unix executables. %ifarch x86_64 %package -n %{wine} Summary: WINE Is Not An Emulator - runs MS Windows programs Group: Emulators Suggests: wine32 = %{epoch}:%{version}-%{release} Suggests: wine64-gecko = %gecko_version %else # on 32-bit we always want wine32 package Requires: wine32 = %{epoch}:%{version}-%{release} %endif Provides: %{wine}-utils = %{epoch}:%{version}-%{release} %{wine}-full = %{epoch}:%{version}-%{release} Provides: %{lib_name}-capi = %{epoch}:%{version}-%{release} %{lib_name}-twain = %{epoch}:%{version}-%{release} Provides: %{lib_name} = %{epoch}:%{version}-%{release} Provides: wine-bin = %{epoch}:%{version}-%{release} Obsoletes: %{wine}-utils %{wine}-full %{lib_name}-capi %{lib_name}-twain Obsoletes: %{lib_name} <= %{epoch}:%{version}-%{release} Requires: xmessage Suggests: sane-frontends # wine dlopen's these, so let's add the dependencies ourself Requires: libfreetype.so.6%{mark64} libasound.so.2%{mark64} # wine needs to dlopen libfontconfig to make CJK fonts show correctly in winecfg Requires: libfontconfig.so.1%{mark64} Requires: libncurses.so.5%{mark64} Requires: libXrender.so.1%{mark64} libpng15.so.15%{mark64} Requires(post): desktop-file-utils Requires(postun): desktop-file-utils Requires(post): desktop-common-data Requires(postun): desktop-common-data Requires(preun): rpm-helper Requires(post): rpm-helper %ifarch %{ix86} Conflicts: wine64 %else Conflicts: wine %endif %description %desc %ifarch x86_64 %description -n %{wine} %desc This package contains the Win64 version of Wine. You need the wine32 package from the 32-bit repository to be able to run 32-bit applications. %endif %ifarch %ix86 %package -n wine32 Summary: 32-bit support for Wine Group: Emulators # This is not an EVR-specific requirement, as otherwise on x86_64 urpmi could # resolve the dependency to wine64 even on upgrades, and therefore replace # wine+wine32 installation with a wine32+wine64 installation. - Anssi Requires: wine-bin Conflicts: wine < 1:1.2-0.rc7.1 Conflicts: wine64 < 1:1.2-0.rc7.1 # (Anssi) If wine-gecko is not installed, wine pops up a dialog on first # start proposing to download wine-gecko from sourceforge, while recommending # to use distribution packages instead. Therefore suggest wine-gecko here: Suggests: wine-gecko = %gecko_version %description -n wine32 Wine is a program which allows running Microsoft Windows programs (including DOS, Windows 3.x and Win32 executables) on Unix. This package contains the files needed to support 32-bit Windows programs. %endif %package -n %{wine}-devel Summary: Static libraries and headers for %{name} Group: Development/C Requires: %{wine} = %{epoch}:%{version} Provides: %{lib_name_devel} = %{epoch}:%{version}-%{release} Provides: %{lib_name_orig}-devel = %{epoch}:%{version}-%{release} Obsoletes: %{lib_name_devel} <= %{epoch}:%{version}-%{release} Obsoletes: %{mklibname -d wine 1} < %{epoch}:%{version} %ifarch %{ix86} Conflicts: wine64-devel %else Conflicts: wine-devel %endif %description -n %{wine}-devel Wine is a program which allows running Microsoft Windows programs (including DOS, Windows 3.x and Win32 executables) on Unix. %{wine}-devel contains the libraries and header files needed to develop programs which make use of wine. Wine is often updated. %prep %setup -q -n %name-%o_ver %patch1 -p0 -b .chinese %patch108 -p1 -b .conf GECKO_VERSION=$(sed -rn 's,^#define\s+GECKO_VERSION\s+"([^"]*)".*$,\1,p' dlls/appwiz.cpl/addons.c) [ "$GECKO_VERSION" = "%gecko_version" ] || { echo wine-gecko version mismatch; exit 1; } %build %ifarch %ix86 # (Anssi 04/2008) bug #39604 # Some protection systems complain "debugger detected" with our # -fomit-frame-pointer flag, so disable it. export CFLAGS="%{optflags} -fno-omit-frame-pointer" %endif # (Anssi 04/2008) # If icotool is present, it is used to rebuild icon files. It is in contrib # so we do not do that; this is here to ensure that installed icoutils does # not change build behaviour. export ICOTOOL=false autoreconf %configure2_5x --with-x \ --with-pulse \ %ifarch x86_64 --enable-win64 %endif %make depend %make %install rm -rf %{buildroot} %makeinstall_std LDCONFIG=/bin/true # Danny: dirty: #install -m755 tools/fnt2bdf -D %{buildroot}%{_bindir}/fnt2bdf # Allow users to launch Windows programs by just clicking on the .exe file... install -m755 %{SOURCE2} -D %{buildroot}%{_initrddir}/%{name} mkdir -p %{buildroot}%{_sysconfdir}/xdg/menus/applications-merged cat > %{buildroot}%{_sysconfdir}/xdg/menus/applications-merged/%{_real_vendor}-%{name}.menu < Applications Tools Emulators Wine %{_real_vendor}-%{name}.directory X-MandrivaLinux-MoreApplications-Emulators-Wine EOF mkdir -p %{buildroot}%{_datadir}/desktop-directories cat > %{buildroot}%{_datadir}/desktop-directories/%{_real_vendor}-%{name}.directory < %{buildroot}%{_datadir}/applications/%{_real_vendor}-%{name}-`echo $i|cut -d: -f1`.desktop << EOF [Desktop Entry] Name=`echo $i|cut -d: -f2` Comment=`echo $i|cut -d: -f2` Exec=`echo $i|cut -d: -f1` Icon=%{name} Terminal=false Type=Application Categories=X-MandrivaLinux-MoreApplications-Emulators-Wine; EOF done # Categories=Emulator does nothing and is added as a workaround to kde #27700 desktop-file-install --vendor="" \ --add-mime-type=application/x-zip-compressed \ --remove-mime-type=application/x-zip-compressed \ --add-category=Emulator \ --dir %{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/wine.desktop %ifarch x86_64 # fix the binary name sed -i 's,Exec=wine ,Exec=wine64 ,' %{buildroot}%{_datadir}/applications/wine.desktop %endif install -d %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}} # winecfg icon convert dlls/user32/resources/oic_winlogo.ico[8] %{buildroot}%{_miconsdir}/%{name}.png convert dlls/user32/resources/oic_winlogo.ico[7] %{buildroot}%{_iconsdir}/%{name}.png convert dlls/user32/resources/oic_winlogo.ico[6] %{buildroot}%{_liconsdir}/%{name}.png # notepad icon convert programs/notepad/notepad.ico[2] %{buildroot}%{_miconsdir}/notepad.png convert programs/notepad/notepad.ico[7] %{buildroot}%{_iconsdir}/notepad.png convert programs/notepad/notepad.ico[8] %{buildroot}%{_liconsdir}/notepad.png # winefile icon convert programs/winefile/winefile.ico[2] %{buildroot}%{_miconsdir}/winefile.png convert programs/winefile/winefile.ico[8] %{buildroot}%{_iconsdir}/winefile.png convert programs/winefile/winefile.ico[7] %{buildroot}%{_liconsdir}/winefile.png # regedit icon convert programs/regedit/regedit.ico[2] %{buildroot}%{_miconsdir}/regedit.png convert programs/regedit/regedit.ico[8] %{buildroot}%{_iconsdir}/regedit.png convert programs/regedit/regedit.ico[7] %{buildroot}%{_liconsdir}/regedit.png # winemine icon convert programs/winemine/winemine.ico[2] %{buildroot}%{_miconsdir}/winemine.png convert programs/winemine/winemine.ico[8] %{buildroot}%{_iconsdir}/winemine.png convert programs/winemine/winemine.ico[7] %{buildroot}%{_liconsdir}/winemine.png # wine uninstaller icon: convert programs/msiexec/msiexec.ico[2] %{buildroot}%{_miconsdir}/msiexec.png convert programs/msiexec/msiexec.ico[8] %{buildroot}%{_iconsdir}/msiexec.png convert programs/msiexec/msiexec.ico[7] %{buildroot}%{_liconsdir}/msiexec.png # change the icons in the respective .desktop files, in order: sed -i 's,Icon=%{name},Icon=notepad,' %{buildroot}%{_datadir}/applications/%{_real_vendor}-wine-notepad.desktop sed -i 's,Icon=%{name},Icon=winefile,' %{buildroot}%{_datadir}/applications/%{_real_vendor}-wine-winefile.desktop sed -i 's,Icon=%{name},Icon=regedit,' %{buildroot}%{_datadir}/applications/%{_real_vendor}-wine-regedit.desktop sed -i 's,Icon=%{name},Icon=winemine,' %{buildroot}%{_datadir}/applications/%{_real_vendor}-wine-winemine.desktop sed -i 's,Icon=%{name},Icon=msiexec,' "%{buildroot}%{_datadir}/applications/%{_real_vendor}-wine-wine uninstaller.desktop" %ifarch x86_64 chrpath -d %{buildroot}%{_bindir}/{wine64,wineserver,wmc,wrc} %{buildroot}%{_libdir}/%{name}/*.so %else chrpath -d %{buildroot}%{_bindir}/{wine,wineserver,wmc,wrc} %{buildroot}%{_libdir}/%{name}/*.so %endif %ifarch x86_64 cat > README.install.urpmi <