Blob Blame History Raw
Summary: An Atari ST emulator suitable for playing games
Name: hatari
Version: 0.90
Release: 6%{?dist}
License: GPL
Group: Applications/Emulators
URL: http://hatari.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0: http://dl.sf.net/%{name}/%{name}-%{version}.tar.gz
Source1: hatari.png
BuildRequires: SDL-devel >= 1.2.0
BuildRequires: zlib-devel
BuildRequires: desktop-file-utils
Requires: hicolor-icon-theme


%description
Hatari is an Atari-ST and STE emulator for Linux. More precisely, it 
is an adaption of the WinSTon source code to Linux, using the UAE CPU
core instead of the original, non-portable assembler CPU core. 

Unlike other ST emulators which concentrate on desktop compatibility,
it is suitable for playing games.


%prep
%setup -q

# fix Makefile not to strip binaries during make install
sed -i 's/@INSTALL_PROGRAM@ -s/@INSTALL_PROGRAM@/' Makefile.cnf.in


%build
%configure --datadir=%{_datadir}/hatari
make

# README.tos
cat >doc/README.tos <<EOF
To run the emulator a TOS ROM image is needed. EmuTOS, a free implementation 
of TOS, is shipped with hatari. 

EmuTOS is a single-user single-tasking operating system for the 32 bit Atari
computers and emulators. It can be used as a replacement for the TOS images
typically needed today for using emulators and it is also running on some
real hardware, like the Atari Mega STE. All the source code is open and
free, licensed under the GNU General Public License (GPL). A copy of the GNU 
GPL can be found in the gpl.txt file.

EmuTOS has its home at sourceforge:
http://sourceforge.net/projects/emutos

Hatari is shipped with tos.img ROM image that is identical to etos256us.img 
from the binary package of version 0.8.1 available at sourceforge:
http://dl.sourceforge.net/sourceforge/emutos/emutos256k-0.8.1.zip
EOF

# Build desktop icon
cat >%{name}.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=Hatari
Comment=Atari ST emulator
Exec=%{name}
Icon=%{name}.png
Terminal=false
Type=Application
Categories=Game;Emulator;
Version=%{version}
EOF


%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} 
install -d -m 755 %{buildroot}%{_mandir}/man1
install -m 644 doc/hatari.1 %{buildroot}%{_mandir}/man1

# install desktop file and icon
mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install --vendor fedora         \
  --dir %{buildroot}%{_datadir}/applications \
  %{name}.desktop
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
cp %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/48x48/apps


%clean
rm -rf %{buildroot}


%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%files
%defattr(-,root,root)
%{_bindir}/hatari
%{_datadir}/hatari
%{_mandir}/man1/hatari.1*
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%doc gpl.txt readme.txt doc/{*.txt,*.html,images}
%doc doc/README.tos


%changelog
* Sat Mar 17 2007 Andrea Musuruane <musuruan@gmail.com> 0.90-6%{?dist}
- dropped --add-category X-Fedora from desktop-file-install
- changed .desktop category to Game;Emulator;
- now using sed to fix makefile not to strip binaries during make install
- cosmetic changes to BR section

* Mon Oct 23 2006 Andrea Musuruane <musuruan@gmail.com> 0.90-5%{?dist}
- added a patch not to strip binaries during make install
- added hicolor-icon-theme to Requires

* Sat Oct 21 2006 Andrea Musuruane <musuruan@gmail.com> 0.90-4%{?dist}
- added README.tos to explain that Hatari is shipped with EmuTOS

* Fri Oct 20 2006 Andrea Musuruane <musuruan@gmail.com> 0.90-3%{?dist}
- new release for FE migration

* Sun Oct 08 2006 Andrea Musuruane <musuruan@gmail.com> 0.90-2%{?dist}
- replaced %%_mandir with %%{_mandir}
- full URL is now specified in the Source tag
- added .desktop file and icons

* Sat Sep 30 2006 Andrea Musuruane <musuruan@gmail.com> 0.90-1%{?dist}
- initial package