Name: fbzx
Version: 2.10.0
Release: 6%{?dist}
Summary: A ZX Spectrum emulator for FrameBuffer
Group: Applications/Emulators
License: GPLv3+
URL: http://www.rastersoft.com/fbzx.html
Source0: %{name}-%{version}-noroms.tar.bz2
# The above file is derived from:
# http://www.rastersoft.com/descargas/%{name}-%{version}.tar.bz2
# This file contains Spectrum ROMs and cannot be shipped in Fedora.
# Therefore we use this script to remove them before shipping it.
# Download the upstream tarball and invoke this script while in
# the tarball's directory:
# ./fbzx-generate-tarball.sh 2.10.0
Source1: %{name}-generate-tarball.sh
Source2: README_%{name}.Fedora
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: SDL-devel
BuildRequires: alsa-lib-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: desktop-file-utils
Requires: hicolor-icon-theme
%description
FBZX is a Sinclair Spectrum emulator, designed to work at full screen using
the FrameBuffer or under X-Windows.
%prep
%setup -q
# Patch to use rpm optflags
sed -i -e "s/-O2 -Wno-pointer-sign -Wall //" Makefile
%build
export CFLAGS="%{optflags}"
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
#install application
mkdir -p %{buildroot}%{_bindir}
install -m 755 %{name} %{buildroot}%{_bindir}
# install data
mkdir -p %{buildroot}%{_datadir}/%{name}
install -p -m 644 keymap.bmp %{buildroot}%{_datadir}/%{name}
# install icon
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -p -m 644 %{name}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
# install desktop file
mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install \
--remove-key Version \
--add-category Emulator \
--dir %{buildroot}%{_datadir}/applications \
%{name}.desktop
# install Fedora README
install -pm0644 %{SOURCE2} README.Fedora
# Register as an application to be visible in the software center
#
# NOTE: It would be *awesome* if this file was maintained by the upstream
# project, translated and installed into the right place during `make install`.
#
# See http://www.freedesktop.org/software/appstream/docs/ for more details.
#
mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata
cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Ryan Lerch <rlerch@redhat.com> -->
<!--
EmailAddress: raster@rastersoft.com
SentUpstream: 2014-09-24
-->
<application>
<id type="desktop">fbzx.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<summary> a Sinclair Spectrum emulator</summary>
<description>
<p>
FBZX is a Sinclair Spectrum emulator that accurately emulates the screen,
sound and keyboard of many Spectrum devices including Issue 2 and Issue 3
of the original Spectrum, the classic and the Spanish 128K versions,
and the Amstrad Plus 2 and 2A.
</p>
</description>
<url type="homepage">http://www.rastersoft.com/fbzx.html</url>
<screenshots>
<screenshot type="default">http://www.rastersoft.com/imagen/fbzx.png</screenshot>
</screenshots>
</application>
EOF
%clean
rm -rf %{buildroot}
%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%doc AMSTRAD CAPABILITIES COPYING FAQ README* TODO VERSIONS
%changelog
* Thu Mar 26 2015 Richard Hughes <rhughes@redhat.com> - 2.10.0-6
- Add an AppData file for the software center
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.10.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.10.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.10.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Wed Aug 08 2012 Andrea Musuruane <musuruan@gmail.com> 2.10.0-1
- Updated to new upstream release
* Wed May 23 2012 Andrea Musuruane <musuruan@gmail.com> 2.9.0-1
- Updated to new upstream release
- More consistent macro usage
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Fri Dec 09 2011 Andrea Musuruane <musuruan@gmail.com> 2.7.0-1
- Updated to new upstream release
* Thu Apr 07 2011 Andrea Musuruane <musuruan@gmail.com> 2.5.0-1
- Updated to new upstream release
* Sat Apr 02 2011 Andrea Musuruane <musuruan@gmail.com> 2.4.3-1
- Updated to new upstream release
* Thu Feb 17 2011 Andrea Musuruane <musuruan@gmail.com> 2.4.2-1
- Updated to new upstream release
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sat Mar 20 2010 Andrea Musuruane <musuruan@gmail.com> 2.4.1-1
- Updated to new upstream release
* Sun Feb 21 2010 Andrea Musuruane <musuruan@gmail.com> 2.4.0-1
- Updated to new upstream release
* Sun Dec 27 2009 Andrea Musuruane <musuruan@gmail.com> 2.3.0-1
- Updated to new upstream release
* Sat Dec 26 2009 Andrea Musuruane <musuruan@gmail.com> 2.2.0-1
- Updated to new upstream release
* Wed Aug 12 2009 Andrea Musuruane <musuruan@gmail.com> 2.1b-2
- Icon is now installed into %%{_datadir}/icons/hicolor/scalable/apps
- Added missing desktop-file-utils to BuildRequires
- Added missing hicolor-icon-theme to Requires
- Preserved timestamps
* Sat Jul 25 2009 Andrea Musuruane <musuruan@gmail.com> 2.1b-1
- First release