File fceux.spec of Package fceux-2.1

# spec file for package fceux
# Copyright (c) 2012 SuSE Linux Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Malcolm J Lewis <>
# 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

Name:           fceux
Version:        2.1.5
Release:        0
License:        GPL-2.0
Summary:        Nintendo Famicom (NES) Emulator
Group:          Amusements/Games/Other
Patch1:         fceux-2.1.5-datatype-gz.patch
BuildRequires:  SDL-devel
BuildRequires:  gcc-c++
BuildRequires:  gd-devel
BuildRequires:  gtk2-devel
BuildRequires:  lua-devel
BuildRequires:  scons
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

FCEUX is a cross platform, NTSC and PAL Famicom/NES emulator that is an
evolution of the original FCE Ultra emulator. Over time FCE Ultra had
separated into many separate branches.

The concept behind FCEUX is to merge elements from FCE Ultra, FCEU
rerecording, FCEUXD, FCEUXDSP, and FCEU-mm into a single branch of FCEU. As
the X implies, it is an all-encompassing FCEU emulator that gives the best
of all worlds for the casual player, the ROM-hacking community, Lua
Scripters, and the Tool-Assisted Speedrun Community.

%setup -q -c
%patch1 -p1
# Fix end of line encoding warnings
find . -type f -exec sed -i 's/\r//' {} \;
# Fix "Your file uses  __DATE and __TIME__ this causes the package to rebuild when not needed warning"
sed -i 's/\"\_\_TIME\_\_\" \"\_\_DATE\_\_\"\\n/Built January 2012\\n/g' fceu%{version}/src/config.cpp

cd fceu%{version}
CFLAGS="%{optflags} -fno-strict-aliasing" LDFLAGS="$LDFLAGS -ldl -lX11" scons %{?_smp_mflags} CREATE_AVI=1

cd fceu%{version}
install -Dpm 0755 bin/fceux %{buildroot}%{_bindir}/fceux
install -Dpm 0644 fceux.png %{buildroot}%{_datadir}/pixmaps/fceux.png
%suse_update_desktop_file -n -c fceux "Nintendo Famicom (NES) Emulator" "NES/Famicom emulator" fceux fceux System Emulator

%if 0%{?sles_version} && 0%{?suse_version} == 1110
update-desktop-database &> /dev/null || :

%if 0%{?sles_version} && 0%{?suse_version} == 1110
update-desktop-database &> /dev/null || :

%{?buildroot:%__rm -rf %{buildroot}}

%doc fceu%{version}/Authors.txt fceu%{version}/bin/*.chm fceu%{version}/bin/auxlib.lua
%doc fceu%{version}/changelog.txt fceu%{version}/COPYING
%doc fceu%{version}/documentation/* fceu%{version}/output/luaScripts