Blob Blame History Raw
Name:           fbzx
Version:        3.0.0
Release:        1%{?dist}
Summary:        A ZX Spectrum emulator for FrameBuffer

License:        GPLv3+
URL:            http://www.rastersoft.com/programas/fbzx.html
Source0:        %{name}-%{version}-noroms.tar.gz
# The above file is derived from:
# https://github.com/rastersoft/fbzx/archive/%{version}/%{name}-%{version}.tar.gz
# 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 3.0.0
Source1:        %{name}-generate-tarball.sh
Source2:        README_%{name}.Fedora

BuildRequires:  SDL-devel
BuildRequires:  alsa-lib-devel
BuildRequires:  pulseaudio-libs-devel
BuildRequires:  libappstream-glib
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

# Fix Makefile
sed -i 's/$(CC) -o/$(CC) $(CFLAGS) -o/' src/Makefile


%build
export CFLAGS="%{optflags}"
export CPPFLAGS="%{optflags}"
make %{?_smp_mflags} 


%install
# install application
mkdir -p %{buildroot}%{_bindir}
install -m 755 src/%{name} %{buildroot}%{_bindir}

# install data
mkdir -p %{buildroot}%{_datadir}/%{name}
install -p -m 644 data/keymap.bmp %{buildroot}%{_datadir}/%{name}

# install icon
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -p -m 644 data/%{name}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps

# install desktop file
mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install \
  --remove-key Version \
  --remove-key Encoding \
  --add-category Emulator \
  --dir %{buildroot}%{_datadir}/applications \
  data/%{name}.desktop

# install AppData file
mkdir -p %{buildroot}%{_datadir}/appdata
install -p -m 644 fbzx.appdata.xml %{buildroot}%{_datadir}/appdata
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata.xml

# install Fedora README
install -pm0644 %{SOURCE2} README.Fedora


%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
%{_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
* Sat Sep 05 2015 Andrea Musuruane <musuruan@gmail.com> - 3.0.0-1
- Updated to new upstream release

* Sat Apr 04 2015 Andrea Musuruane <musuruan@gmail.com> - 2.11.1-1
- Updated to new upstream release
- Appdata file is now provided by upstream
- Dropped obsolete Group, Buildroot, %%clean and %%defattr
- Dropped cleaning at the beginning of %%install

* 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