File xroar.spec of Package xroar

#
# spec file for package xroar
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           xroar
Version:        1.8.2
Release:        0
Summary:        Dragon and Tandy CoCo Emulator
License:        GPL-3.0+
Group:          System/Emulators/Other
URL:            https://www.6809.org.uk/xroar/
Source0:        https://www.6809.org.uk/xroar/dl/%{name}-%{version}.tar.gz
BuildRequires:  icns-utils
BuildRequires:  ImageMagick
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(gtkglext-1.0)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  texinfo
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}

%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_build

# Build docs
make html
make pdf

# 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

# Extract Mac OS X icons
icns2png -x src/macosx/%{name}.icns 

# Install icons
for i in 16 32 48 128; do
  install -d -m 755 %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
  install -m 644 %{name}_${i}x${i}x32.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

%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%files
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_infodir}/%{name}*
%{_mandir}/man1/%{name}.1%{?ext_man}
%license COPYING.GPL COPYING.LGPL
%doc ChangeLog README README.SDS
%doc doc/%{name}.html doc/*.png
%doc doc/%{name}.pdf

%changelog
openSUSE Build Service is sponsored by