File zsnes.spec of Package zsnes

#
# spec file for package zsnes (Version 1.51)
#
# Copyright (c) 2013 Stefan Elser <stefan@fam-elser.de>
#
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.

Name:		zsnes
Version:	1.51
Release:	2
License:	GPL-2.0
Summary:	Super Nintendo / Falmicon Emulator
Url:		http://www.zsnes.com/
Group:		System/Emulators/Other
Source0:	zsnes151src.tar.bz2
Source1:	zsnes.desktop
Patch0:		0003-gcc-4.3-ftbfs.patch
Patch1:		0012-Fix-build-with-gcc-4.7.patch
Patch2:		0004-manpage-in-usr-share-man.patch

BuildRequires: 	gcc9
BuildRequires: 	gcc9-c++
BuildRequires: 	gcc9-PIE
BuildRequires: 	make
BuildRequires: 	nasm
BuildRequires: 	ncurses-devel
%if 0%{?suse_version} == 1110
BuildRequires: libpng-devel
#BuildRequires: libpng-compat-devel
BuildRequires: SDL-devel
%else
BuildRequires:  libpng12-devel
BuildRequires:  libpng12-compat-devel
BuildRequires:  libSDL-devel
%endif
BuildRequires: 	update-desktop-files

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


%description
ZSNES is a Super Nintendo / Super Falmicon Emulator under GNU GPL.

ZSNES can boot mostly all known games for this platform.

%prep
%setup -n zsnes_1_51
cd src
%patch0 -p2
%patch1 -p2
%patch2 -p2

%build
cd src
CC="gcc-9" CXX="g++-9" ./configure --enable-release --prefix=%{_prefix} force_arch=i586
make

%install
cd src
%make_install
#Desktop icon
mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p %{buildroot}%{_datadir}/applications
install -m 644 icons/64x64x32.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/
%suse_update_desktop_file -r -G %{name} %{name} System Emulator

%clean
rm -rf '%{buildroot}'

%files
%defattr(-,root,root)
%{_bindir}/%{name}*
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/*

%changelog

openSUSE Build Service is sponsored by