Blob Blame History Raw
Summary: An Atari ST/STE/TT/Falcon emulator suitable for playing games
Name: hatari
Version: 2.0.0
Release: 5%{?dist}
License: GPLv2+
URL: http://hatari.tuxfamily.org/
Source0: http://download.tuxfamily.org/%{name}/%{version}/%{name}-%{version}.tar.bz2
# Take DESTDIR into consideration when installing symlinks
# https://hg.tuxfamily.org/mercurialroot/hatari/hatari/rev/35281f58daab
Patch0: %{name}-2.0.0-symlinks.patch
# Compile on aarch64
# https://listengine.tuxfamily.org/lists.tuxfamily.org/hatari-devel/2016/12/msg00013.html
Patch1: %{name}-2.0.0-aarch64.patch
# Compile on s390(x)
Patch2: %{name}-2.0.0-s390.patch
# PythonUI: Support both Hatari config file locations
# https://hg.tuxfamily.org/mercurialroot/hatari/hatari/raw-rev/7b3bcc42bc81
Patch3: %{name}-2.0.0-hatariui_conf.patch
# PythonUI: Support for Hatari v2.0 option changes
# https://hg.tuxfamily.org/mercurialroot/hatari/hatari/raw-rev/d1668fda4200
Patch4: %{name}-2.0.0-hatariui_options.patch

BuildRequires: cmake
BuildRequires: SDL2-devel
BuildRequires: zlib-devel
BuildRequires: libpng-devel
BuildRequires: readline-devel
BuildRequires: portaudio-devel
BuildRequires: systemd-devel
BuildRequires: python2-devel
BuildRequires: desktop-file-utils
Requires: hicolor-icon-theme
# Required by zip2st and atari-hd-image
Requires: unzip
Requires: mtools
Requires: dosfstools


%package ui
Summary: External user interface for Hatari
Group: Applications/Emulators
Requires: %{name} = %{version}-%{release}
Requires: python2
Requires: pygtk2
Requires: hicolor-icon-theme


%description
Hatari is an emulator for the Atari ST, STE, TT and Falcon computers.

The Atari ST was a 16/32 bit computer system which was first released 
by Atari in 1985. Using the Motorola 68000 CPU, it was a very popular 
computer having quite a lot of CPU power at that time.

Unlike most other open source ST emulators which try to give you a good
environment for running GEM applications, Hatari tries to emulate the hardware
as close as possible so that it is able to run most of the old Atari games
and demos.  Because of this, it may be somewhat slower than less accurate
emulators.


%description ui

Hatari UI is an out-of-process user interface for the Hatari emulator and its 
built-in debugger which can (optionally) embed the Hatari emulator window. 


%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

# Remove shebang from non executable scripts
for pyfile in dialogs.py hatari.py uihelpers.py config.py
do
  sed -i -e '/^#!\//, 1d' python-ui/$pyfile
done

# Fix interpreter
for pyfile in tools/debugger/hatari_profile.py tools/hconsole/example.py tools/hconsole/hconsole.py python-ui/hatariui.py python-ui/debugui.py
do
  sed -i '1s|/usr/bin/env python|%{__python2}|' $pyfile
done

# Fix desktop file
sed -i '/^MimeType=*/s/$/;/' \
  share/applications/%{name}.desktop

%build
%cmake \
  -DCMAKE_VERBOSE_MAKEFILE=TRUE \
  -DCMAKE_BUILD_TYPE:STRING=None \
  -DDOCDIR:PATH=%{_pkgdocdir} \
  -DBUILD_SHARED_LIBS:BOOL=OFF .
# It does not compile with smp_mflags
make


%install
%make_install

# Fix file permissions
chmod 644 %{buildroot}%{_datadir}/%{name}/hatariui/conftypes.py

# Install French man page
install -d -m 755 %{buildroot}%{_mandir}/fr/man1
install -p -m 644 doc/fr/hatari.1 %{buildroot}%{_mandir}/fr/man1

# Validate desktop file
desktop-file-validate \
  %{buildroot}%{_datadir}/applications/%{name}.desktop

# Install hatari-ui desktop file
desktop-file-install \
  --delete-original \
  --remove-key Encoding \
  --set-comment="External user interface for Hatari" \
  --add-category Game \
  --add-category Emulator \
  --dir %{buildroot}%{_datadir}/applications \
  %{buildroot}%{_datadir}/applications/hatariui.desktop

# 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: hatari-devel@lists.tuxfamily.org
SentUpstream: 2014-09-24
-->
<application>
  <id type="desktop">hatari.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <summary>Atari emulator</summary>
  <description>
    <p>
      Hatari is an emulator that emulates Atari ST, Atari STE, Atari TT and Atari Falcon
      devices.
      It has the ability to emulate the joystick with input from either the host's
      keyboard or joystick.
    </p>
  </description>
  <url type="homepage">http://hatari.tuxfamily.org/</url>
  <screenshots>
    <screenshot type="default">http://hatari.tuxfamily.org/screens/features/deskhigh.png</screenshot>
  </screenshots>
</application>
EOF


%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
/bin/touch --no-create %{_datadir}/mime/packages &>/dev/null || :
/usr/bin/update-desktop-database &> /dev/null || :


%post ui
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :


%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
    /usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
fi
/usr/bin/update-desktop-database &> /dev/null || :


%postun ui
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi


%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
/usr/bin/update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || :


%posttrans ui
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files
%{_bindir}/*
%{_datadir}/%{name}
%{_mandir}/man1/*
%{_mandir}/fr/man1/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/*.appdata.xml
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/icons/hicolor/*/mimetypes/*
%{_datadir}/mime/packages/hatari.xml
%doc %{_pkgdocdir}
%license gpl.txt
%exclude %{_bindir}/hatariui
%exclude %{_datadir}/%{name}/hatariui
%exclude %{_datadir}/%{name}/hconsole
%exclude %{_mandir}/man1/hatariui.1*
%exclude %{_mandir}/man1/hconsole.1*

%files ui
%{_bindir}/hatariui
%{_datadir}/%{name}/hatariui
%{_datadir}/%{name}/hconsole
%{_mandir}/man1/hatariui.1*
%{_mandir}/man1/hconsole.1*
%{_datadir}/applications/hatariui.desktop
%doc python-ui/{README,release-notes.txt,TODO}
%exclude %{_datadir}/%{name}/hatariui/README
%exclude %{_datadir}/%{name}/hatariui/release-notes.txt
%exclude %{_datadir}/%{name}/hatariui/TODO
%exclude %{_datadir}/%{name}/hconsole/release-notes.txt


%changelog
* Thu Jan 12 2017 Igor Gnatenko <ignatenko@redhat.com> - 2.0.0-5
- Rebuild for readline 7.x

* Sat Dec 31 2016 Andrea Musuruane <musuruan@gmail.com> - 2.0.0-4
- Added a patch to support both hatari config file locations in hatariui
- Added a patch to support hatari v2.0 option changes in hatariui

* Tue Dec 20 2016 Dan HorĂ¡k <dan[at]danny.cz> - 2.0.0-3
- Added a patch to compile under s390(x)

* Sat Dec 17 2016 Andrea Musuruane <musuruan@gmail.com> - 2.0.0-2
- Added a patch to compile under aarch64

* Sun Nov 27 2016 Andrea Musuruane <musuruan@gmail.com> - 2.0.0-1
- Updated to upstream 2.0.0
- Updated description

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Oct 18 2015 Andrea Musuruane <musuruan@gmail.com> 1.9.0-2
- Correctly marked license file

* Sat Oct 17 2015 Andrea Musuruane <musuruan@gmail.com> 1.9.0-1
- Updated to upstream 1.9.0
- Spec file cleanup

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Mar 26 2015 Richard Hughes <rhughes@redhat.com> - 1.8.0-2
- Add an AppData file for the software center

* Wed Sep 24 2014 Andrea Musuruane <musuruan@gmail.com> 1.8.0-1
- Updated to upstream 1.8.0
- Dropped cleaning at the beginning of %%install
- Spec file cleanup

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.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> - 1.7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Sep 13 2013 Andrea Musuruane <musuruan@gmail.com> 1.7.0-3
- Used unversioned docdir (BZ #993813)

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Jun 27 2013 Andrea Musuruane <musuruan@gmail.com> 1.7.0-1
- Updated to upstream 1.7.0
- Fixed vendor tag logic in a prettier way
- Dropped obsolete Group, Buildroot, %%clean and %%defattr

* Wed Apr 24 2013 Jon Ciesla <limburgher@gmail.com> - 1.6.2-4
- Drop desktop vendor tag.

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jul 05 2012 Andrea Musuruane <musuruan@gmail.com> 1.6.2-1
- updated to upstream 1.6.2

* Sat Jan 14 2012 Andrea Musuruane <musuruan@gmail.com> 1.6.1-1
- updated to upstream 1.6.1

* Fri Jan 06 2012 Andrea Musuruane <musuruan@gmail.com> 1.6.0-1
- updated upstream URL
- updated upstream Source0

* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 1.5.0-2
- Rebuild for new libpng

* Sun Sep 25 2011 Andrea Musuruane <musuruan@gmail.com> 1.5.0-1
- updated to upstream 1.5.0
- added patches to include hatari window at hatariui startup (SF #18340)
- dropped Debian man pages now that hatari has its own

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sun Nov 14 2010 Andrea Musuruane <musuruan@gmail.com> 1.4.0-4
- added license among docs

* Sun Nov 14 2010 Andrea Musuruane <musuruan@gmail.com> 1.4.0-3
- ui subpackage now requires the fully versioned base package
- more consistent macro usage

* Fri Nov 12 2010 Andrea Musuruane <musuruan@gmail.com> 1.4.0-2
- fixed Requires
- added manpages from Debian
- removed script extensions (.sh, .py) from scripts installed into /usr/bin
- macro usage is more consistent now

* Sun Jul 18 2010 Andrea Musuruane <musuruan@gmail.com> 1.4.0-1
- updated to upstream 1.4.0
- dropped README.tos now that emutos.txt is supplied

* Sat Mar 06 2010 Andrea Musuruane <musuruan@gmail.com> 1.3.1-2
- link against libm (BZ #564801)

* Sat Sep 12 2009 Andrea Musuruane <musuruan@gmail.com> 1.3.1-1
- updated to upstream 1.3.1

* Sat Aug 22 2009 Andrea Musuruane <musuruan@gmail.com> 1.3.0-1
- updated to upstream 1.3.0
- disabled new upstream python UI
- updated icon cache snippets
- used upstream Mac OS X icons
- preserved french man page timestamp

* Mon Aug 10 2009 Andrea Musuruane <musuruan@gmail.com> 1.2.0-4
- updated Source0 URL

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Jan 24 2009 Andrea Musuruane <musuruan@gmail.com> 1.2.0-1
- updated to upstream 1.2.0
- dropped no longer needed hmsa tool patch
- updated upstream URL
- updated Source0 URL

* Sat Nov 29 2008 Andrea Musuruane <musuruan@gmail.com> 1.1.0-1
- updated to upstream 1.1.0

* Sat Apr 05 2008 Andrea Musuruane <musuruan@gmail.com> 1.0.1-1
- updated to upstream 1.0.1

* Mon Mar 17 2008 Andrea Musuruane <musuruan@gmail.com> 1.0.0-1
- updated to upstream 1.0.0
- removed icon extension from desktop file to match Icon Theme Specification

* Sun Feb 10 2008 Andrea Musuruane <musuruan@gmail.com> 0.95-5
- Rebuilt against gcc 4.3

* Sat Oct 06 2007 Andrea Musuruane <musuruan@gmail.com> 0.95-4
- Fixed doc/authors.txt file encoding
- Updated icon cache scriptlets to be compliant to new guidelines

* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 0.95-3
- Rebuild for selinux ppc32 issue.

* Mon Aug 20 2007 Andrea Musuruane <musuruan@gmail.com> 0.95-2
- changed license due to new guidelines 
- removed %%{?dist} tag from changelog

* Sat Jun 23 2007 Andrea Musuruane <musuruan@gmail.com> 0.95-1
- updated to upstream 0.95
- updated description
- README.tos and hatari.desktop are no longer built in the spec file
- added new upstream hmsa tool
- added new upstream french man page
- updated icon cache scriptlets to be compliant to new guidelines
- cosmetic changes

* Sat Mar 17 2007 Andrea Musuruane <musuruan@gmail.com> 0.90-6
- 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
- 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
- added README.tos to explain that Hatari is shipped with EmuTOS

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

* Sun Oct 08 2006 Andrea Musuruane <musuruan@gmail.com> 0.90-2
- 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
- initial package