File SpaceCadetPinball.spec of Package SpaceCadetPinball

#
# spec file for package SpaceCadetPinball
#
# Copyright (c) 2024 mantarimay
# Copyright (c) 2023 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:           SpaceCadetPinball
Version:        0
Release:        0
Summary:        Decompilation of 3D Pinball for Windows – Space Cadet
License:        MIT
Group:          Amusements/Games/Action/Arcade
URL:            https://github.com/k4zmu2a/SpaceCadetPinball
Source0:        %{name}-%{version}.tar.zst
Source1:        Pinball.tar.xz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(SDL2_mixer)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  update-desktop-files
# Just for scaling/converting icons
BuildRequires:  ImageMagick

%description
Reverse engineering of 3D Pinball for Windows – Space Cadet, a game bundled
with Windows.

%prep
%autosetup -a1

%build
%cmake
%make_build

%install
install -dm 0755 %{buildroot}%{_libdir}
mv Pinball %{buildroot}%{_libdir}/%{name}
rm -fv %{buildroot}%{_libdir}/%{name}/pinball.exe
install -Dm 0755 bin/%{name} %{buildroot}%{_libdir}/%{name}/%{name}
install -dm 0755 %{buildroot}%{_bindir}/
ln -sf %{_libdir}/%{name}/%{name} %{buildroot}%{_bindir}/
for scale in 16 22 24 32 36 48 64 72 96 128 192 256 512 ; do
	mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${scale}x${scale}/apps
	convert %{name}/Icon_1.ico -scale ${scale}x${scale} %{buildroot}%{_datadir}/icons/hicolor/${scale}x${scale}/apps/%{name}.png
done
%suse_update_desktop_file -c %{name} "Space Cadet" "Space Cadet 3D Pinball" %{name} %{name}
%suse_update_desktop_file -r -C "Reverse engineering of 3D Pinball for Windows" %{name} Game ArcadeGame

%check

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_libdir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/*/*/*

%changelog
openSUSE Build Service is sponsored by