File stella.spec of Package stella

#
# spec file for package stella
#
# 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/
#


# stella needs a c++20 compiler at least
%if 0%{?sle_version} && 0%{?sle_version} < 160000
%global force_gcc_version 13
%endif
Name:           stella
Version:        7.0
Release:        0
Summary:        Atari 2600 VCS emulator
License:        GPL-2.0-only
Group:          System/Emulators/Other
URL:            https://stella-emu.github.io
Source0:        https://github.com/stella-emu/stella/releases/download/%{version}/stella-%{version}-src.tar.xz
BuildRequires:  clang-devel
BuildRequires:  dos2unix
BuildRequires:  gcc%{?force_gcc_version}-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libpng) >= 1.6
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(zlib)

%description
Stella was originally developed for Linux by Bradford W. Mott, and is currently maintained by Stephen Anthony.
Since its original release several people have joined the development team to port Stella to other
operating systems such as AcornOS, AmigaOS, DOS, FreeBSD, IRIX, Linux, OS/2, MacOS, Unix, and Windows.
The development team is working hard to perfect the emulator and we hope you enjoy our effort.

%prep
%setup -q
dos2unix -c ascii README-SDL.txt

%build
%if 0%{?force_gcc_version}
export CXX="g++-%{force_gcc_version}"
%endif
# FIXME: you should use the %%configure macro
CFLAGS="%{optflags}"
./configure --prefix=%{_prefix} \
            --docdir=%{_docdir}/%{name}

%make_build

%install
mkdir -p %{buildroot}%{_docdir}/%{name}
%make_install

rm %{buildroot}%{_docdir}/%{name}/License.txt
rm %{buildroot}%{_docdir}/%{name}/Copyright.txt

%files
%doc %{_docdir}/%{name}
%doc Announce.txt README.md Todo.txt Changes.txt README-SDL.txt
%license License.txt Copyright.txt
%{_bindir}/%{name}
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/*
%dir %{_datadir}/icons/hicolor/*/apps
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by