File xroar.spec of Package xroar

#
# spec file for package xroar
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           xroar
Version:        0.34.3
Release:        0
Summary:        Dragon and Tandy CoCo Emulator
License:        GPL-2.0+
Group:          System/Emulators
Url:            http://www.6809.org.uk/xroar/
Source0:        http://www.6809.org.uk/xroar/dl/%name-%version.tar.gz
BuildRequires:  gtk2-devel
BuildRequires:  gtkglext-devel
BuildRequires:  libsndfile-devel
BuildRequires:  alsa-devel
BuildRequires:  pulseaudio-devel
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  update-desktop-files
BuildRequires:  ImageMagick
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A Dragon 32, Dragon 64 and Tandy CoCo emulator for Unix, Linux, GP32, MacOS X
and Windows32. It uses standard cassette images (".cas" files) and virtual
diskettes (".dsk" or ".vdk" files) but has its own snapshot format at the
moment (no ".pak" file support).

ROM images of the firmware are required.

%prep
%setup -q

%build
%configure --without-oss
make %{?_smp_mflags}

# Generate desktop file
cat >%{name}.desktop <<EOF
[Desktop Entry]
Name=XRoar
GenericName=Dragon 32/64 Emulator
Comment=Emulates the Dragon 32/64 and Tandy CoCo
Exec=%{name}
Icon=%{name}
Terminal=false
Type=Application
Categories=System;Emulator;
EOF

%install
%make_install DEB_BUILD_OPTIONS=nostrip

# default rom directory
mkdir -p %{buildroot}%{_datadir}/%{name}/roms

# Convert Windows icons and install them
for i in 16 32 48; do
  convert src/windows32/%{name}-${i}x${i}.ico %{name}-${i}x${i}.png
  install -d -m 755 %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
  install -m 644 %{name}-${i}x${i}.png \
    %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done

# Install desktop files
desktop-file-install \
  --dir %{buildroot}%{_datadir}/applications \
  %{name}.desktop

rm -f %{buildroot}%{_infodir}/dir

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_infodir}/%{name}*
%{_mandir}/man1/%{name}.1*
%doc COPYING.GPL COPYING.LGPL-2.1
%doc ChangeLog README

%changelog
openSUSE Build Service is sponsored by