File wine-snapshot.spec of Package wine-snapshot

#
# spec file for package wine-snapshot
#
# Copyright (c) 2012 SUSE LINUX Products 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/
#

%bcond_with scanbuild

%if %{with scanbuild}
%bcond_without clang
%else
%bcond_with clang
%endif

Name:           wine-snapshot
%if %{with clang}
BuildRequires:  llvm-clang
%endif
BuildRequires:  Mesa-devel
BuildRequires:  vulkan-devel
BuildRequires:  SDL2-devel
BuildRequires:  alsa-devel
BuildRequires:  bison
#BuildRequires:  capi4linux
BuildRequires:  cups-devel
BuildRequires:  dbus-1-devel
BuildRequires:  desktop-file-utils
BuildRequires:  flex
BuildRequires:  fontconfig-devel
BuildRequires:  freeglut-devel
BuildRequires:  freetype2-devel
BuildRequires:  giflib-devel
BuildRequires:  gnutls-devel
BuildRequires:  libgphoto2-devel
BuildRequires:  libjpeg-devel
%if 0%{?suse_version} >= 1230
BuildRequires:  liblcms2-devel
%endif
BuildRequires:  libpcap-devel
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  libxml2-devel
BuildRequires:  libxslt-devel
BuildRequires:  ncurses-devel
BuildRequires:  openldap2-devel
BuildRequires:  pulseaudio-devel
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  valgrind-devel
BuildRequires:  xorg-x11-devel
BuildRequires:  xz

%if 0%{?suse_version} == 0 || 0%{?suse_version} < 1210
BuildRequires:  hal-devel
%endif

BuildRequires:  fdupes
BuildRequires:  gstreamer-plugins-base-devel
BuildRequires:  libgphoto2-devel
BuildRequires:  libgsm-devel

%if 0%{?suse_version} >= 1120
BuildRequires:  libv4l-devel
BuildRequires:  openal-soft-devel
%endif

# make it build on sle11 sp3. others are changed via projectconfig
%if 0%{?suse_version} == 1110
BuildRequires:  gcc47
#!BuildIgnore:  libgcc43
#!BuildIgnore:  libgomp43
%endif

%if 0%{?suse_version} >= 1500
# for the PE DLLs
%ifarch x86_64
BuildRequires:  mingw64-cross-gcc
%endif
%ifarch %ix86
%if 0%{?suse_version} >= 1500
BuildRequires:  mingw32-cross-gcc
%endif
%endif
%endif

Version:        5.0.git.1519240102.5ec6b8f807
Release:        0
Summary:        An MS Windows emulator
License:        LGPL-2.1+
Group:          System/Emulators/PC
Url:            http://www.winehq.org/
Source0:        wine-%version.tar.xz
Patch0:         susepatches.patch
Source2:        README.SuSE
Source3:        wine.desktop
Source4:        ubuntuwine.tar.bz2
Source9:        wine-msi.desktop
# my local snapshot script
Source6:        wine-snapshot.sh

# this is regenerated below... keep it at Source7, or change the generating code.
Source7:        baselibs.conf

Source8:	wine-rpmlintrc

%ifarch x86_64
Requires:       %{name}-32bit = %{version}
%endif

# Required for wine-gecko
Conflicts:      otherproviders(wine)
Provides:       wine
Requires:       wine-gecko >= 1.8
# Prepackaged mono build. But only recommend due to size.
Recommends:     wine-mono
Recommends:     winetricks

Recommends:     dosbox
Recommends:     wine-mp3


BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
An MS Windows emulator, consisting of both runtime and also source
compatibility functions. You can run your MS executables with it, and
you can write your Windows programs under Linux and link against the
WINE libraries.

It is not necessary to have a Windows installation to run WINE.

Please have a look at /usr/share/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' wine can be
configured by running 'winecfg'.


%package devel
Summary:        Files for wine development
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
This RPM contains the header files and development tools for the WINE
libraries.


%prep
%setup -q -n wine-%version
%patch0 -p1
#
cp %{S:2} .
#

%build
# currently not building with LTO
%define _lto_cflags %{nil}
%ifarch %ix86
# Steam and others need correct $ebp frames.
export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fomit-frame-pointer//'`
%endif

# Use 64bit able compiler for SLE11 SP2 and SP3
%if 0%{?suse_version} == 1110
if [ -f /usr/bin/gcc-4.6 ]; then
        export CC=gcc-4.6
fi
if [ -f /usr/bin/gcc-4.7 ]; then
	export CC=gcc-4.7
fi
if [ -f /usr/bin/gcc-4.8 ]; then
	export CC=gcc-4.8
fi
%endif

# CLANG
%if %{with clang}
sed -r -i -e "s:(as_fn_error.*You need gcc.*):#\1:g" configure
%if %{with scanbuild}
export CC="/usr/share/clang/scan-build/ccc-analyzer" \
export CXX="/usr/share/clang/scan-build/c++-analyzer" \
%else
export CC=clang \
export CXX=clang++ \
%endif
%endif

CFLAGS="-DLDAP_DEPRECATED=1 ${RPM_OPT_FLAGS}" \
%configure \
%ifarch x86_64
	--enable-win64 \
%endif
	--disable-tests

# 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/i386-windows"	>> %SOURCE7
echo "  +^/usr/lib/wine/i386-unix"	>> %SOURCE7
grep SONAME_ config.log
grep SONAME_ config.log|grep -v 'so"'|sed -e 's/^.*\(".*"\).*$/	requires \1/;'|sort -u >>%SOURCE7
%if 0%{?suse_version} >= 1210
  echo " recommends \"alsa-plugins-pulse-32bit\"" >> %SOURCE7
  echo " recommends \"alsa-plugins-32bit\"" >> %SOURCE7
%endif
%if 0%{?suse_version} >= 1310
  echo " requires \"p11-kit-32bit\"" >> %SOURCE7
%endif
echo "%name-devel"			>> %SOURCE7
echo "  +^/usr/lib/wine/.*def" >> %SOURCE7
cat %SOURCE7
%endif

grep "have_x=yes" config.log || exit 1
%if %{with scanbuild}
/usr/share/clang/scan-build/scan-build \
%endif
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}
%ifarch x86_64
mkdir -p \
   %{buildroot}/usr/lib/wine/i386-windows \
   %{buildroot}/usr/lib/wine/i386-unix
ln -s \
    /usr/lib/wine/i386-windows \
    /usr/lib/wine/i386-unix    \
  %buildroot/usr/%_lib/wine/
%endif


# install desktop file
install -d $RPM_BUILD_ROOT%{_datadir}/applications/
install -m 644 %SOURCE3 $RPM_BUILD_ROOT%{_datadir}/applications/
install -m 644 %SOURCE9 $RPM_BUILD_ROOT%{_datadir}/applications/
mv $RPM_BUILD_ROOT/%{_mandir}/de.UTF-8 $RPM_BUILD_ROOT/%{_mandir}/de
mv $RPM_BUILD_ROOT/%{_mandir}/fr.UTF-8 $RPM_BUILD_ROOT/%{_mandir}/fr
%ifnarch x86_64
mv $RPM_BUILD_ROOT/%{_mandir}/pl.UTF-8 $RPM_BUILD_ROOT/%{_mandir}/pl
%endif

%ifarch %ix86 x86_64
# Use plain strip, which unlike the MinGW variant preserves the wine builtin marker
find %{buildroot}/usr/lib*/wine/*-windows/ -type f -exec strip --strip-debug {} +
%endif

%ifarch aarch64
# Do not ship static *.a libs
rm %{buildroot}%{_libdir}/wine/*-windows/*.a
%endif


# Copied from Ubuntu Wine out of debian.diff
# https://launchpad.net/~ubuntu-wine/+archive/ppa/+packages
# taken on 1.2rc2 time.
tar -xjf %{S:4}
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 -c -m 644 *.desktop $RPM_BUILD_ROOT%{_datadir}/applications/

	install -d $RPM_BUILD_ROOT%{_datadir}/desktop-directories/
	install -c -m 644 *.directory $RPM_BUILD_ROOT%{_datadir}/desktop-directories/

	# Install icons
	install -d $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scalable/apps/
	install -c -m 644 *.svg $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scalable/apps/
cd ..

# Update all desktop files
# does not really work because of unknown categories -> RPMLINT warning

%suse_update_desktop_file wine 

#suse_update_desktop_file wine-notepad
#suse_update_desktop_file wine-uninstaller
#suse_update_desktop_file wine-winemine
#suse_update_desktop_file wine-winehelp
#suse_update_desktop_file wine-winefile
#suse_update_desktop_file wine-browsedrive
#suse_update_desktop_file wine-winecfg
#suse_update_desktop_file wine-regedit

# Remember to not enable fdupes. we create too many hardlinks for btrfs to handle. :(

# Find additional requires from config.log.
# The current issue is that the requires are also added to -devel package
# But it should not be a problem because it requires main package which also
# requires all of them.

# find the implicit dependencies
%define winedir %_builddir/wine-%version/
cat >%winedir/my-find-requires.sh <<EOF
#!/bin/bash
%{__find_requires}
%ifarch x86_64
grep SONAME_ %winedir/config.log|grep -v 'so"'|sed -e 's/^.*"\(.*\)".*$/\1()(64bit)/;'|sort -u
%else
grep SONAME_ %winedir/config.log|grep -v 'so"'|sed -e 's/^.*"\(.*\)".*$/\1/;'|sort -u
%endif
EOF
chmod 755 %winedir/my-find-requires.sh
%define _use_internal_dependency_generator 0
%define __find_requires %winedir/my-find-requires.sh

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%license LICENSE LICENSE.OLD
%doc ANNOUNCE AUTHORS README*
%{_bindir}/function_grep.pl
%{_bindir}/msidb
%{_bindir}/msiexec
%{_bindir}/notepad
%{_bindir}/regedit
%{_bindir}/regsvr32
%{_bindir}/wineboot
%{_bindir}/winecfg
%{_bindir}/wineconsole
%{_bindir}/winedbg
%{_bindir}/winefile
%{_bindir}/winemine
%{_bindir}/winepath
%{_bindir}/wineserver
%{_datadir}/wine
%ifnarch x86_64 aarch64
%doc %{_mandir}/man1/wine.1*
%endif
%doc %{_mandir}/man1/winedbg.1*
%doc %{_mandir}/man1/wineserver.1*
%ifnarch x86_64 aarch64
%doc %dir %doc %{_mandir}/pl
%doc %dir %doc %{_mandir}/pl/man1
%doc %{_mandir}/*/man1/wine.1*
%endif
%doc %{_mandir}/*/man1/wineserver.1*
%doc %{_mandir}/man1/msiexec.1.*
%doc %{_mandir}/man1/notepad.1.*
%doc %{_mandir}/man1/regedit.1.*
%doc %{_mandir}/man1/regsvr32.1.*
%doc %{_mandir}/man1/wineboot.1.*
%doc %{_mandir}/man1/winebuild.1.*
%doc %{_mandir}/man1/winecfg.1.*
%doc %{_mandir}/man1/wineconsole.1.*
%doc %{_mandir}/man1/winecpp.1.*
%doc %{_mandir}/man1/winefile.1.*
%doc %{_mandir}/man1/winemine.1.*
%doc %{_mandir}/man1/winepath.1.*
%dir %{_sysconfdir}/xdg/menus/
%dir %{_sysconfdir}/xdg/menus/applications-merged
%config %{_sysconfdir}/xdg/menus/applications-merged/*.menu
%{_datadir}/applications/*.desktop
%dir %{_datadir}/desktop-directories/
%{_datadir}/desktop-directories/*.directory
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/scalable/apps/*.svg
%ifarch %ix86
%{_bindir}/wine
%{_bindir}/wine-preloader
%endif
%ifarch ppc %arm
%{_bindir}/wine
%endif
%ifarch x86_64 aarch64
%{_bindir}/wine64
%{_bindir}/wine64-preloader
%endif
%ifarch x86_64
%dir /usr/lib/wine/
%dir /usr/lib/wine/i386-windows
%dir /usr/lib/wine/i386-unix
/usr/%{_lib}/wine/i386-windows
/usr/%{_lib}/wine/i386-unix
%endif
%dir %{_libdir}/wine
%dir %{_libdir}/wine/*-windows
%{_libdir}/wine/*-windows/*.[b-z]*
%{_libdir}/wine/*-windows/*.ax
%{_libdir}/wine/*-windows/*.acm
%ifarch aarch64
%{_libdir}/wine/*-windows/st*
%endif
%dir %{_libdir}/wine/*-unix
%{_libdir}/wine/*-unix/*.so*

%files devel
%defattr(-,root,root)
%{_includedir}/wine
%{_bindir}/widl
%{_bindir}/winebuild
%{_bindir}/winecpp
%{_bindir}/winedump
%{_bindir}/wineg++
%{_bindir}/winegcc
%{_bindir}/winemaker
%{_bindir}/wmc
%{_bindir}/wrc
%dir %{_libdir}/wine/*-unix
%{_libdir}/wine/*-unix/*.a
%if 0%{?suse_version} >= 1550
%ifarch %{ix86} x86_64
# only generated with mingw
%dir %{_libdir}/wine/*-windows
%{_libdir}/wine/*-windows/*.a
%endif
%endif
%doc %{_mandir}/man1/winemaker.1*
%doc %{_mandir}/*/man1/winemaker.1*
%doc %{_mandir}/man1/widl.1*
%doc %{_mandir}/man1/winedump.1*
%doc %{_mandir}/man1/wineg++.1*
%doc %{_mandir}/man1/winegcc.1*
%doc %{_mandir}/man1/wmc.1*
%doc %{_mandir}/man1/wrc.1*

# {_datadir}/aclocal/wine.m4

%changelog
openSUSE Build Service is sponsored by