File thextech-smbx.spec of Package thextech-smbx
#
# spec file for package thextech-smbx
#
# Copyright (c) 2023, Martin Hauke <mardnh@gmx.de>
#
# 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: thextech-smbx
Version: 1.3.6+git20230120
Release: 0
Summary: A Super Mario Brothers Fan game engine (SMBX)
License: GPL-3.0-or-later
Group: Amusements/Games/Action/Arcade
URL: https://wohlsoft.ru/projects/TheXTech/
#Git-Clone: https://github.com/Wohlstand/TheXTech
Source: TheXTech-%{version}.tar.xz
Source1: https://wohlsoft.ru/TheXTech/_downloads/thextech-smbx13-assets-full.7z
Patch0: no-rpath.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: update-desktop-files
BuildRequires: git-core
BuildRequires: fdupes
BuildRequires: p7zip-full
BuildRequires: pkgconfig
BuildRequires: pkgconfig(SDL2_mixer)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(sdl2)
Provides: bundled(AudioCodecs)
Provides: bundled(FreeImageLite)
Provides: bundled(luabind)
Provides: bundled(LuaJIT)
Provides: bundled(PGE_File_Formats)
Provides: bundled(SDL-Mixer-X)
Provides: smbx
%description
TheXTech is a free and open-source game engine for Mario-like
platforming games. There is a complete and extended source code
port of the Super Mario Bros. X 1.3 game engine (later just "SMBX"),
and its direct unofficial continuation after development halted in
the 2011th year. This engine preserves full compatibility with
levels and episodes made for the original SMBX game, including its
repacks. And it's allowed to create brand-new Levels, Episodes,
and content packs. Unlike the original SMBX game that depends on
Windows and x86, TheXTech can work on many operating systems
(including Linux distros, macOS, xBSD, Android, Haiku, etc.) and
processor architectures (including x86_64, ARM, PowerPC, MIPS, etc.).
%prep
%setup -q -n TheXTech-%{version}
%patch0 -p1
sed -i 's/\r$//' changelog.txt README.md
mkdir assets && cd assets
7z x %{SOURCE1}
cp License.txt License-assets.txt
# remove bundled libs
rm -Rf 3rdparty/{freetype,harfbuzz,tinyfiledialogs}
%build
%cmake \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DUSE_SYSTEM_SDL2=ON \
-DUSE_FREEIMAGE_SYSTEM_LIBS=ON \
-DPGE_SHARED_SDLMIXER=OFF \
-DTHEXTECH_FIXED_ASSETS_PATH=%{_datadir}/thextech-smbx \
-DTHEXTECH_USER_DIR_NAME=".thextech-smbx" \
-DTHEXTECH_EXECUTABLE_NAME="thextech-smbx"
%cmake_build
%install
%cmake_install
rm %{buildroot}/usr/share/doc/thextech-smbx/{License.TheXTech.txt,ReadMe.txt,changelog.txt}
rm %{buildroot}/usr/share/thextech-smbx/{.nomedia,License.txt,License-assets.txt}
# assets
install -d %{buildroot}%{_datadir}/thextech-smbx
cp -R assets/{battle,graphics,music,sound,worlds}/ %{buildroot}%{_datadir}/thextech-smbx/
cp assets/{music.ini,sounds.ini,thextech.ini,intro.lvl,outro.lvl} %{buildroot}%{_datadir}/thextech-smbx/
for i in 32 128 256 512 ; do
install -Dm 0644 resources/icon/thextech_${i}.png %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
done
%fdupes %{buildroot}%{_datadir}
%suse_update_desktop_file -c %{name} %{name} "Super Mario Bros. X (SMBX)" %{name} %{name} "Game;ArcadeGame;"
%files
%license LICENSE assets/License-assets.txt
%doc changelog.txt README.md
%{_bindir}/thextech-smbx
%{_datadir}/thextech-smbx/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%changelog